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

Re: Family Instance Orientation

$
0
0

Finally managed to get results that seems to work (more testing needed). First of all I had a mistake in my code. At some point I tried to convert radians to degrees, however the supplied value was already in degrees, causing unexpected results Smiley Frustrated

.

 

Looking through lot of information, especially on the building coder website () I finally ended up with something that seems to work.

 

 

Dim Trf As DB.Transform = ElementListInstance.GetTransform()
Dim basX As XYZ = Trf.BasisX
Dim basZ As XYZ = Trf.BasisZ

Dim vectorTran As XYZ = Trf.OfVector(Trf.BasisX)
Dim ObjectRotation As Double = Trf.BasisX.AngleOnPlaneTo(vectorTran, Trf.BasisZ) * (180 / Math.PI)

Knowing the angle of the object allowed me to create a 3DView on a position relative to the selected object.

 


Viewing all articles
Browse latest Browse all 67020

Trending Articles



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