资源简介

涵盖了Revit建筑中部分功能的二次开发源码,包括Ribbon菜单,模态/非模态对话框,实体创建,轴线编辑,实体编辑,实体标注等主要功能。功能目录如下: "绘制坐标轴" "查看Ribbon菜单信息" "调用Revit命令" "显示族样式信息" "添加轴线" "删除轴线" "轴线改名" "主辅轴标注转换" "重排轴线" "添加柱" "墙柱对齐" "添加墙" "添加梁" "墙搜楼板" "创建房间" "创建房间面积" "创建楼层面积" "标注墙长及洞口信息" "标注墙厚" "编辑墙长" "打断墙" "3DView局部显示" "3DView中实体选择显示" "创建阳台" "创建台阶" "创建坡道"

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

using Autodesk.Revit;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.UI;
using Autodesk.Revit.Attributes;

namespace TestBIM
{
    [Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
    [Autodesk.Revit.Attributes.Regeneration(Autodesk.Revit.Attributes.RegenerationOption.Manual)]
    public class App : IExternalApplication
    {
        static Autodesk.Revit.DB.AddInId m_appId = new Autodesk.Revit.DB.AddInId(new Guid(“49620957-ED18-4F9B-A814-C82C81264B4D“));
        // get the absolute path of this assembly
        static string ExecutingAssemblyPath = System.Reflection.Assembly.GetExecutingAssembly().Location;

        public Autodesk.Revit.UI.Result onstartup(UIControlledApplication application)
        {
            AddMenu(application);
            AddAppDocEvents(application.ControlledApplication);
            return Autodesk.Revit.UI.Result.Succeeded;
        }

        public Autodesk.Revit.UI.Result OnShutdown(UIControlledApplication application)
        {
            RemoveAppDocEvents();

            return Autodesk.Revit.UI.Result.Succeeded;
        }

        private void AddMenu(UIControlledApplication app)
        {
            RibbonMenuCreater creater = new RibbonMenuCreater(app);
            creater.CreateRibbonMenu();

            Autodesk.Revit.UI.RibbonPanel rvtRibbonPanel = app.CreateRibbonPanel(“TestBIM“);
            PulldownButtonData data = new PulldownButtonData(“Options“ “TestBIM“);

            RibbonItem item = rvtRibbonPanel.AddItem(data);
            PulldownButton optionsBtn = item as PulldownButton;

            optionsBtn.AddPushButton(new PushButtonData(“Add Axis...“ “Add Axis...“ ExecutingAssemblyPath “TestBIM.AddAxis“));
            optionsBtn.AddPushButton(new PushButtonData(“Delete Axis...“ “Delete Axis...“ ExecutingAssemblyPath “TestBIM.DeleteAxis“));
            optionsBtn.AddPushButton(new PushButtonData(“ChangeName...“ “ChangeName...“ ExecutingAssemblyPath “TestBIM.ChangeName“));
            optionsBtn.AddPushButton(new PushButtonData(“Main/Auxiliary Conversion...“ “Main/Auxiliary Conversion...“ ExecutingAssemblyPath “TestBIM.Main_AuxiliaryConversion“));
            optionsBtn.AddPushButton(new PushButtonData(“Arrange Nummber...“ “Arrange Nummber...“ ExecutingAssemblyPath “TestBIM.ArrangeNummber“));
        }

        private void AddAppDocEvents(Autodesk.Revit.ApplicationServices.ControlledApplication app)
        {

        }

        private void RemoveAppDocEvents()
        {
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2012-07-18 14:50  TestBIM\
     文件        2733  2012-06-12 15:34  TestBIM\App.cs
     目录           0  2012-08-14 13:55  TestBIM\Commands\
     文件        6405  2012-07-12 10:25  TestBIM\Commands\AddAreas.cs
     文件        6617  2012-06-19 10:42  TestBIM\Commands\AddAxis.cs
     文件        8166  2012-07-12 10:24  TestBIM\Commands\AddFullArea.cs
     文件        3380  2012-07-12 09:37  TestBIM\Commands\AddRooms.cs
     文件        4928  2012-05-31 14:33  TestBIM\Commands\ArrangeNummber.cs
     文件        2237  2012-05-30 11:11  TestBIM\Commands\ChangeName.cs
     文件        9175  2012-06-15 09:01  TestBIM\Commands\ColumnAlignToWall.cs
     文件       21034  2012-06-15 09:01  TestBIM\Commands\CreateBalcony.cs
     文件       15144  2012-06-05 08:58  TestBIM\Commands\CreateBeam.cs
     文件       21514  2012-06-15 09:02  TestBIM\Commands\CreateColumn.cs
     文件       19475  2012-07-02 17:00  TestBIM\Commands\CreateDimensionWtihDWH.cs
     文件       13646  2012-06-28 14:25  TestBIM\Commands\CreateFootstep.cs
     文件        7129  2012-07-11 15:37  TestBIM\Commands\CreateFullFloor.cs
     文件       15436  2012-06-28 14:25  TestBIM\Commands\CreateRamp.cs
     文件       13926  2012-06-20 17:01  TestBIM\Commands\CreateWall.cs
     文件        3967  2012-06-01 13:40  TestBIM\Commands\DeleteAxis.cs
     文件       16328  2012-07-02 17:06  TestBIM\Commands\DimentionWallThickness.cs
     文件        2205  2012-06-06 16:50  TestBIM\Commands\DrawOrigin.cs
     文件        2451  2012-07-02 17:14  TestBIM\Commands\ExecuteRevitCommand.cs
     文件        3368  2012-07-02 17:24  TestBIM\Commands\GetRibbonInfos.cs
     文件        2958  2012-07-02 13:58  TestBIM\Commands\ListVisibleFamilySymbol.cs
     文件        2607  2012-05-30 11:11  TestBIM\Commands\Main_AuxiliaryConversion.cs
     文件        5474  2012-05-30 11:33  TestBIM\Commands\ShowSectionBoxIn3dView.cs
     文件        5648  2012-06-05 16:02  TestBIM\Commands\ShowSelElementIn3dView.cs
     文件        6951  2012-07-03 17:41  TestBIM\Commands\WallLengthEditer.cs
     文件        8301  2012-07-03 17:41  TestBIM\Commands\WallSpliter.cs
     目录           0  2012-08-14 13:56  TestBIM\DisplayView\
     文件        8333  2012-06-20 10:07  TestBIM\DisplayView\CurvesPlotter.cs
............此处省略161个文件信息

评论

共有 条评论