Dynamo Stopped Selecting DirectShape Elements

Hello Dynamos,

This one has Ripcord Engineering stumped. Hopefully others have experienced a ‘Dynamo Stopped Selecting DirectShape Elements’ event in the past and are able to offer resolution guidance.

Background
For a few years Ripcord Engineering has successfully run Dynamo workflow based in part on selection of Dynamo generated DirectShape elements.

Yesterday afternoon Dynamo stopped selecting DirectShape Elements. Snip of an attempt to select a freshly generated Dynamo DirectShape element with Dynamo is below with element circled in blue on the left and Dynamo result on the right.

The warning points to a problem with the type initializer for ‘Revit.Elements.DirectShape’ when an attempt is made to select a DirectShape element. The same warning is not thrown when an attempt is made to generate a DirectShape element.

Steps taken thus far to resolve warning

  1. Repair Revit - same results as above,
  2. Reinstall Revit - same results as above,
  3. Evaluate different project - same results as above,
  4. Recreate DirectShape element and attempt selection - same results as above.

Versioning
Ripcord_Revit_Version
Ripcord_Dynamo_Version

Associated Forum Posts
Imported Direct Shape elements can not be selected

Request
Additional information on troubleshooting type initializer exceptions for ‘Revit.Elements.DirectShape’.

Thanks for any help the community may be able to offer to resolve ‘Dynamo Stopped Selecting DirectShape Elements’.

Best wishes,
Jake

Took a short trip away from the office and was dreading a return to tackle the DirectShape selection problem.

Don’t know why, but the DirectShape selection problem cleared itself. Could be that the computer restarted itself while I was away and that’s what cured the problem.

Overall, an odd sequence of events. Happy to be back in business.

-Jake

Was working through another Windows 10/Revit21 workstation and had the same problem: type initializer exception for ‘Revit.Elements.DirectShape’.

Configuration:
Windows 10 that continually updates itself so it’s hard to know what state it’s in,
OOTB Revit21 >> Dynamo 2.5.

The workstation in question had two user accounts: (1) admin and (2) non-admin. The problem was initially encountered with the non-admin account. Switched over to the admin account and the type initializer exception was not thrown. Weird.

Reinstalled Revit following the AutoDesk instructions located here. Restarted Windows 10. Logged into the previously troubled non-admin account and attempted to select DirectShapes in the Dynamo environment. No type initializer exception. Ditto for the admin account >> didn’t unintentionally migrate the problem >> victory!

Based on background reading it seems like something in the .Net environment in Windows 10 reaches a state where Dynamo causes it to throw an initializer exception during DirectShape selection events. It also seems like Revit reinstallation cures the adverse state. Personally I don’t have enough Windows 10 knowledge to point directly to root cause.

Bottom line: to cure type initializer exception try a Revit reinstallation and Windows restart.

-Jake