Creating construction planes from BoundingBox3D
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hows it going guys,
I was wondering if someone could point me in the right direction as to how I would create construction planes around a brep that once was a mesh. I say that last part because the geometry I am dealing with has no flat edges, its almost like a deformed ball that got stepped on. Anyways I want to crate construction planes around this brep for CAM purposes down the line. Setting up planes by hand is time consuming. After looking at the object model I noticed that there is a BoundingBox3D object. This object returns the min and max points of the bounding box. I am not sure I understand what exactly that means. How can two points represent a 3D space?
My thought process was to create a bounding box around the brep, then generate a series of construction points representing the corners of the bounding box, then using those points to create construction planes on all six sides of the box. Right now I can target the brep and create a bounding box based off that brep. My next step was to create a construction point of the min and max values of the bounding box just to visualize whats going on. But when I do this I get RuntimeError: 3 : Environment is not supported. Here is my code so far. Let me know if I am on the right track or if there is a better way to go about this conceptually.
Thanks again !
All the best
import adsk.core, adsk.fusion, adsk.cam, traceback
app = adsk.core.Application.get()
ui = app.userInterface
design = app.activeProduct
rootComp = design.rootComponent
sketches = rootComp.sketches
features = rootComp.features
ui.messageBox(str(rootComp.bRepBodies.count))
bRpe_1 = rootComp.bRepBodies.itemByName("R Shell")
ui.messageBox(str(bRpe_1.area))
bb_1 = bRpe_1.boundingBox
bb_1_maxP = bb_1.maxPoint
bb_1_minP = bb_1.minPoint
ui.messageBox(str(bb_1_minP))
constructionPoints = rootComp.constructionPoints
pointInput = constructionPoints.createInput()
pointInput.setByPoint(bb_1_maxP)
constructionPoints.add(pointInput)