Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Script to generate embossed text to represent a limited run of 1-n

1 REPLY 1
Reply
Message 1 of 2
macen
102 Views, 1 Reply

Script to generate embossed text to represent a limited run of 1-n

Hello, I have limited script experience, and I'd like to know if the following is possible:

 

A component with text on it shows the unit number of a limited batch manufacture. I'd like to have a dialogue box that prompts the desired number of units to be produced, say, 250. Confirming this number will update the text sketch in the component with a new number, beginning with 001, 002, 003, and so on.

 

Ideally the output bodies are pasted in same fusion file to make saving for 3MF easier. If not possible, then other option would be to auto-save each unit number as a new 3MF file in a dedicated folder, but I imagine this requires longer compute time and be more of a challenge to load into a print bed.

 

Any guidance would be extremely helpful!! Thanks

 

 

1 REPLY 1
Message 2 of 2
BrianEkins
in reply to: macen

This is certainly possible and not particularly difficult and would be a great project to get started using the API. There are a few decisions you need to make up-front. Primarily, the questions you've already asked about what the result should be; an individual 3MF file for each part or a part that contains multiple bodies, one for each part. The programming will be easier to create a single file for each variation because in this case, the program will be modifying the existing part with the new value, exporting it as 3MF, modifying it with the next value, exporting, etc. If you want a single 3MF, I assume you'll want the parts laid out in a way that won't interfere with each other and will fit on the bed of your printer. To do this, you'll need to decide where this new component is created. Is it a new component in the same file where the original part exists, or it is in a new file? How will the parts be laid out? What if there are more than will fit? How do you handle more than one tray? None of these are hard to address but they involve some additional logic and work.

 

Here's a previous post about editing text.

https://forums.autodesk.com/t5/fusion-360-api-and-scripts/script-to-select-sketchtext-and-have-a-dia...

 

Here's a sample that demonstrates exporting various formats. 3MF support was added to Fusion after this sample was written, but it follows the same pattern.

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-B801DDA8-9A0C-42AD-AC06-F8244CA08D65

 

For a dialog, you'll need to create an add-in with a custom command. Here are some topics from the help to get you going with that.

User Interface Customization

Fusion 360 Commands

Command Inputs

Python Add-In Template

 

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report