Help with a script for mass from area

Hi, I am copying a script i found on youtube for making mass 3D from area. I followed the steps and somehow, there is an error at the end from the node (Parameter.SetParameterByName).

Can someone help me out here to see where I made a mistake? Thanks in advance.
Reference youtube link:

What do your errors say? Can you show the node previews for all your nodes as well?

It looks like you need to convert your Area geometry to a solid.

1 Like

Hi Nick,

Here is the new snapshot with the preview shown.

The warning read" Warning: internal error, please report dereferencing a non pointer"

Area elements don’t have geometry. You need to use the Area Boundaries to create geometry.

how will I go about doing that?

I attempted to extract the boundary into a list of lines. however, i am stuck on how can i create polygon/polycurve to create solid.

im having hard time creating two solids one inside of another sort of like a donut… In revit world… i have 4 boundary line shared by 2 areas. if that makes any sense…

image

I want to update this progress.

I was able to make mass from the instruction I came up. But this is not a perfect… see image below.

Im posting my script for the forum to analyze the file. Mass from Area.dyn (36.1 KB)

I think you’d have to take the difference of the two solids to create an opening.

Try to connect boolean(True) to “ConnectLastToFirst” at “Polycurve.ByPoints” node.

1 Like

@Nick_Boyts,

I dont know how to script to get two solid subtract to create an opening.

I found a workaround in case anyone in the future have the same problem. you split the loops into two seperate areas. this will solve the null from an “island” area. it create the mass correctly and doesnt return any warnings.

hopefully somebody can share their insight on creating a script that have a better script than mine.

Cheers!

1 Like

@rye

Thank you for sharing this topic
I have tried your dyn file with a revit model dummy only containing a few floors and simple areas, but I get some errors in the scrip
Beneath the Springs.DirectShape.ByGeometry it says “Make sure that each geometry object has a unique type name” - have you any idea why that is?

Can you show which “names” you are offering the node? It seems that some of them are identical.

Next question, can you also show a preview of the geometry input, is the list length the same as the key input?
And are you making your polycurves to solids with 0 errors?

I basically just copied the file Rye shared on Jan 8th :slight_smile:
The key input list lenght is also showing 12 items

I was fishing for the input that goes into the “geometry” input of the Springs.DirectShape.ByGeometry" node

As you can read from the Script in the node that the error occurs becouse the length of “geometry” input and “key” input is not the same length:

2 Likes

The Code Block “Name” and “Area” is a parameter you have to create in the revit project associate to the Mass Category. These two are just information that you add on the mass family so you can schedule them.

So I think to get rid of the error, you have to create these two parameter in the revit project first.