Connector category, the duct not only has two ends, may also have on the curve.
[TransactionAttribute (Autodesk. Revit. Attributes. TransactionMode. Manual)]
Cmdconne: IExternalCommand
{
Result Execute (ExternalCommandData commandData, messages, ElementSet elements)
{
UIApplication app = commandData. Application;
Document doc = app. ActiveUIDocument. Document;
Selection sel = app. ActiveUIDocument. Selection;
Transaction ts = Transaction (doc ,);
Ts. Start ();
Reference refDuct = sel. PickObject (ObjectType. Element ,);
Duct duct = doc. GetElement (refDuct) Duct;
ConnectorSetIterator csi = duct. ConnectorManager. Connectors. ForwardIterator ();
ICount =;
IEnd =;
ICurve =;
(Csi. MoveNext ())
{
ICount + =;
Connector conn = csi. Current Connector;
(ConnectorType. End = conn. ConnectorType ){
IEnd + =;
}
(ConnectorType. Curve = conn. ConnectorType ){
ICurve + =;
}
}
TaskDialog. Show (, iCount ++ iEnd ++ iCurve ++ duct. UniqueId );
Ts. Commit ();
Result. Succeeded;
}
} Url: http://greatverve.cnblogs.com/p/revit-mep-api-ConnectorType.html