Issue: DirectShape.ByGeometry Error in Revit Dynamo
Hello everyone,
My team is facing an issue when working with DirectShape.ByGeometry in Revit through Dynamo. Here’s a detailed description of the problem:
Error Message
The type initializer for 'Revit.Elements.DirectShape' threw an exception DirectShape.ByGeometry operation failed.
Key Observations
- When the error occurs:
- Using DirectShape.ByGeometry to create DirectShapes in Dynamo.
- Fetching elements through Get All Elements of Category node in Dynamo.
- Inconsistent behavior:
- The same script and geometry work on one machine but fail on another.
- Restarting the machine occasionally resolves the issue temporarily.
- Environment details:
- We have the pyRevit add-in installed across all affected machines.
Troubleshooting Attempts
- Verified the same geometry on different machines—works on some but fails on others.
- Restarting Revit/Dynamo or the system temporarily resolves the issue.
- Ensured all machines are on the same Revit version and Dynamo version.