Acces Configuration Table parameters via the Python API

Acces Configuration Table parameters via the Python API

sspain2GH8A
Explorer Explorer
1,206 Views
5 Replies
Message 1 of 6

Acces Configuration Table parameters via the Python API

sspain2GH8A
Explorer
Explorer

I am trying to write a Python Add-In/Script capable of reading parameter values from a document's existing Configuration Table.

 

So far this is what I've tried:

1. Top level objects: There is no direct API access though the Document or RootComponent objects.

2. Parameters: When accessing Model and User Parameters, only values from the currently selected config are listed

3. UI: Using ui.commandDefinitions I can open the config table, but still cannot find a way to set/retrieve values.

 

Is there any way to interact with the configuration table through the API?

 

Thanks,

 

 

 

0 Likes
Accepted solutions (1)
1,207 Views
5 Replies
Replies (5)
Message 2 of 6

EvanGu
Autodesk
Autodesk
Accepted solution

Hi, the development team is working on the Configurations API support. The first stage is to support reading Configurations table, the second stage is editing. Please pay attention to What's New of next update.


Evan Gu
Inventor/Fusion QA Engineer
Message 3 of 6

sspain2GH8A
Explorer
Explorer

 

Thanks for the quick reply, appreciate it.

0 Likes
Message 4 of 6

tcorneo
Explorer
Explorer

Any progress here?  Like the OP, I'm unable to access configuration data from my Python add-in., but it's been nearly two years since your response.  This leads me to believe that the read-only version -- which is all that I need for now -- should be available.  If you think I should be able to do this, could you point me to the Python code for an add-in that accesses the API?   I believe I can do it with C++ but I'm not ready to go down that road just yet.  OTOH, if that's the only option available to me today, I'll jump in.

My goal is to iterate over all defined configs in a design and generate a 3MF file for each one.  I intend to 3D print these.  If you are aware of any existing plug-in or script that does that, please point me to it.

0 Likes
Message 5 of 6

EvanGu
Autodesk
Autodesk

Hi @tcorneo, please refer to the python script in the attached zip.


Evan Gu
Inventor/Fusion QA Engineer
0 Likes
Message 6 of 6

tcorneo
Explorer
Explorer

I spent the better part of a day going down a rabbit hole, trying to get ChatGPT to help me do that.  It worked like a charm once I made the changes necessary to deal with path names in MacOS.  THAT I can handle.

 

This will save me a lot of time.  Thank you SO MUCH.  

 

 

0 Likes