想要在BIMBase SDK环境下实现自己的功能吗?在工程中添加如下代码,即可在BIMBase中注册自己的命令,实现弹出Hello BIMBase对话框。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using BIMBaseCS.UI;
using BIMBaseCS.Attributes;

namespace APIDemo
{
    [BPExternalCommandAttribute(name = "Hello")]
    public class HelloCommand : IBPFunctionCommand
    {
        public override void onExcute(BPCommandContext context)
        {
            MessageBox.Show("Hello BIMBase!");
            base.onExcute(context);
        }
    }
}

代码1-1 "HelloBIMBase"

此时,启动BIMBase,在命令行输入已经注册的命令“HelloBIMBase”,执行后将弹出Hello BIMBase弹窗,如图1-1所示。

图1-1 “Hello BIMBase”对话框