python error: filter out rigidgroup entities that were removed, but still tracked in history
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi there,
Im running into a problem that is driving me a little batty.
when i run the below code, i get a bunch of rigidgroup entities that have been removed, they no longer show up in the current tree, they do appear in the history ...
app = adsk.core.Application.get()
ui = app.userInterface
# get active design
product = app.activeProduct
design = adsk.fusion.Design.cast(product)
exportMgr = design.exportManager
# get root component in this design
rootComp = design.rootComponent
# get all occurrences within the root component
rootOcc = rootComp.occurrences
all_rgs = rootOcc.allRigidGroups
is there a way i can filter these out?
the problem occurs is that i would like to get occurrences of each rigidgroup, but i cant run
rigidGroup.occurrences
inside or outside of a try block, with out a stack track:
Failed:
Traceback (most recent call last):
File "F:/dev/SDFusion.py", line 184, in notify
exporter.getAllBodiesInRigidGroup(name,rig)
File "F:\dev\exporter.py", line 228, in getAllBodiesInRigidGroup
self.getBodies(name,rigidGroup.occurrences,0)
File "C:\Users/dev/AppData/Local/Autodesk/webdeploy/production/dc406fd0d566a1ba77afee542432c1e031a68604/Api/Python/packages\adsk\fusion.py", line 29480, in _get_occurrences
return _fusion.RigidGroup__get_occurrences(self)
RuntimeError: 2 : InternalValidationError : pJointOcc
Talking with the person who created the file, the rigid group was removed, but the history still keeps it around in the document, since it will take a bunch of time for some one to process all the files to history type clean up, i was wondering what i can do on the code side.
furthermore `rigidGroup.isValid` returns True and `rigidGroup.isSuppressed` fails with a similar stacktrace.
Let me know what i can do to work around this issue?
Cheers
Kym