首页 > 移动平台 > 详细

Revit API移动风管

时间:2014-02-26 13:55:21      阅读:339      评论:0      收藏:0      [点我收藏+]
移动风管曲线就可以移动风管
bubuko.com,布布扣
//移动风管
[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;
    }
}
bubuko.com,布布扣
url:http://greatverve.cnblogs.com/p/revit-api-duct-move.html

Revit API移动风管

原文:http://www.cnblogs.com/greatverve/p/revit-api-duct-move.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!