OperationRunMacro Method |
Starts a macro with the given name. Throws an exception if the file is not found.
Macros are saved as *.cs files in the folder defined with the XS_MACRO_DIRECTORY variable.
It is possible to run drawing macros using relative paths.
See Tekla Structures Help for more information about macros.
Namespace: Tekla.Structures.Model.Operations
Assembly: Tekla.Structures.Model (in Tekla.Structures.Model.dll) Version: 2023.0.3
Syntax
Parameters
- FileName
- Type: SystemString
The name of the macro to start.
Return Value
Type: BooleanTrue if the macro existed.
Examples
using Tekla.Structures.Model.Operations; public class Example { public void Example1() { Operation.RunMacro("MyModelingMacro.cs"); Operation.RunMacro(@"..\drawings\MyDrawingMacro.cs"); } }
See Also