Scale factor not parametric

Scale factor not parametric

Anonymous
Not applicable
3,095 Views
19 Replies
Message 1 of 20

Scale factor not parametric

Anonymous
Not applicable

Hi, I don't know if this is kind of a bug or would be better placed in the Ideastation, but noticed that for the Scale tool (for bodies, sketches, etc.) the scale factor does not allow a parametric entry, which would be nice for some things. 

Keep up the awesome work with Fusion 360!

Jesse

0 Likes
Accepted solutions (1)
3,096 Views
19 Replies
Replies (19)
Message 2 of 20

jeff_strater
Community Manager
Community Manager

Good catch, @Anonymous!  I would agree that this a bug.  Yes, it is certainly useful at times to be able to control scale parametrically.  I'll log it, and get it put on the list.

 

thanks

 

Jeff Strater (Fusion development)

 


Jeff Strater
Engineering Director
0 Likes
Message 3 of 20

jeff_strater
Community Manager
Community Manager
Accepted solution

Just to be clear:  the problem is that you cannot type in an existing parameter in the scale dialog at creation time.  For instance, if you have a user parameter called "scale", and you create a new Scale feature, you can type "scale", but it does not keep this relationship.  It just uses the value at creation time.  But, scale does create a parameter that can be edited, and the scale updates correctly.  Is that what you see?

 

You can work around this, of course, in the Parameter dialog, by editing the scale parameter to use "scale" as its value.  

 

Still a bug, of course, but there is a workaround

 

Jeff

 


Jeff Strater
Engineering Director
Message 4 of 20

jeff_strater
Community Manager
Community Manager

sorry - posted twice...  


Jeff Strater
Engineering Director
0 Likes
Message 5 of 20

Anonymous
Not applicable

Thanks Jeff, that did it!  It doesn't let me even type a parameter, user defined or not (such as scale, or d1, etc.), remaining red.  But you reminding me of looking at the scale factor parameter name in the Edit Parameters table (doesn't give the scale factor dimension name elsewhere as usual), and sure enough can identify the scale factor parameter name there, such as d63, and enter that for other scale factors in the Edit Parameters table (if enter elsewhere, will not update as you say).  Evidently, the scale factor is a unique format that can only receive an existing scale factor parameter.  But this knowledge and workaround is perfect.  Awesome!

Jesse

0 Likes
Message 6 of 20

sgraves
Enthusiast
Enthusiast

I would like to tag onto this discussion.  Even though it is been a while since it was originally posted, I think new information should be posted for Googling this content.

 

I have the exact problem stated here.  I am trying to create a parametric design that is responsive.  I am creating a spline that needs to adjust as parameters change.  I can add dimensions to each point and make those dimensions depend on the required parameters.  This works ok, but adding the dimensions is extremely slow.  The script takes 30 seconds or more for this operation.  I realized that the spline's form is such that it can be scaled.  If I scale it, the response is almost instantaneous.

 

But I can't do a parametric scaling.  I don't get a parameter (as suggested above) for the backdoor technique (which would be fine with me).  I can kind of understand the problem.  To do parametric scaling one must have an original version that is scaled.  If the scale factor changes, parametrically one would expect that one is changing the scale of the original.  If Fusion 360 is scaling the actual objects and doesn't keep the original, then parametric scaling makes no sense.

 

I think this is still a bug, however.  I suspect that the issues above have reared their head and that even the parameter entry has been removed.

 

I am going to keep working to make a more responsive script.  I think parametric scaling is off the table, unless there is something I have missed?

0 Likes
Message 7 of 20

sgraves
Enthusiast
Enthusiast

More information.  The backdoor exists at the 3D level.  No parameter is created when scaling inside of a sketch, but when one scales outside of the sketch there is a parameter and the backdoor that was referenced above.

 

I can work with this.

0 Likes
Message 8 of 20

jeff_strater
Community Manager
Community Manager

@sgraves, I verified that the scale parameter is still there.  However, one word in your post has made me wonder...  You say "I realized that the spline's form is such that it can be scaled".  This made me wonder whether you are using a Sculpt (TSpline) body here, and are scaling it in the Sculpt workspace.  If so, then yes, that scale is not parametric.  No TSpline operations in Fusion are parametric.

 

[edit]  I forgot to add that once you leave Sculpt mode, the body is converted to a BRep solid or surface, and you can then use the Model workspace's Scale operation, which is, indeed, parametric.

 

If you can share your design and/or a screencast showing what you are doing, I'm betting the answer will be clear to us.

 

Thanks,

 

Jeff

 


Jeff Strater
Engineering Director
0 Likes
Message 9 of 20

sgraves
Enthusiast
Enthusiast

@jeff_straterI am making a 2D fitted spline in a sketch.  What I realized was that I could simplify the formula for the parameters for the points so that they were controlled by one parameter effectively scaling by that parameter.  So I am creating a normalized spline (parameter of 1) and scaling it.

 

I guess I should fess up.  The spline is the involute curve and I am making a parametric gear generation tool.  I expect to have a bunch of ways to create gears.  For example, choosing two shafts and gear ratios, etc. I expect to create two gears with the given ratio that adjust if the shaft positions are changed.  I think I can parameterize it in such a way that if the shafts go from parallel to intersecting then the parameters automatically generate bevel gears.  I plan on the main mode of generating gears to be in pairs with the appropriate joint constraints to make them work together as expected.

 

0 Likes
Message 10 of 20

jeff_strater
Community Manager
Community Manager

Ah, OK, I see.  You are trying to scale a sketch.  Yes, this is not a parametric operation, unfortunately.  The operation that is parametric is scaling a body in Modeling.  If your method of basing it off a single parameter in the sketch works for you, I would go that way.  Alternatively, you could scale it after you have a solid, and that operation is parametric.

 

Jeff

 


Jeff Strater
Engineering Director
0 Likes
Message 11 of 20

sgraves
Enthusiast
Enthusiast

The "unique" property of the scaleFactor is that it is unitless.  One can type in a parameter that has length and then divide by the unit length i.e. "/1 in" or "/1 cm".  It will go from red to black.  The same applies to the API.  One will get an error if one uses a parameter with units.  Dividing by the given units i.e. "baseRadius/ 1 in" will work.  If baseRadius is a parameter with units of inches.

Message 12 of 20

sgraves
Enthusiast
Enthusiast

@jeff_straterActually it is parametric.  If I choose the entire sketch as the entity to scale if creates a scale feature on the timeline that has a parameter.  If I try to create the parameter expression in the valueinput it fails.  But if I create a scale with a real number, I can take the freshly created scale and set the scaleFactor.expression for my desired parameter.

 

It works very well and does just what I need (and fast!!!).

 

The present puzzle is how to mirror sketch entities.  I can see that there are many things that are straight forward in the UI that aren't so much in the API.

0 Likes
Message 13 of 20

sgraves
Enthusiast
Enthusiast

The code for the reference of future Googlers.

 

        scaleSet = adsk.core.ObjectCollection.create()
        scaleSet.add(involuteSketch)
        
        scales = rootComp.features.scaleFeatures
        scaleFactor = adsk.core.ValueInput.createByReal(1)
        scaleInput = scales.createInput(scaleSet, involuteSketch.originPoint, scaleFactor)
        
        scale = scales.add(scaleInput)
        scale.scaleFactor.expression = "baseRadius/1 in"

 

0 Likes
Message 14 of 20

Anonymous
Not applicable

same thing happened to me, i scaled an object but the action does not save on the time line, and when I make other edits it acts like it was never scaled. 

 

0 Likes
Message 15 of 20

Gigabeast
Participant
Participant

It's 2023 now and it's still not parametric! Glad to see there's a workaround though, which I've replied to separately. Cheers!

0 Likes
Message 16 of 20

Gigabeast
Participant
Participant

I have just encountered this problem, as I've designed a spline sketch and extruded it into a body, and I want to scale the body. The exact scenario is a cable clip with a funky shape, and I want to be able to scale it for different cable sizes.

 

Manual scale works fine but I wanted a user parameter FlexDiameter, that's then divided by the circle diameter I happened to use for the sketch which is 14.5mm, so I made a derivative user parameter

ScaleFactor = FlexDiameter/14.5.

 

In October 2023, still you can't put a user parameter into the Scale dialog for a body. It stays red and won't accept it.

So I tried the workaround of editing the Model Parameter "Scale" after specifying a manual scale factor in the scaling dialog. But it refused, saying it was expecting a unitless number. Hmm, tricky. So I set ScaleFactor to be "no units" and it helpfully inserted a division by the original unit into the expression box, so it became

ScaleFactor = "(FlexDiameter/14.5)/1mm" and I thought I was home and dry. NOPE! Still refused it with the same error!

 

Hmm, very tricky. So then I removed my user parameters and started again.

I created FlexDiameter and set it to NO UNITS and gave it a value of 7.25

Then I created ScaleFactor and set it to NO UNITS and gave it a value of FlexDiameter/14.5

Then I edited the Model Parameter expressions in the "Scale1" for my body, replacing the number that was manually entered in the Scale dialog when doing the scale manually on the body, and put in my ScaleFactor parameter name, and it finally accepted it!

 

So to summarise, If you run into trouble trying to do a parametric scale (at least on a body, I know that works now), then create your user parameters from scratch using the NO UNITS option in the parameter creation dialog, and add a comment for the parameter to remind you what the units actually are, heheheh! Do a manual scale on the body, then go back into the parameter edit screen and replace the "Expression" for the scale with the parameter ScaleFactor.(I did a non-uniform scale because I only wanted to scale X & Y, so I have three boxes, for ScaleX, ScaleY, and ScaleZ, and I put my Scale Factor parameter into the Expression box for ScaleX and ScaleY and left ScaleZ as "1")    

 

I hope that helps someone else avoid pulling hair out trying to get this to work 🐵 

 

Cheers all!

Tony.

(Attached and embedded - image of finished Parameters dialog for my project with working parametric scaling) Successful Parametric Scale.jpg

0 Likes
Message 17 of 20

g-andresen
Consultant
Consultant

Hi,

Everything works as expected for me.

 


Maybe you can share your design as f3d for analysis.

 

günther

0 Likes
Message 18 of 20

Gigabeast
Participant
Participant

Thanks for the comment. I just couldn't get mine to do that. Sorry I can't share the F3D as I've made a clone of the design of an existing manufacturer's clip for my own use around the house 🐵 

0 Likes
Message 19 of 20

g-andresen
Consultant
Consultant

Hi,

create a sample for sharing

 

günther

0 Likes
Message 20 of 20

Gigabeast
Participant
Participant

That won't help with the diagnosis/solution to this particular problem and would only leave me open to accusations of copyright infringement, hehehe, sorry I'm keeping it to myself 🙂

0 Likes