# Python RIR Node-in-Code Namespace Not Loading

**URL:** <https://discourse.mcneel.com/t/python-rir-node-in-code-namespace-not-loading/142869>\
**Category:** Revit\
**Tags:** windows, python, rhino7\
**Created:** [May 22, 2022, 4:22am UTC](https://discourse.mcneel.com/t/python-rir-node-in-code-namespace-not-loading/142869 "2022-05-22T04:22:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zachary\_Lancaster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/zachary_lancaster/32/380834_2.png) [@Zachary\_Lancaster](https://discourse.mcneel.com/u/Zachary_Lancaster)\
**Post date:** [May 22, 2022, 4:22am UTC](https://discourse.mcneel.com/t/python-rir-node-in-code-namespace-not-loading/142869/1 "2022-05-22T04:22:34Z")

</div>

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

```auto
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:

```auto
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](https://www.rhino3d.com/inside/revit/1.0/guides/rir-ghpython#node-in-code)) . 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.

---

<div class="post-metadata">

**Author:** ![eirannejad](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/eirannejad/32/477962_2.png) [@eirannejad](https://discourse.mcneel.com/u/eirannejad)\
**Post date:** [May 25, 2022, 3:27pm UTC](https://discourse.mcneel.com/t/python-rir-node-in-code-namespace-not-loading/142869/2 "2022-05-25T15:27:31Z")

</div>

I just tested this in the latest WIP build and everything seems to be working

 ![Screen Shot 2022-05-25 at 08.25.32](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/c/5/3/c53fee1f5453bc6bd6020e531105403333c79ee1.png)

---

<div class="post-metadata">

**Author:** ![famak2](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/famak2/32/608855_2.png) [@famak2](https://discourse.mcneel.com/u/famak2)\
**Post date:** [March 22, 2023, 11:18am UTC](https://discourse.mcneel.com/t/python-rir-node-in-code-namespace-not-loading/142869/3 "2023-03-22T11:18:32Z")

</div>

I also cannot find the RhinoInside components on my end. Using build 1.12.8445.26409 on Revit 2022.1.3.

![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/2/8/1/281d793d76805a4a4000a85676720d840b295835.png)

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/5/b/5/5b57e81d5dcb1d0364a3290f80bbd273dcb7b750.png)

---

<div class="post-metadata">

**Author:** ![Japhy](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/japhy/32/487647_2.png) [@Japhy](https://discourse.mcneel.com/u/Japhy)\
**Post date:** [March 22, 2023, 12:25pm UTC](https://discourse.mcneel.com/t/python-rir-node-in-code-namespace-not-loading/142869/4 "2023-03-22T12:25:56Z")

</div>

Please see the previous threads on this topic.

> [@Using the NodeInCode namespace](https://discourse.mcneel.com/t/using-the-nodeincode-namespace/49735/28):
>
> Hi everyone, and thanks @piac for this! Apologies for ripping this thread open, but I haven’t found an update to this issue. Is the quote below still true? I’m trying to use NodeInCode to run a component from a third-party plugin (namely Kiwi3D), and I need to programmatically change its “special settings” as Giulio calls it - I’m calling it “custom component options” as per [Rhino - Custom Component Options](https://developer.rhino3d.com/guides/grasshopper/custom-component-options/)). Currently I’m using ComponentFunctionInfo.Evaluate to feed inputs and collect outputs…

> [@NodeInCode Example in RIR](https://discourse.mcneel.com/t/nodeincode-example-in-rir/134052/2):
>
> I noticed that the example given in the official page using ComponentFunctionInfo.Invoke() but somehow I make it work with ComponentFunctionInfo.Evavluate(). And the following code is the result I had. Works in my local machine. private void RunScript(Brep BREP, ref object DS) { // AddMaterial component to create a material var queryMaterials = Components.FindComponent("RhinoInside\_QueryMaterials"); // and AddGeometryDirectShape to create a DirectShape element in Revit var a…
