ansys / pymechanical-stubs

Project to generate mechanical api stubs
https://scripting.mechanical.docs.pyansys.com/
MIT License
2 stars 0 forks source link

Use resolver function from pymechanical in main.py #6

Open klmcadams opened 1 year ago

klmcadams commented 1 year ago

πŸ“ Description of the feature

use the resolver module from pymechanical instead of resolve() function in main.py

πŸ’‘ Steps for implementing the feature

Add ansys.mechanical.core as a dependency

from ansys.mechanical.core.embedding import resolver

get_version() - only return version

version = get_version() resolver()

I got this error, so I have to debug this to see if this implementation is possible:

CRITICAL - - logging - handle_exception - Uncaught exception Traceback (most recent call last): File "C:\Users\kmcadams\mechanical-stubs\main.py", line 23, in ansys.mechanical.core.embedding.resolver.resolve(version) File "C:\Users\kmcadams\mechanical-stubs.venv\Lib\site-packages\ansys\mechanical\core\embedding\resolver.py", line 14, in resolve clr.AddReference("Ansys.Mechanical.Embedding") System.IO.FileNotFoundException: Could not load file or assembly 'Ansys.Mechanical.Embedding' or one of its dependencies. The system cannot find the file specified. File name: 'Ansys.Mechanical.Embedding' at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

πŸ”— Useful links and references

No response