
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
What my script does so far:
- Insert a Component from File (has a jointOrigin)
- Duplicates the inserted Component with
occurence = rootComp.occurrences.addExistingComponent(sourceComponent, adsk.core.Matrix3D.create())
- gets a Occurence and takes the jointOrigin of the imported component
- uses createForAssemblyContext(occurence) to get the jointOrigin of the Copy
jointInput = joints.createInput(occurence.component.allJointOrigins[jointOriginIndex].createForAssemblyContext(occurence), secondJoinOrigin)
- create a joint
- add the occurence to my global array of occurences
what I try to do:
- iterate through my global variable occurences
- delete all occurence of the created copies who were joined:
for occurence in occurences: if occurence.isValid and occurence.component.name == sourceComponent.name: occurences.remove(occurence) occurence.deleteMe()
- create new occurences and joints for each selected jointOrigin
the first times it works as expected and after selecting the 4th jointOrigin I get this error:
InternalValidationError findObjectPath(this, objPath)
How can i delete the occurences on a save way and prevent the Error?
Solved! Go to Solution.