本文整理汇总了C#中XYZ.Count方法的典型用法代码示例。如果您正苦于以下问题:C# XYZ.Count方法的具体用法?C# XYZ.Count怎么用?C# XYZ.Count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XYZ
的用法示例。
在下文中一共展示了XYZ.Count方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateFilletedRectangleCurveLoop
private CurveLoop CreateFilletedRectangleCurveLoop(XYZ[] corners, double filletRadius)
{
int sz = corners.Count();
if (sz != 4)
return null;
XYZ[] radii = new XYZ[4] {
new XYZ( corners[0].X + filletRadius, corners[0].Y + filletRadius, 0.0 ),
new XYZ( corners[1].X - filletRadius, corners[1].Y + filletRadius, 0.0 ),
new XYZ( corners[2].X - filletRadius, corners[2].Y - filletRadius, 0.0 ),
new XYZ( corners[3].X + filletRadius, corners[3].Y - filletRadius, 0.0 ),
};
XYZ[] fillets = new XYZ[8] {
new XYZ( corners[0].X, corners[0].Y + filletRadius, 0.0 ),
new XYZ( corners[0].X + filletRadius, corners[0].Y, 0.0 ),
new XYZ( corners[1].X - filletRadius, corners[1].Y, 0.0 ),
new XYZ( corners[1].X, corners[1].Y + filletRadius, 0.0 ),
new XYZ( corners[2].X, corners[2].Y - filletRadius, 0.0 ),
new XYZ( corners[2].X - filletRadius, corners[2].Y, 0.0 ),
new XYZ( corners[3].X + filletRadius, corners[3].Y, 0.0 ),
new XYZ( corners[3].X, corners[3].Y - filletRadius, 0.0 )
};
CurveLoop curveLoop = new CurveLoop();
for (int ii = 0; ii < 4; ii++)
{
curveLoop.Append(Line.CreateBound(fillets[ii * 2 + 1], fillets[(ii * 2 + 2) % 8]));
double startAngle = Math.PI * ((ii + 3) % 4) / 2;
curveLoop.Append(CreateXYArc(radii[(ii + 1) % 4], filletRadius, startAngle, startAngle + Math.PI / 2));
}
return curveLoop;
}
示例2: InternalSetPositions
/// <summary>
/// Set the positions of the internal family instance from a list of XYZ points
/// </summary>
/// <param name="points"></param>
private void InternalSetPositions( XYZ[] points )
{
TransactionManager.Instance.EnsureInTransaction(Document);
IList<ElementId> placePointIds = AdaptiveComponentInstanceUtils.GetInstancePlacementPointElementRefIds(InternalFamilyInstance);
if (placePointIds.Count() != points.Count())
throw new Exception("The input list of points does not have the same number of values required by the adaptive component.");
// Set the position of each placement point
int i = 0;
foreach (var id in placePointIds)
{
var point = (Autodesk.Revit.DB.ReferencePoint)Document.GetElement(id);
point.Position = points[i];
i++;
}
TransactionManager.Instance.TransactionTaskDone();
}
示例3: CreatePolyCurveLoop
private CurveLoop CreatePolyCurveLoop(XYZ[] corners)
{
int sz = corners.Count();
if (sz == 0)
return null;
CurveLoop curveLoop = new CurveLoop();
for (int ii = 0; ii < sz; ii++)
curveLoop.Append(Line.CreateBound(corners[ii], corners[(ii + 1) % sz]));
return curveLoop;
}