Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 67020

startAngle in Arc ctor

$
0
0

I'm programmatically transferring the Alignment Object from Autocad 2016 Civil3D to Revit.

The Alignment object has several properties, however, due to the limited number of constrcutors on the Arc class, only 1 Arc constructor is of interest:

 

 publicstatic Arc Create(
Plane plane,
double radius,
double startAngle,
double endAngle
)

 

Unfortunately the vector from which the startAngle is measured is not defined.

 

I have the following inforrmation from Autocad:

 

XYZ StartPoint = newXYZ(533.9217456, 144.1244247, 10);

XYZ CenterPoint = newXYZ(673.141807, -63.52377422, 10);

double Radius = 250;

XYZ EndPoint = newXYZ(760.14143, 170.849999, 10);

 

from these I can determine the following:

 

XYZ refVec = CenterPoint - XYZ.Zero;

XYZ xVec = (CenterPoint - StartPoint).Normalize();

XYZ yVec = (CenterPoint - EndPoint).Normalize();

XYZ normal = xVec.CrossProduct(yVec);

 

using the vectors from origin to CenterPoint and origin to StartPoint, I can determine the startAngle:

double DeflectedAngle = refVec.AngleTo(xVec);

 

With

double Delta = 0.94606029451277518;

 

this yields:

Plane plane = app.Create.NewPlane(normal, CenterPoint);

Arc arc = Arc.Create(plane, Radius, DeflectedAngle, DeflectedAngle + Delta);

 

However there is a small unexpected offset between the vector CenterPoint to StartPoint and the start of the arc, see attachment.

 

So my question is: from which vector is the startAngle measured? 

 

 


Viewing all articles
Browse latest Browse all 67020

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>