Batch exporter script for different parameter configurations

Batch exporter script for different parameter configurations

andrew_tchircoff
Participant Participant
256 Views
9 Replies
Message 1 of 10

Batch exporter script for different parameter configurations

andrew_tchircoff
Participant
Participant

I often have a need to export a parametric design using multiple parameter combinations and Configurations do not work that well so I made a Python script that allows me to pick bodies or components, select parameters, provide parameter values and iterate through all parameter combinations, exporting each object in a separate file.

 

Full disclosure - the script is written with heavy help from ChatGPT, so probably a lot of things are not done in the most optimal way, but nevertheless, the scripts works right now and I'd like to share it with Fusion community and get some feedback. What I would like to have is some testing, especially on a Windows machine.

 

Github repo here: https://github.com/andrewtch/batch-parametric-export

 

preview

257 Views
9 Replies
Replies (9)
Message 2 of 10

picadilly
Advocate
Advocate

Hi Andrew,

 

thanks for contacting me. Yes, that looks very much, what I am looking for. In the meantime I did something similiar, but without a GUI. To use it, you stick your values into a csv-file and start a script.

 

This looks much more professional. I will have a look at it for sure.

 

Question: if you use your addin, will the information you type into the window be stored in the file or do I have to reenter it every time, I want to use it?

 

 

0 Likes
Message 3 of 10

andrew_tchircoff
Participant
Participant

Thanks! I'm looking forward to save the parameter values and object selections in the design attributes, but it's a bit more cumbersome than expected, but I will make it this way for sure.

Message 4 of 10

picadilly
Advocate
Advocate

Just for Information:

 

I called my version "parametric Export" and it can be found here:

https://github.com/osvacneo/parametricExport

 

Feel free to use anything of it, which looks useful to you.

 

Features, which might be interesting:

Both decimal point oder decimal comma will work (parameters can be decimal numbers).

ranges can be specified: 1.5 to 2.9 step 0.2 for parameters

parametric Text is supported

export stl, 3mf and step (export one or two or in all three formats)

solid error handling

if no components are named, all visible components will be exported separately

 

0 Likes
Message 5 of 10

picadilly
Advocate
Advocate

Even if this is embarassing:

What would be the best way to download and install: batch-parametric-export ?

 

I am familiar with subversion, but I do not warm up with git(hub)  😞

0 Likes
Message 6 of 10

BrianEkins
Mentor
Mentor

@picadilly, when I visit your GitHub site, it tells me "osvacneo doesn't have any public repositories yet".

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes
Message 7 of 10

BrianEkins
Mentor
Mentor

The easiest way to use a script or add-in from Github is to go to the repository, click on the green "Code" button and then "Download ZIP" at the bottom, both of which are shown below.

BrianEkins_0-1756351078719.png

Follow these steps:

  1. Look in the top folder of the downloaded zip file and look for the .manifest file. You want the name of that file.
  2. Create a folder on your computer that has the same name as the manifest file, minus .manifest.
  3. Copy the contents of the top folder in the zip file to the folder you just created. In this case you should have a folder named "BatchParametricExport" and it should have the contents shown below.

    BrianEkins_2-1756351347718.png
  4. Run the Scripts and Add-Ins command and choose the "Script or add-in from device" option as shown below. Browse to the folder you created. You should now see that script in the list and can run it from there.

    BrianEkins_3-1756351444432.png

     

 

 

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes
Message 8 of 10

picadilly
Advocate
Advocate

could very well be. I created this repository with assistance. And as I said, somehow I do not warm up to GIT. And I do not really know why. More precise, it irritates me. I get along with subversion very well. But for GIT there seems to be STOP-sign integrated in my brain.

 

I would publish the repository, if I did know, how.

0 Likes
Message 9 of 10

picadilly
Advocate
Advocate

@andrew_tchircoff : I downloaded it and could start it. But could not get it to work. I will have to try again later today.

0 Likes
Message 10 of 10

picadilly
Advocate
Advocate

What I did:

I downloaded the project an copied it to (C:\Users\xxxxx\AppData\Roaming\Autodesk\Autodesk Fusion 360\API\AddIns):

picadilly_7-1756711057263.png

 

 

Then I restarted F360. But the Addin does not list:

picadilly_1-1756710396210.png

Note: "TestSpielwiese" which is at the same place is recognized by Fusion360.

 

However "BatchParametricExport" is recognized as a script:

picadilly_2-1756710499176.png

 

I double checked the folder for scripts:

picadilly_3-1756710607104.png

Nothing there.

 

So, why is it recognized as a script?!

 

If I try to run it as a script in a empty design, I get this:

picadilly_4-1756710715246.png

 

If I open one of my designs and start it there, I get a error message:

picadilly_5-1756710917607.png

and then this:

picadilly_6-1756710956257.png

 

 

 

 

0 Likes