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: 

Getting XYZ MidPoint of Conduit/CableTray Elbow Fitting

1 REPLY 1
SOLVED
Reply
Message 1 of 2
jsweeney6BNA7
1255 Views, 1 Reply

Getting XYZ MidPoint of Conduit/CableTray Elbow Fitting

I'm trying to get the midpoint, or any XYZ point really, of conduit and cable tray fittings so as to automatically apply an angle tag to them. I've already figured out getting the midpoint of straight pieces of conduit and auto tagging them, but am stuck on how to get the midpoint of a conduit's elbow fitting. If someone could point me to an SDK sample or building coder post or post a block of code here that points me in the right direction it would be much appreciated!

Thanks.

1 REPLY 1
Message 2 of 2

Dear Jake,

 

Thank you for your query.

 

I already answered your corresponding question on StackOverflow:

 

https://stackoverflow.com/questions/46104337/getting-xyz-point-of-conduit-fitting-elbow

 

For the sake of completness, I repeat it here:

 

Fittings are family instances. A family instance has a Location property. In the case of a fitting, it is actually a LocationPoint. Cast the Location property to a LocationPoint and query its point:

 

  Location loc = fam_inst.Location;
  LocationPoint lp = loc as LocationPoint
  XYZ p = (null == lp) ? XYZ.Zero : lp.Point;

I hope this helps.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

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

Post to forums  

Autodesk Design & Make Report