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