Giter Club home page Giter Club logo

Comments (3)

kike-garbo avatar kike-garbo commented on June 8, 2024

In order to fix this I needed to do some changes in Rhino WIP.
A new Release will be available next Tuesday with those changes included.
My plan was to do a sample using a C# Script component that shows how to use it in this repo.
I will tell you when all the pieces are in their place.

from rhino.inside-revit.

alexberd avatar alexberd commented on June 8, 2024

Just checked the new commit and still getting the same error.
Could you please confirm if the following code in a python node in Grasshopper?

import rhinoscriptsyntax as rs
import clr
clr.AddReference('RevitNodes') 
import Revit
clr.AddReference('RevitAPI') 
import Autodesk
from Autodesk.Revit.DB import *
clr.AddReference('RevitAPIUI')
from Autodesk.Revit.DB import * 
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
import System
doc=DocumentManager.Instance.CurrentDBDocument
uiapp= DocumentManager.Instance.CurrentUIApplication
t = Transaction(doc, 'Place an Adaptive Component.')
t.Start()
collector = FilteredElementCollector(doc)
collector.OfCategory(BuiltInCategory.OST_Walls)
t.Commit()
a=collector

That is the error I am getting:

Runtime error (ArgumentNullException): The input argument "document" of function `anonymous-namespace'::Transaction_constructor or one item in the collection is null at line 97 of file d:\ship\2018_px64\source\revit\revitdbapi\gensrc\APIUndoTransactionProxy.cpp.
Parameter name: document

Traceback:
  line 43, in script

from rhino.inside-revit.

kike-garbo avatar kike-garbo commented on June 8, 2024

It should work with the last update to the repo.

image

I modified a bit your script to use RhinoInside to get acces to the active Document.

import clr
clr.AddReference('RhinoInside.Revit') 
from RhinoInside.Revit import Revit, Convert
clr.AddReference('RevitAPI') 
from Autodesk.Revit.DB import *
clr.AddReference('RevitAPIUI')

doc=Revit.ActiveDBDocument
uiapp= Revit.ActiveUIApplication
t = Transaction(doc, 'Place an Adaptive Component.')
t.Start()
collector = FilteredElementCollector(doc)
collector.OfCategory(BuiltInCategory.OST_Walls)
t.Commit()
a=collector

Does it work in your case?

from rhino.inside-revit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.