Extract the bounding box of a solid
-
I am trying to write the code for a EM-LF simulation with several electrodes.
Using the GUI, in the simulation settings, when I assign the electrode solid to a field sensor setting a bouding box is automatically extracted and is linked to the field sensor setting.How can I extract this bounding box from code so that i can run everything from it?
-
I am trying to write the code for a EM-LF simulation with several electrodes.
Using the GUI, in the simulation settings, when I assign the electrode solid to a field sensor setting a bouding box is automatically extracted and is linked to the field sensor setting.How can I extract this bounding box from code so that i can run everything from it?
There is a function that returns the bounding box of an entity.
Let us assume you have an entity called 'object 1'. The following code should return the coordinate vectors of two diagonally opposite corners of the bounding box:import s4l_v1.model as model import XCoreModeling entity = model.AllEntities()['object 1'] bb_lower, bb_upper = XCoreModeling.GetBoundingBox([entity])You can then use the
model.CreateWireBlock()function to create an object which you can use in your simulation settings.For more detail:
help(XCoreModeling.GetBoundingBox) help(model.CreateWireBlock)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login