Revit learning path 01_Revit basics, revit path 01_revit

Source: Internet
Author: User

Revit learning path 01_Revit basics, revit path 01_revit
Preface:

This category records the path to Revit learning. Beginners will inevitably have a blind eye. You are welcome to join us!

Revit Introduction

Revit is a modeling software built for Building Information Modeling (BIM. With the rise of the concept of BIM in China, major design institutes have increased their demand for Revit modeling, and the secondary development based on Revit has also increased. The specific description is not about shipping.

Revit is a software built for BIM. To understand Revit, you must first understand BIM. The concept of BIM is not only a change from two-dimensional drawings to three-dimensional models, but also a platform for information management and interaction. Revit, as a software built specifically for BIM, must be able to manage models and information.

Reference: https://zhuanlan.zhihu.com/p/20164680? ColumnSlug = BIMinfo

As a platform software, Revit must have platform Functions: 1. Customizable menus 2. loading external plug-ins 3. provide excuses for calling external plug-ins.

Revit menu

When creating a custom external Tab in Revit secondary development, you must reference the Revit external application interface, and then create tabs, panels, and buttons at Revit startup (OnStartup. Due to frequent changes in the secondary development menu, it is very difficult to adjust the program. Therefore, you should define the menu to a configuration file and read the menu configuration when Revit starts. This part has just been done by bloggers and will be detailed later.

Register plug-ins

Revit loads external plug-ins through The AddIn file, which is essentially an Xml file. The file format is as follows:

<? Xml version = "1.0" encoding = "UTF-8"?>

<RevitAddIns>

<! -Types of calling external plug-ins: [Command] and [Application] -->

<AddIn Type = "Command">

<! -Assembly used for reflection call plug-in -->

<Assembly> D: \ HelloWorld \ bin \ Debug \ HelloWorld. dll </Assembly>

<! -Unique identifier -->

<AddInId> 4d8936ea-82ca-49b0-abc0-d0904d8bd716 </AddInId>

<FullClassName> HelloWorld. Class1 </FullClassName>

<! -Display name -->

<Text> HelloWorld </Text>

<! -Developer information -->

<VendorId> ABC </VentorId>

</AddIn>

</RevitAddIns>

Plug-in call

1. Add RevitAPI. dll and RevitUI. dll to reference the project. They can be found in the Revit installation directory or in the SDK package. 2. inherit the IExternalCommand interface and implement the Execute () method of the interface.

Sample Code:

// 1. Command call

Using Autodesk. Revit. DB;

Using Autodesk. Revit. UI;

Using Autodesk. Revit. Attributes;

 

Namespace HelloWorld

{

[Transaction (TransactionMode. Manual)]

Public class HelloWorld: IExternalCommand

{

Public Result Execute (ExternalCommandData commandData, ref string messages, ElementSet elements)

{

TaskDialog. Show ("Title", "Hello World ");

Return Result. Succeeded;

}

}

}

// 2. External applications

Using Autodesk. Revit. DB;

Using Autodesk. Revit. UI;

Using Autodesk. Revit. Attributes;

 

Namespace App

{

[Transaction (TransactionMode. Manual)]

Public class App: IExternalApplication

{

Public Result OnShutdown (UIControlledApplication)

{

TaskDialog. Show ("end", "end ");

Return Result. Succeeded;

}

 

Public Result OnStartup (UIControlledApplication)

{

TaskDialog. Show ("START", "Start ");

Return Result. Succeeded;

}

}

}

Conclusion

On the first day of the Development of Revit, the journey of a thousand miles begins with a single step!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.