Skip to content

Instantly share code, notes, and snippets.

@benkoshy
Created December 6, 2023 23:29
Show Gist options
  • Save benkoshy/c60b627087512feb4441e9339a3d46ad to your computer and use it in GitHub Desktop.
Save benkoshy/c60b627087512feb4441e9339a3d46ad to your computer and use it in GitHub Desktop.
How to Debug a Tekla Plugin Without Restarting Visual Studio (Tekla Open API Tutorial)

Post build plugin in visual studio.

Watch out - change the version ID to suit your Tekla version!

set envDir=2022.0\Environments\common\extensions\TestWPFBeamPlugin

set pluginsDir=2022.0\nt\bin\plugins\TestWPFBeamPlugin

set tsDirA=D:\Program Files\Tekla Structures\

if $(ConfigurationName) == Debug (

if exist "%tsDirA%" xcopy "$(TargetDir)*$(TargetExt)" "%tsDirA%\%envDir%" /y /c /q

)

The Reloadplugins.cs file:

#pragma warning disable 1633 // Unrecognized #pragma directive

#pragma reference "Tekla.Macros.Akit"

#pragma reference "Tekla.Macros.Wpf.Runtime"

#pragma reference "Tekla.Macros.Runtime"

#pragma warning restore 1633 // Unrecognized #pragma directive

namespace UserMacros

{

public sealed class Macro

{

[Tekla.Macros.Runtime.MacroEntryPointAttribute()]

public static void Run(Tekla.Macros.Runtime.IMacroRuntime runtime)

{

Tekla.Structures.ModelInternal.Operation.dotStartAction("dotdiaLoadDialogs", "");

Tekla.Structures.ModelInternal.Operation.dotStartAction("dotdiaReloadDialogs", "");

Tekla.Structures.Model.Operations.Operation.DisplayPrompt("Dialogs reloaded..");

}

}

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment