BuiltInCategory of Doors and curtain wall doors

BuiltInCategory of Doors and curtain wall doors

desdinova
Advocate Advocate
4,500 Views
17 Replies
Message 1 of 18

BuiltInCategory of Doors and curtain wall doors

desdinova
Advocate
Advocate

Hi friends,

I want to built a plugin that changes the curtain wall panel types

when I try to select curtain wall door how can I filter only panel doors for curtain wall

Is there any specific value for curtain panel door?

Thanks in advance....

2019-09-02_22-41-57.png2019-09-02_22-42-51.png

0 Likes
Accepted solutions (1)
4,501 Views
17 Replies
Replies (17)
Message 2 of 18

jeremytammik
Autodesk
Autodesk

As you show in your screen snapshots, the category os the same for all doors, so that cannot be used to tell them apart.

 

Another possible criteria could be to query the door for its host using its `Host` property:

 

https://www.revitapidocs.com/2020/69f30141-bd3b-8bdd-7a63-6353d4d495f9.htm

 

Using the host element properties, you ought to be able to differentiate curtain walls from others.

  



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 18

desdinova
Advocate
Advocate

Hi Jeremy,

Thanks for reply

I think Host property returns value when the door is placed on the wall.

When i collect familysymbols in door category is it possible to differentiate doors and curtain panel doors?

Thanks again.

 

0 Likes
Message 4 of 18

jeremytammik
Autodesk
Autodesk

Oh yes, in that case, of course, the Host property will not be set.

 

I am sure you can tell them apart somehow. I cannot tell you how. You might be able to tell by their geometry, parameters, family definition name, dimensions, or other criteria unknown and inaccessible to me.

 

It is up to your imagination to research and find out...

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 5 of 18

desdinova
Advocate
Advocate

Thanks Jeremy,

I think I need to study on parameters or create a parameter for curtain wall doors

thanks again.

0 Likes
Message 6 of 18

BenoitE&A
Collaborator
Collaborator

Hi,

I would not do that, I would rather use Jeremy's hint : find the host and check if it is a Curtain Wall. The parameter for Curtain Walls is: myWall.CurtainGrid which is not null if your wall is a Curtain Wall.

So it is easy to search for such a door : 

FamilyInstance door = null;
if((door.Host as Wall).CurtainGrid!=null)
             // That's my door

Benoit FAVRE
CEO of etudes & automates
www.etudesetautomates.com/
Message 7 of 18

desdinova
Advocate
Advocate

Hi Benoit,

Thanks for reply,

Host property is usable when the door is hosted on wall.

But I need to differentiate doors and curtain wall doors in familysymbol level.

Thanks again.

0 Likes
Message 8 of 18

FAIR59
Advisor
Advisor
Accepted solution

From the FamilySymbol you can find similar types using FamilySymbol.GetSimilarTypes().

This gives you all curtainwall-panels, that can be placed in a curtain wall. Filter the list for the door-category.

FamilySymbol symbol = inst.Symbol;
            
IEnumerable<FamilySymbol> CW_doors = new FilteredElementCollector(doc, symbol.GetSimilarTypes())
            	.OfCategory(BuiltInCategory.OST_Doors)
            	.Cast<FamilySymbol>();
Message 9 of 18

Revitalizer
Advisor
Advisor

Hi,

 

there is a Family.IsCurtainFamily property.

So you could check:

 

FamilyInstance.Symbol.Family.IsCurtainFamily 

 

Revitalizer

 




Rudolf Honke
Software Developer
Mensch und Maschine





Message 10 of 18

desdinova
Advocate
Advocate

Thanks Fair59

It works...

 

0 Likes
Message 11 of 18

desdinova
Advocate
Advocate

Hi Revitalizer,

Thanks for reply.

But IsCurtainFamily property always returns false.

How can İ solve

I attach the code and rvt file.

Thanks again..

 


FamilyInstance familyInstance = doc.GetElement(uidoc.Selection.PickObject(ObjectType.Element)) as FamilyInstance; FamilySymbol symbol = familyInstance.Symbol; if(symbol.Family.IsCurtainPanelFamily) { TaskDialog.Show("Revit", "true"); } else { TaskDialog.Show("Revit", "false"); }
Message 12 of 18

Revitalizer
Advisor
Advisor

Hi,

 

yes, I can see that in the file.

 

Sorry for confusion.

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 13 of 18

rhanzlick
Advocate
Advocate

This topic, appears at least partly resolved, but I would use the Kind property of the host's WallType. Given a list of all doors in project, I would filter using a lambda expression:

 

doorList.Where(door=>door.Host != null && door.Host is Wall).Where(door=>(door.Host as Wall).WallType.Kind == WallKind.Curtain).ToList();

 

Hope this works for you.

Message 14 of 18

2550798990
Explorer
Explorer
By parameter: “FamilyPlacementType”
if (_familySymbol.Family.FamilyPlacementType == FamilyPlacementType.OneLevelBased)//OneLevelBased 幕墙门窗
{

}
else if (_familySymbol.Family.FamilyPlacementType == FamilyPlacementType.OneLevelBasedHosted)//OneLevelBasedHosted 普通门窗
{

}
Message 15 of 18

Sean_Page
Collaborator
Collaborator

This is how I usually determine it, but again that is after it is hosted.

Sean Page, AIA, NCARB, LEED AP
Senionr Partner, Computational Designer, Architect
0 Likes
Message 16 of 18

rhanzlick
Advocate
Advocate

Upon reading this again, I think my previous answer did not correctly interpret what the OP was asking. From what I can tell, your best bet will likely be to access the "Host" parameter (BuiltInParameter.FAMILY_HOSTING_BEHAVIOR):

 

door.Symbol.Family.Parameters("Host").AsValueString()

 

This string should be empty for door families based on curtain panel template, and will be "Wall" for other standard door types. Have not tested this extensively, but so far it looks like it works well as an a priori filter for any family.

Message 17 of 18

dbrokaw44TRW
Contributor
Contributor

If you were hell-bent on not using, IsCurtainPanelFamily Property, with parameters, you may be able to determine it with the following:

 Parameter wallClosureParam = door.LookupParameter("Wall Closure");
get_Parameter(BuiltInParameter) ; enum TYPE_WALL_CLOSURE
get_Parameter(BuiltInParameter) ; enum DATUM_PLANE_DEFINES_WALL_CLOSURE


Left is Door, Right is Curtain Door Family template .rtf. 

dbrokaw44TRW_0-1712860609077.png
Maybe....?

0 Likes
Message 18 of 18

sensiblehira
Advocate
Advocate

Revit lookup is giving the value as false for all curtain panel families. It would have been helpful if the value was assigned to it.

0 Likes