Message 1 of 2
BrepBody.copyToComponent creates an open model from a closed model

Not applicable
03-22-2016
09:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm copying bodies from one component to a new component to do destructive calculations on the new body. When I copy one body (which is closed) it coppies and is no longer closed. Note that I'm not sure what the correct term is but see the picutres below.
This makes the inteference calcuations I'm performing invalid as the the API cannot detect interference with an unclosed body.
What is causing this error and can it be remidied. My copying code is below, but it has not caused this issue on any other design.
def createCopyComponent(self, modelBool, copyBool, component): copy = createNewComponent(self.model)#todo change to rwoh component and check for code validation occurencesOfCopy = self.design.rootComponent.allOccurrencesByComponent(copy) bodies = getModelBodies(component) # string = "" # for body in bodies: # string+=body.parentComponent.name+"."+body.name+", " for body in bodies: if copyBool: occ =occurencesOfCopy.item(0) body.copyToComponent(occ) elif not self.copyBody(body): if not modelBool: # self.ui.messageBox("copyying: "+body.parentComponent.name+"."+body.name) occ =occurencesOfCopy.item(0) # self.ui.messageBox("occ: "+occ.component.name) body.copyToComponent(occ) elif not self.rwohBody(body): # self.ui.messageBox("copyying: "+body.parentComponent.name+"."+body.name) occ =occurencesOfCopy.item(0) # self.ui.messageBox("occ: "+occ.component.name) body.copyToComponent(occ) return copy
Palm(861) is the copy