How to scale imported CAD model in 7.2?
-
Hello again!
I'm trying to import a CAD model (STEP), which works fine, but the documentation mentions a scaling multiplier option in the import dialogue box, which I am not seeing in V 7.2.3.12730
Any ideas? I need to scale the model to be larger by about 10%. Would prefer to do it in Sim4Life than resorting to another CAD tool.
A Python solution would be totally acceptable!
Thank you!
- Doug
-
Ah, yes thank you for pointing that out.
It doesn't seem to work for groups of more complex geometry parts though; the "Stretch" button is grayed out at the higher grouping tree levels; only active for individual child components.
For our purposes, we're importing some STEP / STP files, which we discovered are mostly human readable ASCII, and there is one line which appears to scale the model proportionally in the STEP file, if you edit it to change 1.0 to a different number (I assume the line/item numbers might differ from file to file; but editing this line before importing seems to be a good workaround).
#31=LENGTH_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0),#49);
-
Yes, you cannot directly stretch a group. However, you can select multiple (non-group) entities and stretch them.
The easiest is to press "Ctrl+A" (Select All), which will select all visible entities (excluding the groups), and then stretch those.You can also use the Python API.
import XCoreMath import XCoreModeling Vec3 = XCoreModeling.Vec3 scaling0 = XCoreMath.Scaling(Vec3(2.0)) scaling1 = XCoreMath.Scaling(Vec3(1.2, 0.9, 2.0)) scaling2 = XCoreMath.Scaling(Vec3(1.2, 0.9, 2.0), origin=Vec3(120, 10, 34)) entities = XCoreModeling.GetActiveModel().SelectedEntities for e in entities: e.ApplyTransform(scaling0)
the different scalings are
- uniform scaling
- non-uniform scaling
- non-uniform scaling wrt to the (non-zero) origin=(120, 10, 34)