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
public static bool RunMacro(
	string FileName
)

Parameters

FileName
Type: SystemString
The name of the macro to start.

Return Value

Type: Boolean
True 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
Was this helpful?
The feedback you give here is not visible to other users. We use your comments to improve the content.
Previous
Next