移動風管曲線就可以移動風管
[TransactionAttribute(Autodesk.Revit.Attributes.TransactionMode.Manual)]
cmdMoveDuct : 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;
LocationCurve lCurve = duct.Location LocationCurve;
lCurve.Move( XYZ(, , ));
ts.Commit();
Result.Succeeded;
}
}url: