# 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.

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.

1 Like

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â€¦

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)

1 Like

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.

2 Likes

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
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.