Removing null but keep the list sequence same

Do you guys Know how to solve this problem i am trying to remove null but want to keep my list in same sequence or order but every time join with get element parameter by name it show error or null list " i used clean nulls but the sequence go wrong

I think you can set the at level of the Element.GetParameterValueByName node to level 1 or longest lacing. It will return an error for the null lists but get the value for the lists with elements in them. Post your dynamo file and a sample Revit for the forum to test if that doesn’t work out.

1 Like

Thanx jacob for replying me back i am sending you my dynamo script and sample file i also add note in string Problem.dyn (10.9 KB)
sample.rvt (1.5 MB)

@AmrinderWaraich Firstly, always try to avoid having nulls in your list.
In your case, nulls are a result of you trying to obtain curtain panel data from elements that don’t have any.
As obtaining the area of the curtain wall seems to be your objective, you could probably do so directly.


solution-20170729-1.dyn (6.9 KB)

However, if you want to get the sum of the areas of the curtain panels, apply an appropriate filter

1 Like

The problem is afterward actually i want to take area of each curtain panel,. some curtain panel has null value. “element.name” show 8 type of curtain Wall now i want to organised curtain wall list with curtain panel but the list.clean remove null and create new list which not match with “element.name” curtain wall list when i transpose the list with curtain panel list

.

That is because those curtain walls have no curtain panels
Revit/Dynamo does not consider curtain panel infills (doors, in your case) to be curtain panels

1 Like

Thanks for replying
so their is no solution for this?

There is a solution. But you have yet to identify the problem correctly.

The CurtainPanel.ByElement node is not returning all curtain panels hosted to the elements. Case in point element id 2420 doesn’t show in the preview of the CurtainPanelByElement node but is actually hosted by the first element in the list. The “door” panels should not have a null value as indicated in your second screenshot unless you intend to have a door with no transom. I added one of those just to be sure and did a bit of code blocking in order to make something which may work for you.

The graph:

And the code block:

//Ordered list of variables
{CurtainPanels,PanelHosts,walls};



/*Gets all curtain walls which have no panels hosted to them. This is somewhat
irregular and likely means you have a curtain wall which is made up of just
doors, i reccomend reviewing these items individually*/
CurtainWallsWithoutPanels =
	List.LastItem(
		List.FilterByBoolMask(
			walls,
			List.ContainsItem(
				walls<1L>,
				PanelHosts<1L>
			)
		)
	);



//Gets the areas of the panels
PanelAreas =
	CurtainPanels.GetParameterValueByName("Area");



//Adds the curtain walls with no panels to the end of the panel listing
ProperPanelListDepth =
	List.AddItemToEnd(
		"Element "+
		CurtainWallsWithoutPanels.Id+
		" has no curtain panels. Check element for  doors or other oddities",
		CurtainPanels
	);



//Adds the curtain walls with no panels to the end of the hosts listing
ProperKeysListDepth =
	Flatten(
		List.AddItemToEnd(
			CurtainWallsWithoutPanels.Id,
			PanelHosts.Id
		)
	);


//Sorts the panels by the host's Id
SortedPanelsByHostId =
	List.FirstItem(
		List.SortByKey(
			ProperPanelListDepth,
			ProperKeysListDepth
		)
	);



//Adds a 0 for every wall with no hosted panels
ProperAreasListDepth =
	List.AddItemToEnd(
		CurtainWallsWithoutPanels.Id*0,
		PanelAreas
	);


/*Sorts the list of areas by the hosts Id, including 0s for the walls
with no hosted panels*/
SortedAreaList =
	List.FirstItem(
		List.SortByKey(
			ProperAreasListDepth,
			ProperKeysListDepth
		)
	);



/*Gets the total curtain panel area per curtain wall, including 0s for
the walls with no hosted panels*/
AreaPerHost =
	Math.Sum(SortedAreaList);



//Gets the total area of all curtain panels
TotalAreaOfPanels =
	Math.Sum(AreaPerHost);
2 Likes

Thanks @jacob.small thats solve my problem thanks for replying me back and giving me solution.

Taking note of the observation by @jacob.small, here is an alternate approach
solution-20170729-2.dyn (6.3 KB)

1 Like

@Vikram_Subbaiah I looked at that as an option and honestly that’s likely how I would have run with things if it were my own project. But there seemed to be a desire to start with all the walls instead of the curtain panels so things got more… complicated. Was a good exercise in list management if nothing else.

3 Likes