zoukankan      html  css  js  c++  java
  • Revit API布置卫浴装置


    //放置卫浴装置
    [Transaction(TransactionMode.Manual)]
    [Regeneration(RegenerationOption.Manual)]
    public class cmdSetPlumb : IExternalCommand
    {
        public Result Execute(ExternalCommandData cmdData, ref string msg, ElementSet elements)
        {
            UIDocument uiDoc = cmdData.Application.ActiveUIDocument;

            Transaction ts = new Transaction(uiDoc.Document, "SetFamily");
            ts.Start();

            FilteredElementCollector collector = new FilteredElementCollector(uiDoc.Document);
            collector.OfCategory(BuiltInCategory.OST_PlumbingFixtures);
            FamilySymbol fs = null;
            foreach (Element el in collector)
            {
                fs = el as FamilySymbol;
                break;
            }
            XYZ xyz = uiDoc.Selection.PickPoint();//选择一个点
            
    //根据族符号放置族实例的方法
            FamilyInstance fi = uiDoc.Document.Create.NewFamilyInstance(xyz, fs, StructuralType.NonStructural);

            ts.Commit();

            return Result.Succeeded;
        }
    }
    url:http://greatverve.cnblogs.com/p/PlumbingFixtures.html
  • 相关阅读:
    LeetCode
    LeetCode
    LeetCode
    深度学习笔记 (二) 在TensorFlow上训练一个多层卷积神经网络
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
  • 原文地址:https://www.cnblogs.com/greatverve/p/PlumbingFixtures.html
Copyright © 2011-2022 走看看