I am trying to get the union family set for ducts and pipes in routing preferences for revit 2022. I managed to get the one for duct types but the same method fails for pipe types. You can see that python recognises that PipeTye has a attribute called “Union” but it is set to none eventhough I made sure that it is set in revit. Any advices?
@tarek.mallak It is working perfectly from my side, can you share your script?
try using RoutingPreferenceManager
import clr import sys import System clr.AddReference('ProtoGeometry') from Autodesk.DesignScript.Geometry import * import Autodesk.DesignScript.Geometry as DS #import Revit API clr.AddReference('RevitAPI') import Autodesk from Autodesk.Revit.DB import * import Autodesk.Revit.DB as DB from Autodesk.Revit.DB.Plumbing import * clr.AddReference('RevitServices') import RevitServices from RevitServices.Persistence import DocumentManager from RevitServices.Transactions import TransactionManager doc = DocumentManager.Instance.CurrentDBDocument pipe = UnwrapElement(IN) manager = pipe.PipeType.RoutingPreferenceManager ruleUnion = manager.GetRule(RoutingPreferenceRuleGroupType.Unions , 0) unionType1 = doc.GetElement(ruleUnion.MEPPartId) OUT = unionType1
Works perfectly! Thanks a lot!