Hello all,
I am trying to diplay with forms.SelectFromList.show the list of FamilyType Name. (in this instance the doortags) like the following:
listOfTag = DB.FilteredElementCollector(revit.doc)\
.OfCategory(DB.BuiltInCategory.OST_DoorTags)\
.WhereElementIsElementType()\
.ToElements()
selTag = forms.SelectFromList.show(
listOfTag,
multiselect=True,
name_attr = 'ToString',
group_selector_title='Sheet Sets',
button_name='Select Sheets'
)
what I am getting is the object itself. like following
how can I get the that family type name amI Doing something wrong with the FilteredElementCollector?
Has anyone faced something like this?
thank you,
Gian Claudio S.
ToString is a function/method. Not a property.
The syntax would be ToString().
I think you could also use Name
1 Like
@aaronrumple
thank you for your reply…
if I am going to replace it with “Name” I have the following issue
if I am going to the Revit API I can see the following attribute
and I think the name in this case is just a set parameter
I think I have found a solution in this forum:
Hi i’m trying to create area based on the boundaries of rooms from a linked model.
But i’m having trouble converting the room.GetboundariySegments to curves/lines to be able to use them for the are boundray creation.
anybody having any idea?
the problem seems the be that the segments can be in list in list (in list) depending on wheter or not the room has multiple boundarieloops.
# =======================================================================
# IMPORTS
# ===========================…
@AlexanderVDB in this post was parsing the rooms category.
I will post as soon as possible the solution
thank you @aaronrumple @AlexanderVDB
This is the solution:
first, we need to create a class that looks like that:
here an excellent explanation
pyrevit.forms — pyRevit 4.8.12.22247+0031 documentation
class elementListItem(forms.TemplateListItem):
@property
def name(self):
return Element.Name.GetValue(self.item)
thank you can remove it the name_att
and replace the context attribute with that:
listOfTagSelectFromList = [Element.Name.GetValue(tag) for tag in listOfTag ]
selTag = forms.SelectFromList.show(
listOfTagSelectFromList,
multiselect=True,
group_selector_title='Sheet Sets',
button_name='Select Sheets'
)
2 Likes
AlexanderVDB
(Alexander Vandenberghe)
June 27, 2023, 3:44pm
6
correct indeed ;).
pyrevit.forms i an easy, quick and good input way for these kind of selections.
@Gian_Claudio
Altho i also want too remark that i myself try to avoid selection al together by standardising naming or classification.
That way you can filter out elements from the wmodel without any input