Hello there,
is there any way of importing the nodes of Rhino.Inside within my python script? I want to import particulary AddWall.ByCurve and AddFamilyInstance.ByLocation.
Thanks in advance
Hello there,
is there any way of importing the nodes of Rhino.Inside within my python script? I want to import particulary AddWall.ByCurve and AddFamilyInstance.ByLocation.
Thanks in advance
heres an example of NodeInCode
import ghpythonlib.components as gh
gh.PLUGIN_NAMESPACE.COMPONENTNAME()
# An example with the Weaver Bird plugin
outputPolygons = gh.WeaverBird.WeaverbirdsFacePolylines(inputMesh)
This is way out of my arena.
Doesn’t revit require you to open a transaction?
https://www.rhino3d.com/inside/revit/beta/guides/rir-ghpython#handling-transactions
Hello Rickson,
the transaction is within the definition already in this case within the gh.RhinoInside.AddWallByCurve(),
I tried though to open a transaction and create the wall but it threw an error.
Filed an issue for this
Hi all! I’m having some trouble with accessing the RhinoInside Revit components.
I have imported the components module(s) and am attempting to call a RhinoInside Revit component but I am getting errors that no RhinoInside attribute exists. I’ve tried both the ghpythonlib and Rhino.NodeInCode methods. What am I missing here?
Software info:
Revit 2019.2.6
![]()
here is what I am trying to achieve:
import rhinoscriptsyntax as rs
import clr
clr.AddReference('System.Core')
clr.AddReference('RhinoInside.Revit')
clr.AddReference('RevitAPI')
clr.AddReference('RevitAPIUI')
import System
import Rhino
from Grasshopper.Kernel import GH_RuntimeMessageLevel as RML
# bring in the node-in-code handle
from Rhino.NodeInCode import Components
import ghpythonlib.components as ghc
# Revit API
from Autodesk.Revit import DB
from RhinoInside.Revit import Revit
def show_warning(msg):
ghenv.Component.AddRuntimeMessage(RML.Warning, msg)
def show_error(msg):
ghenv.Component.AddRuntimeMessage(RML.Error, msg)
def show_remark(msg):
ghenv.Component.AddRuntimeMessage(RML.Remark, msg)
def get_category(category_name):
doc = Revit.ActiveDBDocument
for cat in doc.Settings.Categories:
if cat.Name == category_name:
return cat
walls = get_category("Walls")
comp = Components.FindComponent("RhinoInside_QueryTypes")
if not comp:
a = "error"
else:
a = comp
#b = Components.NodeInCodeFunctions.RhinoInside_QueryTypes(doc, "System", walls)
#ghc.RhinoInsideRevit.QueryTypes(doc, "System", walls)
Runtime error (MissingMemberException): ‘NodeInCodeTable’ object has no attribute ‘RhinoInside_QueryTypes’
Runtime error (MissingMemberException): ‘module’ object has no attribute ‘RhinoInsideRevit’
Gave it a look and having the same problem where RhinoInside components are not available in the list of NodeInCode components to be used, other tools components are showing like Elefront, lunchbox etc… but not ones from RiR… so not sure what’s missing
Hey again,
So I found a way around getting the components to be found which I assume is not the intended solution…
What I did is go inside Revit Addin files and copied the “RhinoInside.Revit.GH.gha” file to the Grasshopper special folders (Components folder)
Now when I reopened Revit and then Rhino i was prompted there were duplicate components that were being loaded and Skipped All, now when I ran the grasshopper NodeInCode list of components the RiR nodes were available for use
So, that’s a temporary solution I assume until maybe someone can tell us the reason / guide us to a better solution.
Hello Mohamed,
I wanted to let you know that your solution was fantastic! I’ve been searching for a fix for quite some time, trying various methods with Revit 2024 and Rhino 8, but nothing worked until now. Your solution worked perfectly. Thank you so much for sharing it.
Best regards,
Tran