Revit插件开发HelloWorld
来源:互联网 发布:阿里云系统怎么样os 编辑:程序博客网 时间:2024/05/11 04:35
1. 使用 VS2012 先建立一个项目.
2. 在这里我们选择建立C# 类库项目, 修改项目名称为HelloWorld. 可以自定义修改项目存放路径.
3. 添加 Revit 插件 API 的引用(对引用点击右键, 选择添加引用)
4. 选择 Revit 插件 API
点击浏览. 在Revit安装目录找到 RevitAPI.dll 和 RevitAPIUI.dll 文件
勾选两个. 点击确定.
引入完成后目录结构:
引入完成之后再引入一个 System.Windows.Forms 类库, 用于弹窗.
5. 打开 HelloWorld.cs 文件编写代码. 这里给了一个简单的弹出HellWorld字符串的代码:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using Autodesk.Revit.DB;using Autodesk.Revit.DB.Architecture;using Autodesk.Revit.UI;using Autodesk.Revit.UI.Selection;using Autodesk.Revit.ApplicationServices;using Autodesk.Revit.Attributes;using System.Windows.Forms;namespace HelloWorld{ [TransactionAttribute(TransactionMode.Manual)] public class HelloWorld : IExternalCommand { public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { MessageBox.Show("HelloWorld", "HelloWorld"); return Result.Succeeded; } }}
6. 代码写完了 就开始生成项目了.
7. 进入 Revit 测试运行插件
选择添加新的插件:
8. 找到项目 obj/Debug 目录下生成的 dll 文件
9. 双击插件运行.
10. 运行成功, 一个简单的插件完成了:
0 0
- Revit插件开发HelloWorld
- 使用Revit 2015+VS2013搭建开发环境并实现helloWorld插件的小例子
- openfire_插件开发-helloworld
- <Revit二次开发>HelloWorld
- Revit之HelloWorld
- revit二次开发-HelloWorld,入门
- Eclipse插件开发HelloWorld篇
- chrome插件开发1:永远的helloworld
- Maven插件的开发入门helloworld
- Revit开发起始篇
- Revit 二次开发 - 开发资源
- Revit开发参数读取
- Revit开发选中元素
- Revit开发之AddInCommandBinding
- Revit开发之PreviewControl
- Revit开发之IUpdater
- Revit开发之SelectionFilterElement
- Revit开发之ElementParameterFilter
- spring applicationContext.xml的配置文件详解
- PAT (Basic Level) Practise (中文)1026. 程序运行时间(15)
- 一、Hook(抽象)函数
- eclipse4.4(luna)整合maven3.3
- 1. PHP基本语法形式
- Revit插件开发HelloWorld
- 傅里叶分析之掐死教程(完整版)
- 继 <ZMQ的学习和研究> Request-reply worker in C++
- HTTP referer说明
- cocos2d-x 3.x DrawNode的使用
- Java开发环境搭建
- windows下elasticSearch以及elasticSearch-php安装及使用
- iOS 获取系统图片
- [IMX6DL]超声波模块HC-SR04 Linux驱动源代码