API References visible in the node list

Anyone can advise why this Autodesk library is visible in the node list?
I converted all the classes into Static and placed everywhere the value [IsVisibleInDynamoLibrary(false)]

Second question: \is there any way to avoid to close all the times Dynamo and Revit to be able to compile the DLL?

  1. Perhaps check if you are exposing RevitAPI elements in what the nodes accept for inputs and outputs. I had this when I was exposing enums from the RevitAPI. Once I removed those and replaced them with primitive types the problem went away. I find it a bit odd that the attribute is opt in rather than opt out. Seems more logical you would want to point to things you want to include. At one point I had nodes from the whole presentation framework, solved that by late binding.
  2. Perhaps have a main assembly that is loaded by Dynamo and locked. Then load secondary assembly from byte array (when nodes are run) which is referenced from first. Iā€™ve not tested this approach in Dynamo (I tend to just restart). People say it works in the main RevitAPI this way but when I tried that approach I found debugging awkward (due to missing symbols you donā€™t get feedback when you hover over code with the mouse). I think I also noticed once that when I detached and then reattached it didnā€™t hit the breakpoint in Dynamo (so the byte array approach may not work but itā€™s worth trying perhaps).

This is the only place where Iā€™m using the reference to this library as explicit

What about in your functions? Are there any public constructors in that?

Your multi return dictionary item: Key=ā€œElementsā€ shouldnā€™t be returning a collection of Autodesk.Revit.DB.ElementID objects (a RevitAPI namespaced object). You probably need to convert them to Revit.Elements.Element (the dynamo namespace). I believe Revit.Elements.ElementSelector.ByElementId can be used to convert this but I donā€™t know if that is the most appropriate way for you.

ā€¦ByElementId takes an integer value i.e. ā€¦ByElementId(e.id.IntegerValue). There is a second overload to this function that asks if you want the Element to be ā€˜Revit Ownedā€™, thatā€™s probably important in some way Iā€™m yet to read anywhere.

I canā€™t see your function args at the top, so canā€™t advise on that end.

Okā€¦I found the mistake!
I was using a separate class file with the same namespace to collect some method. In some of these methods I was accepting Revit.DB.Elements as input.
Now I just put this class on a separate namespace and I did some code adjustment and is fine!

1 Like