Revit的插件注册是通过.addin文件实现的,其本质是一个XML格式的文件。
1、ExteralCommand的.addin文件实例
<?xml version="1.0" encoding="utf-8"?>
<RevitAddIns>
<AddIn Type="Command">
<Assembly> c:\MyRevitProgram.dll< /Assembly>
<AddInId>9ea2923c-bf61-46bb-9398-b3a88d852fb0</AddInId>
<FullClassName> Revit.Samples.SampleCommand< /FullClassName>
<Text> Sample command< /Text>
<VisibilityMode> NotVisibleInFamily< /VisibilityMode>
<VisibilityMode> NotVisibleInMEP< /VisibilityMode>
<AvailabilityClassName > Revit. Samples. SampleAccessibilityCheck </ AvailabilityClassName>
<LongDescription> < p> This is the long description for my command < /p> < p> This is another descriptive paragraph, with notes about how to use the command properly.< /p>
</LongDescription>
<TooltipImage> c:\MyProgram\Autodesk,jpg< /TooltipImage>
<Largelmage> c:\MyProgram\MyProgramIcon.png< /Largelmage>
<VendorId> ADSK< /VendorId>
<VendorDescription> Autodesk^ www.autodesk.com< /VendorDescription>
< /AddIn〉
< /RevitAddIns>
注意:ExteralCommand没有Name便签
2、ExteralApplication的.addin文件实例
<?xml version="1.0" encoding="utf-8"?>
<RevitAddIns>
<AddIn Type="Command">
<Name>HelloRevit_Ribbon< /Name>
<Assembly> c:\MyRevitProgram.dll< /Assembly>
<AddInId>9ea2923c-bf61-46bb-9398-b3a88d852fb0</AddInId>
<FullClassName> Revit.Samples.SampleCommand< /FullClassName>
<Text> Sample command< /Text>
<VisibilityMode> NotVisibleInFamily< /VisibilityMode>
<VisibilityMode> NotVisibleInMEP< /VisibilityMode>
<AvailabilityClassName > Revit. Samples. SampleAccessibilityCheck </ AvailabilityClassName>
<LongDescription> < p> This is the long description for my command < /p> < p> This is another descriptive paragraph, with notes about how to use the command properly.< /p>
</LongDescription>
<TooltipImage> c:\MyProgram\Autodesk,jpg< /TooltipImage>
<Largelmage> c:\MyProgram\MyProgramIcon.png< /Largelmage>
<VendorId> ADSK< /VendorId>
<VendorDescription> Autodesk^ www.autodesk.com< /VendorDescription>
< /AddIn〉
< /RevitAddIns>