Accessing BRep of existing solids

Accessing BRep of existing solids

Anonymous
Not applicable
450 Views
1 Reply
Message 1 of 2

Accessing BRep of existing solids

Anonymous
Not applicable

Is it possible to access BRep of existing solids and build an adjacency matrix to describe the relation between different faces?

 

I have been trying to use adsk.fusion.BRepBody and adsk.fusion.BRepBodies, but they seam only thought for creating new solids, while I would like to analyse already existing one.

 

Cheers,
-P-

0 Likes
Accepted solutions (1)
451 Views
1 Reply
Reply (1)
Message 2 of 2

JesusFreke
Advocate
Advocate
Accepted solution

You can definitely access the brep of existing objects.

 

e.g. to access the brep of a body in the root component,

 

def run(_):
app = adsk.core.Application.get()
ui = app.userInterface

design: adsk.fusion.Design = app.activeProduct
root = design.rootComponent

brep: adsk.fusion.BRepBody = root.bRepBodies[0]

ui.messageBox('Body name: %s' % brep.name)

 

And of course you can traverse the component/occurrence hierarchy and similarly access any bodies in any sub-components, etc.