Setting COBie.Component.Space with Dynamo

Hi, a little help, please:
I’m trying to populate the COBie.Component.Space parameter for all components in our model. What’s the easiest/quickest way to do this?
I can set the parameter with “test” in the code block, but I can’t find a way to feed in the Space Name for the element successfully.
In addition, if objects are above the ceiling (bounding), how do we ensure these are picked up as well?
Thanks.

It would be a matter of selecting the category, getting all elements of the category so you pick up every instance. Then you would use something like setparamvaluebyname to set the value for it. If you want to use another parameter to build up the value, use getparamvaluebyname then you can use a code block to join that up with a string or another value so it becomes a single string then feed that into the setparamvaluebyname.

You need to find a location point for each element then get the room containing that point.

https://www.revitapidocs.com/2020/656d34c2-1e53-7278-ab83-fefaff7f40a4.htm

Hi Ian,

Welcome to the community!

I presume you have the Interoperability Toolkit installed? I typically use that for the majority of the COBie tasks.

If you are going to introduce Dynamo, it’s worth baring in mind that you will have to run the graph before every COBie export both in the project and in every linked model.

Alternatively, as Simon suggests, if you activate the room location point for the families, you won’t need to run Dynamo. You can generally pull the room location point down to make sure they hit the room below.

Setting up all your families in this manor could be very onerous if it hasn’t been done already, in which case using Dynamo could be the better option (you could use Dynamo to activate the location points but you won’t get the control to pull the handles down so probably best done manually).

Basically you want to clash the room solid against the family geometry, if it’s a positive you push the room name into the family parameter.

Mostly in a large project there will the odd room where extracting the room solid will fail because of a complexity in the geometry which Dynamo can’t handle.

So, I would build your own room solid. Extract room boundaries, get their end points, prune duplicates, polycurve by points, extrude curve as solid, to the height of the room (you can shoot a ray up to the roof) and clash that against the average point of the family bounding box.

This is going to be a complex graph which will run slowly. So again, I would consider whether doing maintenance to your family library will serve you better in the long run.

Hopefully that helps,

Mark

@Mark.Ackerley @simon_murphy1
I’m using the Interoperability Toolkit and have this mapped for everything else, it’s just this last item that’s proving frustrating, hence using Dynamo. What do you have the toolkit mapped to for the COBie.Component.Space parameter? Being new to Dynamo makes this a steep curve too, apologies if I don’t ‘get it’!

The building is single story so I’ve set the unconnected height above the roof to pick everything up, but I’ve assumed that the ceiling is preventing items in the void being picked up. Perhaps set the architect’s ceiling to non bounding - I don’t like it, but possible bodge?!

Would using GetSpaceAtPoint be appropriate, rather than room, as we have spaces in our model? I’ll have a search on here to find a graph using this. I’ll be honest, I kind of understand what you’re describing, but putting that into a graph is going to be a struggle!

We’re using manufacturer objects, so editing them will be onerous.

Thanks.

Hi Ian,

So the family will only know what room it is in if the room calculation point box is ticked in the family?


Then you can map it from the toolkit…

Hope that helps,

Mark

1 Like

I’ll trial it on some sample items, but I was hoping that Dynamo would give me a work around as we have a lot of families! Although it’ll be slow, if it works it’s probably the best way forward. Thanks for the help.

1 Like

Hi Ian…not sure these nodes from Sparrow could help you here (havent tried at myself) and then use background open family

1 Like

Hi @IanTDE,

An alternative solution to edit the manufacturer families, would be to identify the culprits, and then acquire their location point/curve, and then project this down along the Z-axis for a set distance, so this projected point is in the Room/Space.

2 Likes

Hi Ian,

So, if you try this method…

The fun thing, is that the family will return the room… But if you edit the family, the room calculation point is unchecked!

Also setting the value from 1 to 0 doesn’t then stop the room number updating, even though Dynamo thinks the parameter is now off…!

Still, might be helpful for a 1 off project…

I expect you can background open the family to do this and get more reliable results! Though that has its own risks…

Cheers,

Mark

Really good explanation @Mark.Ackerley that’s why i always use point from Dynamo so much easier to control

1 Like

Thanks for the info all. I’ll look into it on Thursday as I’m on site tomorrow.

I’ve experimented with the room calc points a little. The fans in the ceiling void are now being picked up - which is great! However, various other items such as electrical fixtures, fire alarm devices and even some light fixtures aren’t populating, with or without room calc points.

This might some interest too for elements without room location points.