Export driven joint values

In certain workflows, it can come handy to get the values of joints at multiple states of the model.
This way you can use those values downstream to drive (or at least help set up) a real-life model.

In the user interface, you can drag components to drive the movement of the model, or use e.g. Motion Study

2021-03-18_17-50-47 (3)

We can do the same using the API as well. As we keep driving the model, we can check how the change affects the various joints and record their values.
Then we can save the values in a CSV file which then could be opened in Excel or a similar spreadsheet editor.

The code is made for this specific model but could easily be modified for others. It expects a list of components and a list of joints inside them that you want to monitor. In the case of both lists, you can specify the name that should be used in the CSV file.

After specifying where you want the CSV file to be saved, you can also provide the distance the main joint should be moved. 

Params

The source code is here:
https://github.com/adamenagy/JointValueExporter/blob/main/JointValueExporter.py 

-Adam


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading