Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
Advanced Non-Uniform Scale Feature
leon_poot
Member, Developers Posts: 87 ✭✭✭
Here and there I've seen threads or posts about the need for a non-uniform scale feature.
I've written a little feature in FeatureScript capable of scaling in any chosen direction or set of directions.
Choice between:

It's far from perfect, the script has quite some clutter, i'm sure I have taken some detours and is has too many if/else statements.
But if you find it useful: have a copy, or import it to your collection of FS features. If you have any input for me, or tips and tricks on how to improve; all the better, do let me know!
https://cad.onshape.com/documents/c3f3651d28491d28eefba7d3/v/167ba220d329f5bec671e716/e/dbc28ecb5a20b4bfa14fc748
Cheers /Leon
Edit updated screenshots, info and version link
I've written a little feature in FeatureScript capable of scaling in any chosen direction or set of directions.
Choice between:
- Uniform scaling; in the standard coordinate system
- Non-uniform scaling; in the standard coordinate system
- Scaling in one direction; one direction query, one scale factor query
- Scaling in three directions; one or two direction queries (second will default perpendicular to the first until queried),
the third direction will be perpendicular to both, one scale factor query for each direction
- Keep Tools Boolean for keeping the original bodies and scaling a copy
- Use Entity Centre Boolean for using the calculated centroid (centre of surrounding box) or
- Feature Type choice between Feature or Entity queries. Not entirely sure whether Feature Scale works as it should.
So far it seems to work with bodies, faces, wires, and points (for the latter two you'll need to specify a reference point)

It's far from perfect, the script has quite some clutter, i'm sure I have taken some detours and is has too many if/else statements.
But if you find it useful: have a copy, or import it to your collection of FS features. If you have any input for me, or tips and tricks on how to improve; all the better, do let me know!
https://cad.onshape.com/documents/c3f3651d28491d28eefba7d3/v/167ba220d329f5bec671e716/e/dbc28ecb5a20b4bfa14fc748
Cheers /Leon
Edit updated screenshots, info and version link
"A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools." - Douglas Adams, Mostly Harmless
Tagged:
6
Comments
-
This is amazing! Great work Leon.There are 10 types of people in the world. Those who know binary, those who don't and those who didn't expect base 3!0
-
Thanks @Lee_Hesketh
I just pieced together a bunch of small little things I had together with some bits from the forum, turned out alright it seems.
It works on points and wires, and sketches as well when using Feature Scale (forgot to put that in the version above).
I'll see if I can update the post sometime with screenshots and more info when I have the time for it / if necessary, though I believe the UI is fairly straight-forward. done"A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools." - Douglas Adams, Mostly Harmless0 -
hi, @leon_poot, i'm requesting ability to scale entity according to some local coordinate system (defined by mate connector)
0 -
That's a smart idea, @konstantin_shiriazdanov. I'll have a look once I have a little time to spare!"A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools." - Douglas Adams, Mostly Harmless0
-
@konstantin_shiriazdanov
This might be a tad late, but I added the csys option now anyways.
New version:
https://cad.onshape.com/documents/c3f3651d28491d28eefba7d3/v/b5b79e36ef390264d2763eaf/e/dbc28ecb5a20b4bfa14fc748
"A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools." - Douglas Adams, Mostly Harmless1 -
thanks a lot @leon_poot, never too late)
0 -
Excellent! This is really nice. Tank you!
0 -
Awesome!
This should really be a standard feature.2 -
@David_Bone, best way to get Onshape's attention when it comes to requesting standard features would be to either enter an Improvement Request here on the forums, or vote for one that already describes what you want.David_Bone said:Awesome!
This should really be a standard feature.
This one for example:
https://forum.onshape.com/discussion/5345/non-uniform-scale-tool-improvement-request
"A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools." - Douglas Adams, Mostly Harmless0 -
Our built-in variant of this is coming soon as part of the transform/copy feature. Thanks for filling in the gap in the meantime, Leon! And for those that prefer the custom feature's interface to what we ship, there's no reason to stop using Power Scale.Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc1
-
Excellent news Ilya. Glad I've been able to help some people out in the meantime.
Will the built-in variant allow mate connectors as directional input? Gotta admit I tend to use local coordinate systems for just about anything in CAD:"A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools." - Douglas Adams, Mostly Harmless1 -
Yes, it'll let you specify a mate connector.Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc0
-
Is there a way to easily scale things in sketches without having to dimension it?0
-
@mbartlett21, the transform sketch tool doesn't include scaling. However, there are a few workarounds. When you create a new sketch, the first dimension you add will scale the rest of the sketch in order to keep the same overall sketch profile.You can also use solid/surface bodies as construction tools, i.e. create an extrude, scale the extrude, then create a sketch that uses the scaled body's edges.0
-
The only problem with that approach is you have to delete all your dimensions if you have already done the sketch, then start over.mahir said:@mbartlett21, the transform sketch tool doesn't include scaling. However, there are a few workarounds. When you create a new sketch, the first dimension you add will scale the rest of the sketch in order to keep the same overall sketch profile.You can also use solid/surface bodies as construction tools, i.e. create an extrude, scale the extrude, then create a sketch that uses the scaled body's edges.0 -
@mbartlett21, I'm going to sound like an OS employee, but what is your use case? Generally, in 20 years of using cad I haven't really needed the ability to scale a sketch.
Another possible solution is to build in a scaling factor using variables. Create a number variable #x and set it equal to 1. When you create and dimension your sketch, add "*#x" to the end of all your dimensions (or "#x*" to the beginning). Now, if you change #x, you will be scaling your whole sketch.0 -
The main reason is for bringing in dxfs that were scaled wrong when they were created1
-
Since you're starting with dumb lines anyway, I'd go with my earlier suggestion to create a surface/solid body with your imported DXF sketch, scale that body, then extract its edges in a new sketch. You can then delete the construction body.2
-
That's an elegant workflow, thanks for sharing it.mahir said:Since you're starting with dumb lines anyway, I'd go with my earlier suggestion to create a surface/solid body with your imported DXF sketch, scale that body, then extract its edges in a new sketch. You can then delete the construction body.

Cheers,
Owen S.
Business Systems and Configuration Controller
HWM-Water Ltd0 -
The worst thing about DXFs importing into Onshape is that the line endpoints are not coincident to one another.0
-
Power scale does actually scale entire sketches, if that helps. Either from it's centre or a queried point. Select the sketch as a feature (choose "Feature Scale" instead of "Entity Scale".
Just remember to toggle "Keep tool" (yes, that's a bug.)"A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools." - Douglas Adams, Mostly Harmless1 -
@leon_poot, I am not so good at Featurescript, but I modified yours a little so you can choose to scale From a Point To a Point. Can you implement this better than me? It would also be great if you could select a Curve to scale and have the script generate a new scaled curve inside the Sketch.
https://cad.onshape.com/documents/67cbb8f46b26b814e3c888d8/w/4e141b8447600e837be432a4/e/d6fa430585027cc3a96a11f6?renderMode=0&uiState=65db4de6c4c31561320a6e83
0 -
In 5 years at Honda R&D, I used a tool like this about 100 times a day (ish). it's is absolutely essential for Class-A type surface data.mahir said:@mbartlett21, I'm going to sound like an OS employee, but what is your use case? Generally, in 20 years of using cad I haven't really needed the ability to scale a sketch.
Another possible solution is to build in a scaling factor using variables. Create a number variable #x and set it equal to 1. When you create and dimension your sketch, add "*#x" to the end of all your dimensions (or "#x*" to the beginning). Now, if you change #x, you will be scaling your whole sketch.0









