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.
@D.JohnWick
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
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:
- Replace the Empty lists with an object the function runs on and then remove that value.
- Use a code block to force the order of operations to return the correct value.
- 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?”
You need to replace it with something that has an area.
@D.JohnWick
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 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…
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)
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)