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)
I needed to comment the line "gh.PLUGIN_NAMESPACE.COMPONENTNAME()
" cause it throws an error, âmoduleâ object hast not attribute âPLUGIN_NAMESPACEâ:
Nevertheless I can call the gh.RhinoInside nodes, the problem is that it doesnt generate the walls but it doesnt have any error either, so I dont know anymore what is wrong actually.
Thanks in advance
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