Any tips for this problem?
I'll send this to apisupport@solidworks.com
A project for an addin to repro this issue is attached. See README_repro_steps.txt
The Macro Feature I've created is not doing anything, just returning from Edit(), Regenerate(), and Security(). Looks like the bug has something to do with changing the offset surface Feature that was selected when the Macro Feature was created. Deleting the Macro Feature fixes things, in that the offset surface can be edited and updated without causing a hang. Waiting for garbage collection in Regenerate() has no effect.
-- bug description --
An offset surface feature is selected when a C# macrofeature is created.
If the offset surface feature is edited, or if an offset surface higher in the feature tree is edited,
Solidworks hangs at the call stack below. The hang occurs outside any addin code.
Call stack:
mscorlib.dll!System.Threading.WaitHandle.WaitAny(System.Threading.WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext) Line 454 C#
System.dll!System.Net.TimerThread.ThreadProc() Line 707 C#
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 954 C#
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 902 C#
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Line 891 C#
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() Line 111 C#
-- repro steps --
Launch the adding by building and running from the visual studio .sln
In Solidworks, open two_offset_surfaces.SLDPRT
In the "C# Addin" command tab, select "Macrofeature PMP" to open the property manager page.
Select Surface-Offset1 into the PMPage selection box.
Hit "Create MacroFeature"
Exit the PMPage by hitting the ok or cancel buttons.
in the Feature Tree, select Surface-Offset1 > Edit Feature
Modifty the offset distance and hit 'ok'.
SolidWorks hangs.
-- system details --
Solidworks Premium 2016 x64 Edition
SP 3.0
Microsoft Visual Studio Professional 2013
Version 12.0.40629.00 Update 5
Microsoft .NET Framework
Version 4.7.02556
SolidworksApi macros