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. Python API
  4. Python scripting padding settings

Python scripting padding settings

Scheduled Pinned Locked Moved Python API
3 Posts 2 Posters 18 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.
  • T Offline
    T Offline
    tiwwexx
    wrote last edited by
    #1

    Hello, I am trying to script some simulations but encountered a bug.

    When changing the padding Settings to Manual and bottom padding to be variable across x,y,z, This setting is not translated into the generated python script. How do I set my GlobalGridSetting to have bottom padding and top padding variable amounts across x,y,z. See attached picture.

     # Editing GlobalGridSettings "Grid (Empty)
        global_grid_settings = simulation.GlobalGridSettings
        global_grid_settings.PaddingMode = global_grid_settings.PaddingMode.enum.Manual
        global_grid_settings.BottomPadding = numpy.array([50.0, 10.0, -900.0]), units.MilliMeters
        global_grid_settings.TopPadding = numpy.array([10.0, 10.0, -300.0]), units.MilliMeters
    

    0c6da22e-0853-424a-ac26-dd236e6cd90a-image.png

    1 Reply Last reply
    0
    • SylvainS Offline
      SylvainS Offline
      Sylvain
      ZMT
      wrote last edited by
      #2

      Hello, I am probably misunderstanding something and do not see where the bug is.
      It seems to me that your script and your picture are in perfect agreement: in both cases, the padding settings are different across x, y and z (e.g. 50, 10 and -900mm, respectively, for the bottom padding) and all values seem correct.

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tiwwexx
        wrote last edited by
        #3

        I can see how the post is a little confusing. Sorry about that.

        The screenshot is the setting I want to have but when running the code snippet I do not get that squiggly line for the independent padding options. Instead the line is straight. Funny enough after clicking it manually it did go to the correctly prescribed values. So I'm 90% sure I just need to find some field in the global settings that looks something like global_grid_settings.bottompad.enum.ind_axis but am having a little trouble with the API documentation to find this setting

        1 Reply Last reply
        0
        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