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?
Thanks,
Solved! Go to Solution.
Solved by Kevin.Lawson.PE. Go to Solution.
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
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?
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.
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.
Can't find what you're looking for? Ask the community or share your knowledge.