Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get connector plane or direction of the conduit

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
allan.moraes
473 Views, 5 Replies

Get connector plane or direction of the conduit

Hey guys,

 

I'm trying to obtain the plane that a connector is placed at, to later get the normal of that plane and now which direction the conduit must start going to before taking a turn to align with another element's connector.

 

I saw that there is the Angle property in a connector, however all the times I tried recovering it, it came 0. I didn't see any other way of getting the direction/angle on the XY plane of that connector. Does anyone knows how to do something close to that?

 

allanmoraes_0-1641474268330.png

 

Thanks,

 

Labels (3)
5 REPLIES 5
Message 2 of 6
smarente1
in reply to: allan.moraes

You can get the direction of the conduit which will be the same direction as its connector. 

direction = conduit.Location.Curve.Direction
#Angle in degrees:
print(math.degrees(math.acos(direction.X))) # Out --> 150 degrees

smarente1_0-1641489035162.png

 

Message 3 of 6
allan.moraes
in reply to: allan.moraes

Hey @smarente1,

 

Thanks. That would definately work, but I won't have the conduit. The app creates the conduit between two FamilyInstances selected by the user, and uses a not connected conduit to start the route from.

Any ideas for that case?

Message 4 of 6
smarente1
in reply to: allan.moraes

The two family instances selected by the user will each have a location point. If you have two points you can calculate the angle of a line segment that connects the two points. 

 

 

Message 5 of 6

If you know what connector on the conduit fitting you want to connect to, you can get that connector direction by FamilyInstance (Conduit Fitting) -> MEPModel -> ConnectorManager -> Connector -> Coordinate system -> BasisZ. 

 

KevinLawsonPE_0-1641493934717.png

 

-Kevin Lawson, PE
www.rippleengineeringsoftware.com
Revit heating and cooling load calculations in one click!
Message 6 of 6
allan.moraes
in reply to: allan.moraes

Awesome @Kevin.Lawson.PE!, thanks!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Rail Community