Skip to content
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

ZMT zurich med tech

  1. Home
  2. Sim4Life
  3. CAD Modeling
  4. How to scale imported CAD model in 7.2?

How to scale imported CAD model in 7.2?

Scheduled Pinned Locked Moved Solved CAD Modeling
4 Posts 2 Posters 573 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dbsim4
    wrote on last edited by
    #1

    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
    1 Reply Last reply
    1
    • brynB Offline
      brynB Offline
      bryn
      ZMT
      wrote on last edited by
      #2

      The move tool has a "Stretch" tool (the button is in the 3D visualization view on the right). If you center the pivot, the stretch will be symmetric around the center of the bounding box. Else (by default) the stretch is wrt to the origin.

      1 Reply Last reply
      1
      • D Offline
        D Offline
        dbsim4
        wrote on last edited by dbsim4
        #3

        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);

        1 Reply Last reply
        0
        • brynB Offline
          brynB Offline
          bryn
          ZMT
          wrote on last edited by bryn
          #4

          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)

          Youtube Video

          1 Reply Last reply
          1
          • SylvainS Sylvain has marked this topic as solved on
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Search