Adds a MacroModule to the application or document.
Namespace: Autodesk.Revit.UI.Macros
Assembly: RevitAPIUIMacros (in RevitAPIUIMacros.dll) Version: 22.0.0.0 (22.1.0.0)
Since: 2014
Syntax
C# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Parameters
- moduleSettings
- Type: Autodesk.Revit.DB.Macros ModuleSettings
The module settings.
- environment
- Type: Autodesk.Revit.DB.Macros MacroEnvironment
The module environment.
Return Value
The new module.Remarks
Note: document-level modules will not be saved to the document until the document is saved. Thus this operation is not undoable and does not require an open transaction even for document-level modules.
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.Exceptions ArgumentException | Thrown when the module name is duplicated with the existing one, or the name is too long, or the name contains invalid identifier(s), such as include "#", "%", ... and key words in C# or VB.NET. |
Autodesk.Revit.Exceptions ArgumentNullException | A non-optional argument was null |
Autodesk.Revit.Exceptions ArgumentOutOfRangeException | A value passed for an enumeration argument is not a member of that enumeration |