bmferguson
Member
Hi folks,
Preamble: I'm into robotics, and I'm getting to the point where I want to convert my assembly to URDF/XACRO + STL to load into PyBullet. I'm aware that ROS has a means of doing so that involves Gazebo, but it's quite cumbersome for my purposes, and I don't want to set up a massive infrastructure just to use one little aspect of it. I'm also aware that SolidWorks has a function to output models to URDF, but that's extra $$$ and/or putting my designs on the cloud. It dawned on me that it should be quite easy to write an Alibre script to take care of this, and that it could save some time when it comes to including inertial info, etc...
Now my question: I started experimenting with scripting this afternoon, and made some progress. However, it appears that the API might not provide a way to easily find the parts within an assembly. I can easily grab the Assembly, but it appears that accessing a Part requires knowing the name of the Part in advance and and then passing that into a function call. Is there a way to query the Assembly to get a list of the Parts so that I can loop through them? I only just started looking at the API, but I've gone through it multiple times and can't find a function or property that would provide me with this info.
Also, if anyone has already written such a script and is willing to share it, please let me know.
Thanks,
Bruce
Preamble: I'm into robotics, and I'm getting to the point where I want to convert my assembly to URDF/XACRO + STL to load into PyBullet. I'm aware that ROS has a means of doing so that involves Gazebo, but it's quite cumbersome for my purposes, and I don't want to set up a massive infrastructure just to use one little aspect of it. I'm also aware that SolidWorks has a function to output models to URDF, but that's extra $$$ and/or putting my designs on the cloud. It dawned on me that it should be quite easy to write an Alibre script to take care of this, and that it could save some time when it comes to including inertial info, etc...
Now my question: I started experimenting with scripting this afternoon, and made some progress. However, it appears that the API might not provide a way to easily find the parts within an assembly. I can easily grab the Assembly, but it appears that accessing a Part requires knowing the name of the Part in advance and and then passing that into a function call. Is there a way to query the Assembly to get a list of the Parts so that I can loop through them? I only just started looking at the API, but I've gone through it multiple times and can't find a function or property that would provide me with this info.
Also, if anyone has already written such a script and is willing to share it, please let me know.
Thanks,
Bruce