Conduit Fitting re-assign Level
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm testing a static code (Python) to re-assign level to Conduits + Conduit Fittings that were placed by BIM operators to a Level that we want to be changed.
When I run to code on a Conduit Fitting that is not connected to other Conduits, everything works fine (Conduit Fitting is maintaining same z)
Once I run the code on a Conduit Fitting that has Conduits attached to it, they move up (z changes).
Below is the Python code:
# CONDUIT FITTING TO TEST Id = 9803491
EL_ID = ElementId(9803491)
# SELECT THE CONDUIT FITTING TO TEST
MY_EL = doc.GetElement(EL_ID)
# B_FOOTING = CURRENT REFERENCE LEVEL FOR THE CONDUIT+CONDUIT FITTINGS
# FIRST_FLOOR = LEVEL WHERE I WANT THE CONDUIT+CONDUIT FITTINGS RE-ASSIGNED
# LEVEL ID WHERE I WANT MY CONDUIT FITTING TO BE SET
FIRST_FLOOR_LEVEL_ID = 355
t = Transaction(doc, 'SET LEVEL')
t.Start()
OFF_SET = - FIRST_FLOOR_LEVEL_ELEV + B_FOOTING_LEVEL_ELEV + i.get_Parameter(BuiltInParameter.INSTANCE_FREE_HOST_OFFSET_PARAM).AsDouble()
MY_EL.get_Parameter(BuiltInParameter.INSTANCE_FREE_HOST_OFFSET_PARAM).Set(OFF_SET)
MY_EL.get_Parameter(BuiltInParameter.FAMILY_LEVEL_PARAM).Set(ElementId(355))
doc.Regenerate()
t.Commit()
Help greatly appreciated.
Thank you.