Hi,
I am mep bim modeling and I have to render with revit in lod 400, i have a problem to set the correct level with duct fitting when the level does not correspond : if I move the correct level with duct fitting another element changes an elevation.
I can’t resold the issue and i asked autodesk hot line and they have no solution yet.
I would to know there is a solution with dynamo.
Thanks
Hi @yiningparis,
You can use the Element Change Level custom node of the Genius Loci package for this task.
if you don’t have packages just used below python script.
input-01 element
input 02 level
import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *
clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
element = UnwrapElement(IN[0])
ref_level = UnwrapElement(IN[1])
listout =
TransactionManager.Instance.EnsureInTransaction(doc)
for i,x in enumerate(element):
ref_levelid = ref_level.Id
#familyinstances
try:
object_param_level = x.get_Parameter(BuiltInParameter.FAMILY_LEVEL_PARAM)
object_level = doc.GetElement(object_param_level.AsElementId())
object_param_offset = x.get_Parameter(BuiltInParameter.INSTANCE_FREE_HOST_OFFSET_PARAM)
object_newoffset = object_param_offset.AsDouble() + object_level.Elevation - ref_level.Elevation
object_param_level.Set(ref_levelid)
object_param_offset.Set(object_newoffset)
listout.append(x)
#system families
except:
try:
object_param_level = x.get_Parameter(BuiltInParameter.RBS_START_LEVEL_PARAM)
object_param_level.Set(ref_levelid)
listout.append(x)
except:
pass
TransactionManager.Instance.TransactionTaskDone()
OUT = listout
Hi Alban,
it works and now i’ll try with the python script after i would to create a script who set a correct level automatically.
Thanks
It’s ridiculously easy with the Closest Level node, still in the Genius Loci package.
2 Likes