zoukankan      html  css  js  c++  java
  • revit添加族参数

    打开一个族文件,并为族文件添加参数

    public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
    {
    try
    {
    UIApplication uiApp = commandData.Application;
    Autodesk.Revit.ApplicationServices.Application app = uiApp.Application;
    Document newDoc = app.OpenDocumentFile(@"F: est.rfa");
    if (newDoc != null)
    {
    using (Transaction trans = new Transaction(newDoc))
    {
    trans.Start("Add Parameter");
    FamilyManager flyMgr = newDoc.FamilyManager;
    string paraName = "NewParam4";
    BuiltInParameterGroup paraGroup = BuiltInParameterGroup.PG_TEXT;
    ParameterType paraType = ParameterType.Text;

    flyMgr.AddParameter(paraName, paraGroup, paraType, false);
    trans.Commit();
    }
    }
    SaveOptions saveOpt = new SaveOptions();
    saveOpt.Compact = true;

    //newDoc.Save(saveOpt);
    newDoc.Close();
    return Result.Succeeded;
    }
    catch (Exception exception)
    {
    message = exception.Message;
    return Result.Failed;
    }
    }

  • 相关阅读:
    jq常用操作
    Vue过滤器
    NodeJS跨域问题
    js获取url参数(通用方法)
    jq动画实现左右滑动
    vue-cli3.0 gui(一)
    微信小程序无法定位
    java连接数据库报了ssl连接的警告
    node——module.exports
    node——Commonjs
  • 原文地址:https://www.cnblogs.com/liaocheng/p/12653604.html
Copyright © 2011-2022 走看看