How does one write Category.ByName in the Code Block with multiple packages installed? For me it shows error like this:
Warning: Multiple definitions for ‘Revit.Elements.Category’ are found as Revit.Elements.Category, Rhythm.Revit.Elements.Category
Multiple definitions for ‘Revit.Elements.Category’ are found as Revit.Elements.Category, Rhythm.Revit.Elements.Category
‘archilab.Revit.Elements.Elements.Category’ is not a static property
Internal error, please report: Dereferencing a non-pointer.
With the namespace conflicts existing with @Raja’s setup of installed packages, unfortunately there is no way that Dynamo can uniquely resolve the class “Category”. The warning on the node indicates there is a conflict between “Revit.Elements.Category” and “Rhythm.Revit.Elements.Category” so no matter what prefix you use:
“Revit.Category”
“Elements.Category” or
“Category”,
all the above combinations will conflict with Rhythm as they could apply to the “Category” class in Rhythm as well. The only way is what @Kulkul suggested, to uninstall Rhythm or use a later version that has renamed these namespaces (which I think is what was done).