Invalid Input Target for BRepBody.movetToComponent

Invalid Input Target for BRepBody.movetToComponent

Anonymous
Not applicable
623 Views
2 Replies
Message 1 of 3

Invalid Input Target for BRepBody.movetToComponent

Anonymous
Not applicable

I'm trying to move a body from one component to another using the code below. I get an Invalid Input Target Runtime error. I know the occurence target exists. What would cause this error?

 

for body in self.objectBodySet:
            body.moveToComponent(self.rwoOccurences().item(0))
        for body in self.holderBodySet:
            body.moveToComponent(self.holderOccurences().item(0))

def rwohOccurences(self):
        occs =self.design.rootComponent.allOccurrencesByComponent(self.RWOH)
        if occs.count==0:
            self.ui.messageBox("no occurences")
        return self.design.rootComponent.allOccurrencesByComponent(self.RWOH)
0 Likes
Accepted solutions (1)
624 Views
2 Replies
Replies (2)
Message 2 of 3

ekinsb
Alumni
Alumni

Can you please provide a full reproducable case for this.  There are several different things that could impact this and having a case that demonstrates the problem will make it much easier.  Ideally a .f3d file and the full script, the simpler the better.  Thanks.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
0 Likes
Message 3 of 3

Anonymous
Not applicable
Accepted solution

I have discovered the problem. I had been passing around a Design variable from my ui controllor to a variety of classes. But I never updated the design when I switched between documents which results in all sorts of weird errors.

0 Likes