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.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Chasing my tail on an add-in with a parametric model

Message 1 of 2
465 Views, 1 Reply

Chasing my tail on an add-in with a parametric model

Despite poking around in the forum quite a bit and applying a bit of Google-fu, I'm stuck. Any guidance would be very much appreciated.

I'm building an add-in to automate the creation of "finger joints" in sheet material for use with a laser cutter. The workflow is to have the user select one or more rectangular faces that have their short dimension equal to the material thickness. With the face(s) selected, and the width of a finger set in the UI, clicking Ok causes the script cut the gaps between the fingers on each of the faces. This all works splendidly, even with a fully parametric model, with one exception. I simply cannot figure out how to set things up so that the correct number of gaps are cut. The reason is that the number depends on the length of the face, and that's subject to change if the user adjusts the UserParameters.

In brief, here's how the add-in execution logic works: It iterates over the selected faces. For each face it creates a sketch on the face and adds a 2-point rectangle the width of the face and as long as the gap between the fingers. This is constrained to the correct position on the face. Next a gap is cut (extruded) into the face using the rectangle. Finally, the resulting features are replicated along the face using a rectangular pattern.

The trouble is that the position of the first cut and the quantity the pattern should create depend on the current length of the face, and that can change as the user makes changes to the user parameters. I can, of course, put a driven dimension on the length of the face, but I can't see how to use it in a constraint or with the rectangular pattern. There's a similar problem with the current thickness of the material since that, too, could be some unknown function of some unknown user parameters.

It could be something simple I'm missing, or it could be I've approached this whole thing in a way that won't work. Or maybe it's just not possible to do what I'd like, though that seems unlikely. As I said, any guidance would be much appreciated.

Message 2 of 2
in reply to: dehne1

I had a similar problem - in the UI - adding balls into an arbitrary-sized ball-race.


I semi-solved it by designing for *way* more balls than I'd ever need, and at the very end, reducing the parameters to the number I want.


I was unable to go the other way (more than I designed) because it didn't know how to handle adding new ones, just removing existing ones...

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