ChBodyAux Error?

23 views
Skip to first unread message

Tristan Griffith

unread,
Jul 5, 2022, 3:37:19 PM7/5/22
to ProjectChrono
Dear all,

I am currently trying to utilize a Solidworks assembly in PyChrono for my project. When I use the plugin in Solidworks I am met with a Microsoft .NET Framework error, which is included below. I believe this is due to the specific assembly having constraints/mates that cannot be converted by the plugin. I am unsure which constraints/mates are causing this error, so my plan is to simplify the assembly and keep trying to convert it. I will add on the levels of complexity until I reach the specific one causing the error. 

In the meantime, I made another extremely simple assembly with a single mate in which rotation is supposed to take place. The plugin converted the assembly into a python file successfully, however it throws an error when it runs. The error is included below as well. For some reason, it cannot find the function .AddVisualShape for the ChBodyAuxRef body_1, even though it should be included.


Pic2.PNG
Pic3.PNG
Capture1.PNG
Pic1.PNG

Alessandro Tasora

unread,
Jul 8, 2022, 5:02:23 AM7/8/22
to projec...@googlegroups.com

Dear Tristan,

there are two sources of troubles here:

- about the "AddVisualShape " stuff: the latest version of the SolidWorks plugin might not be in-sync with the latest PyChrono that you download with Anaconda / Conda, even if the develop one, that is made available on conda only periodically.  For example, here on my PC I  bypass Anaconda completely and I build the chrono Python modules from the C++ solution, with CMAKE,  SWIG and C++ compile etc etc., and I set a PYTHONPATH to my D:\build\chrono\bin\Release. Not easy for people not into c++, though...
So I am 100% sure it is in-sync with the SW add-in. The latest SW add-in v.7.03 is compatible with the develop branch of chrono, at least with the one in chrono' GIThub yesterday, in develop.
(Note, I am in charge of developing the SW add-in, so I update and rebuild the add-in all times that chrono, hence pychrono, get some changes in the develop branch)

- about the .NET crash: most likely you are adding something in your SW model that is not supported in the add-in. In the past I had crashes when I added the gears constraints and the pulley constraints in SW. I remember that all the "basic" mate constraints in SW are correctly converted (parallel, cylindrical, etc.), but not the complex ones like gears, pulley, cam, etc.

regards

Alessandro Tasora

--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to projectchron...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/11320f90-64cb-4329-9111-203533b91fc7n%40googlegroups.com.

Tristan Griffith

unread,
Jul 11, 2022, 2:15:14 PM7/11/22
to ProjectChrono

Thank you Alessandro, I actually am building the chrono Python modules from the C++ solution as you said, and not using the Conda route since I wanted more access to features. I decided to switch over to the develop branch since it seems these SW features were not working on the Master branch. I actually wanted to ask about the switching process, as I am not entirely sure how to do it properly as it isn't really referenced on the API. I pulled it using SourceTree, configured it using CMake, and generated the project, and it seems to be fine when building the release, but it throws a ton of errors when I build the debug. These errors are included below. I was wondering if there was a proper guide somewhere to using the develop branch, and what I was doing wrong.

Attached are the main errors, and included below are links to Pastebins of the Visual Studio output: 
Erro2.PNG
Erro1.PNG
Reply all
Reply to author
Forward
0 new messages