Export Configurations of a Component

Export Configurations of a Component

daniel_yochelson
Contributor Contributor
95 Views
3 Replies
Message 1 of 4

Export Configurations of a Component

daniel_yochelson
Contributor
Contributor

I tried to search the forums as well as ask AI for any help but I couldn't find anything so I thought I would ask here before looking into how to make a feature suggestion. 
I have a single component with multiple configurations and I need to save each configuration (ideally as a step though STL could also work) to upload for 3D printing. So far I haven't found any way to automate or batch save all configurations, but if you know of a way I would appreciate it.
Thanks,

0 Likes
Accepted solutions (1)
96 Views
3 Replies
Replies (3)
Message 2 of 4

straterjeff
Community Visitor
Community Visitor

The only way I know of would be to write an API script to do this.  There is no UI way that I am aware of to do this.

 

You would need to write a script that would:

  1. activate each valid configuration
  2. export as STL
  3. go on to the next configuration
  4. etc

 

Here is the response from Autodesk Assistant about the relevant APIs.  Assistant can also help you write the script to do this.

 

Yes — the Fusion API does support working with configurations, including setting which one is active.

The relevant object is ConfigurationTopTable, found in the adsk::fusion namespace. It represents the top configuration table of a configured design, and you reach it via Design.configurationTopTable.

Key points for setting the active configuration via the API:

  • The activeRow property on ConfigurationTopTable returns the currently active row (configuration).
  • To change which configuration is active, you don't set activeRow directly — instead, you call the activate method on the specific ConfigurationRow object you want to make active.
  • You get the collection of rows (one per configuration) through the rows property on ConfigurationTopTable.

So the general flow is:

  1. Get the Design object for the configured design.
  2. Access design.configurationTopTable to get the ConfigurationTopTable.
  3. Use .rows to find the ConfigurationRow you want (e.g., by name).
  4. Call .activate() on that ConfigurationRow to make it the active configuration.

One caveat from the documentation: if you obtain the configuration table from a DataFile object (rather than from an open, loaded design), its functionality is limited — properties that would normally return a Component or Parameter return null, since the Fusion objects aren't actually loaded in that context. Full read/write access, including activation, requires the configured design to be open in Fusion.

Sources:

0 Likes
Message 3 of 4

billbedford
Advocate
Advocate

I asked the assistant to produce an add-in with "Make a mesh file from each of the configurations in the open Component", and that's what it did after asking what mesh parameters I wanted to include.  

Message 4 of 4

daniel_yochelson
Contributor
Contributor
Accepted solution

I also went the route of asking the assistant to help me with this and it was incredibly helpful. After a few times back and forth to narrow the scope and steps it created a python script and then an Add in. It first asks for where I would like the exports saved, then asks if I want to prefix anything to the names of each, saves each one and loops back to the first opened one. It does take a little bit depending on how many there are but that is still time I can be off doing something else. Thanks for the suggestions and I am happy to send the script to anyone who wants it but I cannot upload it here.