Calculate Area surface

Dear all.
I have a problem as figue below. The surface node, one active, the other is not. Could you help me this issue?

Is the first value in the second list an empty list or a null? If so there are a few posts about bow to get around this elsewhere on the forum.

1 Like

Clean your list for “empty list”. Your problem is that you cant use the OOTB node for cleaning, since it doesnt run recursively. Try the node “DanEDU.List.Clean” in the “DanEDU Dynamo” package, it runs recursively :slight_smile:

1 Like

Hi @erfajo @JacobSmall @Vikram_Subbaiah. I tried it and it runs recursively :). But my expected here is how to Surface area node works. I don’t understand why above node works but under node not work.
My goal is to get the area information of an object and then assign it to the parameter’s share. So, I want to keep list structure.
Sorry my english.

@D.JohnWick you have a few options then:

  1. Replace the Empty lists with an object the function runs on and then remove that value.
  2. Use a code block to force the order of operations to return the correct value.
  3. Use an If statement to perform functions based on a result.

Option 1 and 2 are described here.

I really like the second option which @Aaron_Wagner gives in post #2 of that thread.

when i extract other model then it works. There is something wrong here that I do not understand

Hi @JacobSmall I understood my problem. As you speak above “Is the first value in the second list an empty list or a null?”

@JacobSmall Do you help me to creat a code block for my case? I really did not master it.

I use ReplaceEmpty node to remove Empty and replace ones = 0, but surface area node is also error.

You need to replace it with something that has an area. :wink:

Remove anything there isnt a surface, why replace? As I understand it, you only want areas! If that is the case, then remove anything else.

@erfajo I intersect two geometry to get area intersect surface, then set area value to geometry is intersected by share parameter. If i remove all empty list then list structure change, so, i can set to element correspond.

Thank you for your idea :slight_smile: It has some inconvenience

Might be able to just add a single surface to the front and then remove that after getting the area too…

1 Like

What about replacing with a dummy area? …and then replace the dummy value to 0 afterwords?

Thank you for your idea. it also not working

I am sure your problem stems from data you feed with “empty lists” and inappropriate data where you try to get areas. Walk through you data and check them minutely.

I think this could solve your problem…
HDPackage_Tinh-Van-Khuon-Dam_2.dyn (47.6 KB)

1 Like

There is actually a bette way to feed your data… try this
The idea is to flatten your input to the needed data structure further on, by using flatten you get rid of empty lists. The main idea is still the same, namely getting rid of nulling values.

HDPackage_Tinh-Van-Khuon-Dam_3.dyn (41.9 KB)

1 Like

Hi @erfajo I tried this solution and result in a image below.