Creating BIM objects from Python

Thanks @izzylys!

It was indeed helpful to have a look at the docs for some more background information on the SpeckleSchema.

Regarding your second point, I agree that receiving items, possibly changing them, and sending back would not be problematic. I tried and this will indeed not cause any issues. My initial problems were mainly with creating an object in Python from scratch, and get that to be recognized properly by the other connectors.

I now updated my Python classes slightly, which makes it possible to send a RevitBeam object from Python and receive it in Grasshopper as such (see ‘Receive’ GH node below). However, it does not have the SpeckleSchema attribute that it has when creating a RevitBeam object in Grasshopper directly, which is shown by the ‘ESO’ nodes.

That does make sense of course. However, it does seem that the original Python object cannot be received properly by Revit, as this gives an error current Unit System is unsupported. I believe my RevitBeam object does contain all necessary attributes and I already changed the units to mm, which gives the same error.

image

So then the rephrased question is: Is it possible to create BIM objects from Python and would that require to add a SpeckleSchema attribute in Python also? Or am I just missing something in the setup of my objects? I added you to my stream on speckle.xyz so you can have a look. The BIM branch contains the latest RevitBeam object created from Python.

Best,
Rob

1 Like