移动风管曲线就可以移动风管
//移动风管
[TransactionAttribute(Autodesk.Revit.Attributes.TransactionMode.Manual)]
public class cmdMoveDuct : IExternalCommand
{
    public Result Execute(ExternalCommandData commandData, ref string messages, ElementSet elements)
    {
        UIApplication app = commandData.Application;
        Document doc = app.ActiveUIDocument.Document;
        Selection sel = app.ActiveUIDocument.Selection;

        Transaction ts = new Transaction(doc, "revit");
        ts.Start();

        Reference refDuct = sel.PickObject(ObjectType.Element, "duct");
        Duct duct = doc.GetElement(refDuct) as Duct;
        LocationCurve lCurve = duct.Location as LocationCurve;
        lCurve.Move(new XYZ(030));//向上移动3

        ts.Commit();

        return Result.Succeeded;
    }
}
url:http://greatverve.cnblogs.com/p/revit-api-duct-move.html

相关文章:

  • 2022-03-08
  • 2021-12-11
  • 2021-10-30
  • 2021-11-24
  • 2021-10-06
  • 2021-11-18
  • 2021-08-28
  • 2021-10-25
猜你喜欢
  • 2021-05-30
  • 2021-12-10
  • 2021-11-05
  • 2022-12-23
  • 2021-07-12
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案