Revit API移动风管
移动风管曲线就可以移动风管
url:http://greatverve.cnblogs.com/p/revit-api-duct-move.html
//移动风管
[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(0, 3, 0));//向上移动3
ts.Commit();
return Result.Succeeded;
}
}
[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(0, 3, 0));//向上移动3
ts.Commit();
return Result.Succeeded;
}
}
我这个博客废弃不用了,今天想寻找外链的时候,突然想到这个博客权重很高。
有需要免费外链的,留言即可,我准备把这个博客变成免费的友情链接站点。