Referencing SpaceClaim dlls
Hi,
I have created several ACT functionalities in SpaceClaim ANSYS 2020R2 which I'm transfering to 2023R1. I have tried to use the following code snippet in both versions:
_import clr
clr.AddReference("SpaceClaim.Api.V20.Scripting.dll")
import SpaceClaim.Api.V20.Scripting as SCv20_Scripting
rootPart = SCv20_Scripting.Helpers.DocumentHelper.GetRootPart()
selPart = SCv20_Scripting.Selection.PartSelection.Create(rootPart)
SCv20_Scripting.Helpers.ComponentHelper.FlattenAssembly(selPart, None)_
It works fine in ACT console in 2020R2, but i get following error for version 2023R1
Error: Could not load type 'SpaceClaim.Commands.FlattenAssemblyCommandInitializer' from assembly 'Structure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7210645d4d5e3a39'.
Any idea, how to resolve this issue.
Many thanks
Answers
-
Any reason you are staying with V20 of the API when upgrading to a later product version?
0 -
The reason is that I need to use ACT Console. The API v17 is accessible via this console by default (see the figure)
I was able to reference the v20 and v20.Scripting dlls and use it in previous versions without any problem.Also I've noticed that code called via this ACT Console behaves differently from the code called from SpaceClaim scripting. For example SetName and other extension methods are not known for IDesignBody etc. so I had to figure out how to do it in a different ways.
0 -
One more thing I've found out. When I run the same script in ANSYS 2023R2 it works. So it seems that there is some but in ANSYS 2023R1.
0