Python scripting padding settings
-
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
-
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. -
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
-
Thanks for the clarification. The code you wrote is correct, I think, and everything behaves normally when I run it (I am using Sim4Life V8.2.2.18061). I do get the squiggly line when the provided values are different (like
numpy.array([50.0, 10.0, -900.0])
). I get a straight line automatically when the values are all identical (likenumpy.array([50.0, 50.0, 50.0])
).Some questions for you, so that I can try to reproduce your issue:
- which version of Sim4Life are you using?
- which type of simulation are you trying to setup? (it is possible that there is a bug in the API only for some simulation flavours...)