本文整理汇总了C#中Arc.get_EndPoint方法的典型用法代码示例。如果您正苦于以下问题:C# Arc.get_EndPoint方法的具体用法?C# Arc.get_EndPoint怎么用?C# Arc.get_EndPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Arc
的用法示例。
在下文中一共展示了Arc.get_EndPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TransformArc
/// <summary>
/// Get the arc to create grid according to the specified bubble location
/// </summary>
/// <param name="arc">The original selected line</param>
/// <param name="bubLoc">bubble location</param>
/// <returns>The arc to create grid</returns>
protected Arc TransformArc(Arc arc, BubbleLocation bubLoc)
{
Arc arcToCreate;
if (bubLoc == BubbleLocation.StartPoint)
{
arcToCreate = arc;
}
else
{
// Get start point, end point of the arc and the middle point on it
Autodesk.Revit.DB.XYZ startPoint = arc.get_EndPoint(0);
Autodesk.Revit.DB.XYZ endPoint = arc.get_EndPoint(1);
bool clockwise = (arc.Normal.Z == -1);
// Get start angel and end angel of arc
double startDegree = arc.get_EndParameter(0);
double endDegree = arc.get_EndParameter(1);
// Handle the case that the arc is clockwise
if (clockwise && startDegree > 0 && endDegree > 0)
{
startDegree = 2 * Values.PI - startDegree;
endDegree = 2 * Values.PI - endDegree;
}
else if (clockwise && startDegree < 0)
{
double temp = endDegree;
endDegree = -1 * startDegree;
startDegree = -1 * temp;
}
double sumDegree = (startDegree + endDegree) / 2;
while (sumDegree > 2 * Values.PI)
{
sumDegree -= 2 * Values.PI;
}
while (sumDegree < -2 * Values.PI)
{
sumDegree += 2 * Values.PI;
}
Autodesk.Revit.DB.XYZ midPoint = new Autodesk.Revit.DB.XYZ (arc.Center.X + arc.Radius * Math.Cos(sumDegree),
arc.Center.Y + arc.Radius * Math.Sin(sumDegree), 0);
arcToCreate = m_appCreator.NewArc(endPoint, startPoint, midPoint);
}
return arcToCreate;
}