I’m attempting to create thousands of DirectShapes using the AddDirectShape.ByGeometry node and I’m running into an issue. The geometry that I’m trying to import is rather complex, think twisted/curving frames, and for mysterious reasons, Revit sometimes fails to create some of the geometry. Currently, when grasshopper gets to geometry it cannot create, it throws the error
1. Object reference not set to an instance of an object.
and it gives up there. Often only one-tenth of the way through all of the geometry.
Here is a file for reference.
200831-DirectShape_HELP.gh (1.2 MB)
I tried to modify the sample GhPython files to circumvent this issue (using try: and expect: to skip geometry it cannot create) but I am not using the Transaction manager correctly and I’m only able to create one DirectShape with my python script.
Is there a way for the GH component to skip geometry it cannot create? I haven’t found a way to consistently identify geometry that will be problematic before trying to create a directshape so I don’t know what to do here.
Or, can someone help on the GhPython script to add directshapes to the Revit document, skipping and logging the index of the geometry it could not create?
Thank you so much for your help!