Python to select curtain walls in group

Basicly I have a bunch of groups which might have curtain walls as well as other elements. I want to have a list not with ALL the elements in a group but a list with just curtain walls in that group.

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

groups = UnwrapElement(IN[0])
elementlist = list()
test = list()
for item in groups:
	try:
		memberlist = list()
		
		for member in item.GetMemberIds():
			memberlist.append(item.Document.GetElement(member))
			if member.GetType().ToString() == "Autodesk.Revit.DB.WallType":
				test.append(member.GetType().ToString())
				test.append(member.Kind)
		elementlist.append(memberlist)
	except:
		elementlist.append(list())

OUT = elementlist,test

elementlist works fine.
test not …

test is created to see what the result is … if that is like ‘Curtain Wall’ then I want a add a ‘true’ value…
But now the return is ElementId. … I thought wall within a group would return WallType … ?

I see that this is an old post but I came across it whilst looking to do a similar thing. The code below got me what I needed, maybe it will still be relevant for you:

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

groups = UnwrapElement(IN[0])
elementlist, curtainWalls = [], []

for item in groups:
	memberlist = []
	for member in UnwrapElement(item.GetMemberIds()):
		#convert ElementId to Element
		memberEl = item.Document.GetElement(member)
		try:
			#filter by elements' Curtain Grid properties
			if memberEl.CurtainGrid.NumULines:
				memberlist.append(memberEl)
		except:
			elementlist.append(memberEl)
	curtainWalls.append(memberlist)

OUT = curtainWalls, elementlist

Admittedly this is a combination of your code above and the linked forum post https://forum.dynamobim.com/t/how-to-get-curtain-wall-grid-horizontal-and-vertical-grid-count/38374/2?u=eoin_prunty