Hi Is there any way in ACT script to import materials from library to the current mechanical project? I want to do the materials add function(Click to add the material to the project) by ACT script or other, is there any way?
Hello, I think you could take a look at this post:
"How do I communicate with the Project Page from within Mechanical?"
https://discuss.ansys.com/discussion/2478/how-do-i-communicate-with-the-project-page-from-within-mechanical?utm_source=community-search&utm_medium=organic-search&utm_term=workbench+script+from+mechanical
You should be able to run a wb script (following the previous example) to load materials from the libraries, with something similar to this:
This example loads the Silicon Anisotropic material properties from the General_Materials library
favorites1 = EngData.LoadFavoriteItems() library1 = EngData.OpenLibrary( Name="General Materials", Source="General_Materials.xml") system1 = GetSystem(Name="SYS") engineeringData1 = system1.GetContainer(ComponentName="Engineering Data") matl1 = engineeringData1.ImportMaterial( Name="Silicon Anisotropic", Source="General_Materials.xml")
I hope this information helps.
Best Regards,