Loading rdflib into Dynamo Revit

Hi,

I am trying to install the ‘rdflib’ into the Dynamo Revit through the default python script node. But, I can see an error message “invalid token - install”. This is the path I used “$ pip install git+https://github.com/RDFLib/rdflib.git@master#egg=rdflib”.

I would like to know if there are any pre-requisites that need to be installed before loading the rdflib, to stop this error.

I am currently using Autodesk Revit 2021.

I would appreciate any of your help.
Thanks.

The repo for that project indicates you will need to use Python 3, so make sure you are in that engine (may require upgrading to a newer Revit build).

Then make sure you are preemptively installing the library to your Python environment (before opening Dynamo) as outlined here: [New Feature Preview] Python 3 Support Issue Thread - #57 by solamour

1 Like

Hi, I have installed the newer Revit version 2022, which has dynamo 2.10. I tried to check my scripts before proceeding to the next step of importing rdflib. But, I am getting a few errors (which is out of the python box).

Here is the error:

I was using the “clockwork’s element. materials+” custom node to retrieve material takeoff details in my older versions of Revit and dynamo, but when I run with dynamo 2.10, the node gives me null results.

Could you please point me the issues if any?

Thanks

Open up the custom node in 2.10, copy the contents onto the clipboard, switch back to the workspace, paste to the canvas, wire in data as needed.

This will surface the issue the node is having.

My guess is that it is related to the units changes in the Revit 2022 API.

Hi,
I tried the way you suggested, I am now getting material names, but not the area and volume.

But, If I close the file and reopen it, I am getting the null data as shown in the previous image.

Any specific reason for this error?

Can you share the warnings which surface when you do the copy paste of the nodes?

There are no explicit warnings that I can see when I run the script.

But, the contents in the custom node has the following errors when I copy-paste in the new workspace.

You need to wire the element which you want to get the material areas from into the ‘turn into a list’ node. That will remove the warning surfaced now, but likely will expose another.

Unfortunately, the dynamo is crashing if I click the “edit custom node option”. Are there any other possible ways to retrieve the material area and volume of selected elements?

Hi, I tried again. Here is the result. The actual area is 86m2.

Make sure you aren’t in automatic, and try editing the node in a brand new graph with nothing wired into it yet.

Yes. It’s working now. But, the problem as you mentioned is with the unit type conversion. If I run the python script, the answer I get is in ft/inches, but the project unit is set to metric.

However, the final result after passing through the “InternalUnit.ToDisplayUnit” node is null.

1 Like

And so now you have the Python node to get the data you need but in the wrong units…. If you had to convert between feet and meters in an email you’d do some math, why not do the same here?

1 Like

Yes, I did that way and converted from square feet to square meters.
Thanks for helping me to resolve the error.

1 Like

It appears that you didn’t follow the instructions for installing the Python 3 package correctly. Follow these very carefully: Customizing Dynamo's Python 3 installation · DynamoDS/Dynamo Wiki · GitHub