I have recently been working through some code used to manage data from Revit through a pipeline. A significant amount of this code relies on the Rhino built-in Node-in-Code (NIC) functionality. This code was working as of earlier week of May 16th without error. Today, May 22nd, when the project started all of the modules broke due to Components.FindComponent(RhinoInside_{module_name}
returning None.
Further testing has shown that the the Rhino.Inside namespace (RhinoInside_) is missing from the NIC functions table.
The code uses the following import block
from ghpythonlib.componentbase import executingcomponent as component
from Rhino.NodeInCode import Components
# Common-Language-Runtime module provided by IronPython
import clr
clr.AddReference('System.Core')
clr.AddReference('RhinoInside.Revit')
clr.AddReference('RevitAPI')
clr.AddReference('RevitAPIUI')
from System import Enum, Action
import rhinoscriptsyntax as rs
import Rhino
import RhinoInside
import Grasshopper
from Grasshopper.Kernel import GH_RuntimeMessageLevel as RML
from RhinoInside.Revit import Revit, Convert
# add extensions methods as well
# this allows calling .ToXXX() convertor methods on Revit objects
clr.ImportExtensions(Convert.Geometry)
from Autodesk.Revit import DB
The base caller is defined as:
def GetComponent(node, namespace="RhinoInside"):
"""
This component will retrieve a component based on a given namespace
and node name. This leverages the built-in functionality within
Grasshopper to assemble an in code Directed Acyclic Graph (DAG)
by invoking nodes from within python.
Arguments:
node - str - The name of the node that is being references.
namespace - str - the name of the namespace from which the node belongs. Default 'RhinoInside'.
Example call:
# Return a component
fiter = self.GetComponent("CategoryFilter")
elements = filter.Invoke("Revit Category : Roofs : id -2000035")
#Invoke inline
elements = self.GetComponent("CategoryFilter").Invoke("Revit Category : Roofs : id -2000035")
"""
name = "{namespace}_{node}".format(
namespace = namespace,
node = node
)
component = Components.FindComponent(name)
if not component:
self.show_error("Component {node} not found in namespace {namespace}.".format(
node = node,
namespace = namespace
))
raise ValueError("No component")
else:
return(component)
The documentation for RIR indicates that the default call for this should match the syntax of comp = Components.FindComponents("RhinoInside_AddMaterial")
(see documentation) . The equivalent using the provided code (running through the script interface) would be comp = GetComponent("AddMaterial")
. This will error with the value error No Component
indicating that no component of that name was found and that FindComponent(...)
returned a None.
When inspecting the root Components.NodeInCodeFunctions
RhinoInside is no longer present, nor is any RhinoInside component. Tests have been run on CategoryFilter
and QueryElement
as well which also return none in both the FindComponent
method and when inspecting the NIC functions table.
Has anything changed in the RIR code base or with Rhino 7 that would alter the way that RIR is loaded into the grasshopper environment or how NIC interprets what nodes are available?
Thanks.