Before you can implement a new standard, you must create a new project from your development environment. Alternatively, you may use the sample project
AecSpaceOffsetStandardSample.
Note: An area calculation standard plug-in is implemented as a .NET class library, not a Windows application.
- Open Microsoft Visual Studio 2005.
- Select the New tab on the main menu.
- Click File menu Project.
- In the New Project dialog box, choose the class library template from one of these locations:
- Visual Basic Windows
- Visual C# Windows
- Visual C++ CLR.
- Enter a name for the new project.
It is recommended to use the prefix
AecAreaCalculationStandard, for example to create a name like
AecAreaCalculationStandardMyOffsetRules. This way the naming is consistent with the naming of the plug-ins provided with
AutoCAD Architecture 2022 toolset (for example
AecAreaCalculationStandardBasic,
AecAreaCalculationStandardBOMA, etc.) The software then recognizes that this prefix describes an area calculation plug-in and is able the extract the name from the assembly for diagnostic purposes.
Before proceeding, verify that you have a .NET class library project set up, so you can start editing the source code and project files.
- In order to create an area calculation standard plug-in, the .NET class library created in the previous steps needs to reference the .NET API that
AutoCAD Architecture 2022 toolset provides. This API is implemented in the
AecSpaceOffsetRuleManager.dll assembly which you need to reference in your new project.
- If you are working with Microsoft Visual Studio, you can add the assembly reference to
AecSpaceOffsetRuleManager.dll to your class library project by right-clicking References in the Solution Explorer of the project, and selecting Add Reference.
- Navigate to the Browse page on the property sheet and search for the
AecSpaceOffsetRuleManager.dll assembly under
C:\Program Files\ACA <version> (or the path you chose during installation).
- Add references to the following assemblies of your installation:
- acdbmgd.dll (AutoCAD .NET API)
- aecbasemgd.dll (AutoCAD Architecture 2022 toolset base classes)
- aecarchmgd.dll (AutoCAD Architecture 2022 toolset objects)
These DLLs are found in the same folder as the
AecSpaceOffsetRuleManager.dll assembly.
- Right-click each reference in the Solution Explorer tree under References, and click Properties to verify that the Copy Local reference property is set to False for each of the references.
- Setting up copying the .dll so that
AutoCAD Architecture 2022 toolset can reference it.
AutoCAD Architecture 2022 toolset searches for custom area calculation standard assemblies in
C:\Program Files\AutoCAD Architecture <version>\Space Calculation Standards, or the path you chose during installation. Each time you compile the .dll you need to restart
AutoCAD Architecture 2022 toolset in order to load and test it. Do the following to set up copying the .dll to the appropriate folder each time it is compiled.
- Select the project in the Solution Explorer.
- Right-click, and click Properties.
- Click the Build Events tab.
- On the Post-build event command line, enter the following:
@if exist $(TargetPath) @copy $(TargetPath) "C:\Program Files\AutoCAD Architecture <version>\Space Calculation Standards\"
@if exist $(TargetDir)$(TargetName).pdb @copy $(TargetDir)$(TargetName).pdb "C:\Program Files\AutoCAD Architecture <version>\Space Calculation Standards\"