Getting XYZ Point of Conduit Fitting Elbow

751 views Asked by At

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

There are 1 answers

1
Jeremy Tammik On BEST ANSWER

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;