Rectrive duct shape

how can retrieve the duct shape. I found the duct shape class but don’t know how to use it.

Hi @shibujoseukken,

Can you show us your graph? :slight_smile:

You can get shapes from Connectors, so connector manager etc.

Exactly, like Tomasz says: you can get them from the connectors:

2 Likes

i was trying to do this by python. but I got errors.

my code is here

Version:0.9 StartHTML:00000097 EndHTML:00003851 StartFragment:00000199 EndFragment:00003813 import clr

Import DocumentManager

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager

Import RevitAPI

clr.AddReference("RevitAPI")
import Autodesk
#from Autodesk.Revit.DB import *
from Autodesk.Revit.DB import Mechanical
from Autodesk.Revit.DB.Mechanical import DuctInsulation
from Autodesk.Revit.DB.Mechanical import DuctShape
from Autodesk.Revit.DB.Mechanical import DuctSettings
from Autodesk.Revit.DB import Connector
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

el = UnwrapElement (IN[0])

mepsystemList =
conManager =
cType =
shList =
co1List =

for i in el:
id = i.MEPSystem.Name
mepsystemList.append(id)

for cn in el:
con = cn.ConnectorManager
conManager.append(con)

for c in conManager:
co = c.Connectors
cType.append(co)

for sh in cType:
shape = sh.Shape
shList.append(shape)
#OUT = mepsystemList,cType,dir(cType[0]),dir(el[0])
OUT = cType

Looks like you’re trying to get the property from a list, ConnectorSet. You need to iterate through each Connector in the ConnectorSet.