Hi! Are you just getting started with pyRevit? I ask because I haven’t seen it be referenced in a Dynamo script before. Though maybe that’s in the works?
2024-06-12 20:38:23,107 INFO [pyrevit.loader.sessioninfo] pyRevit version: 4.8.13.23182+2215 - </> with :growing_heart: in ['pdx', 'hio', 'rno', 'sea']
2024-06-12 20:38:23,596 INFO [pyrevit.loader.sessioninfo] pyRevit Rocket Mode enabled. :rocket:
2024-06-12 20:38:23,618 INFO [pyrevit.loader.sessioninfo] Host is Autodesk Revit 2022.1.5 build: 20230915_1530(x64) pid: 9052
2024-06-12 20:38:23,621 INFO [pyrevit.loader.sessioninfo] Running on: 2.7.7 (IronPython 2.7.7 (2.7.7.0) on .NET 4.0.30319.42000 (64-bit))
2024-06-12 20:38:23,627 INFO [pyrevit.loader.sessioninfo] User is: mrosendal
2024-06-12 20:38:23,630 INFO [pyrevit.loader.sessioninfo] Home Directory is: C:\Users\Martin\AppData\Roaming\pyRevit-Master
2024-06-12 20:38:23,632 INFO [pyrevit.loader.sessioninfo] Session uuid is: 22933cf4-c652-476d-b763-229ab4e8f478
2024-06-12 20:38:23,637 INFO [pyrevit.loader.sessioninfo] Runtime assembly is: pyRevit_2022_336044d12ce5e5e0_PyRevitLabs.PyRevit.Runtime
2024-06-12 20:38:23,668 INFO [pyrevit.loader.sessioninfo] Config file is (User): C:\Users\Martin\AppData\Roaming\pyRevit\pyRevit_config.ini
2024-06-12 20:38:25,255 INFO [pyrevit.loader.sessionmgr] Extension assembly created: JVZ_tools
2024-06-12 20:38:25,307 INFO [pyrevit.loader.sessionmgr] Extension assembly created: pyRevitCore
2024-06-12 20:38:25,579 INFO [pyrevit.loader.sessionmgr] Extension assembly created: pyRevitTools
2024-06-12 20:38:25,606 INFO [pyrevit.loader.sessionmgr] Running startup tasks for pyRevitCore
2024-06-12 20:38:31,719 INFO [pyrevit.loader.sessionmgr] UI created for extension: JVZ_tools
2024-06-12 20:38:33,790 INFO [pyrevit.loader.sessionmgr] UI created for extension: pyRevitCore
2024-06-12 20:38:36,062 INFO [pyrevit.loader.sessionmgr] UI created for extension: pyRevitTools
2024-06-12 20:38:36,393 INFO [pyrevit.loader.sessionmgr] Load time: 13.3149719238 seconds :thumbs_up:
Sorry, I should have been more clear. I don’t think pyRevit runs in Dynamo. Please read the “getting started” info in the second link I posted. Also, try searching “getting started with pyRevit” on YouTube and then follow along with a tutorial.
you can’t do that.
pyrevit modules are not compatible or designed to be used in dynamo.
The way you could expect to make it work is the following, but it won’t work.
import sys
sys.path.append(r'C:\pyRevit\_pi\pyRevit\pyrevitlib')
from pyrevit import revit
doc = revit.doc
As mentioned by @scartmell the two beasts: Dynamo and pyRevit, live in paralell universes
If you want to try a dynamo python script with references to dynamo libraries → Dynamo
if /// … pyrevit libraries → pyRevit
If you want to create buttons for testing purposes, I suggest you activate the Bundle Creator Extension, follow the instructions of the button, then al+click to locate the script of the new button and try your code from there.