Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How does Revit create column family types

Shulou Source: shulou.com Published: 2022-05-31 14:22:55 10月30日 Update

This article introduces the knowledge about "How to create column family types in Revit". In the actual case operation process, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!

1.XYZ

Location information is where we want to build this instance. So let's put it at the origin new XYZ(0, 0, 0).

2. FamilySymbol

Family type, what type of family instance do we need to create (we filter to get the column family type we want to create):

FilteredElementCollector faaa = new FilteredElementCollector(doc);

faaa.OfClass(typeof(FamilySymbol));//Collect family types

foreach (FamilySymbol faa in faaa)

{

if(faa.Name.Contains("500 x 500"))//Find columns of type 500*500

{

id = faa.Id;//Store its ID

}

}

FamilySymbol fs = doc.GetElement( id) as FamilySymbol;//Get family type from its ID

3. Level

The elevation is similar to previous issues, so I won't repeat it here.

FilteredElementCollector fil = new FilteredElementCollector(doc);

fil.OfClass(typeof(Level));

foreach (Level ll in fil)//find elevation

{

if (ll.Name.Contains("Level 1"))//Level 1 found

{

le = ll;

}

}

4.StructuralType

This is the structure type, need to focus on, before the template reference did not involve the reference structure type, so do you remember how to reference it?

Just add a reference before the namespace, using Autodesk.Revit.DB.Structure;

So what are the structures? Let's look at it in detail.

NonStructuralNon-Structural Structural BeamStructural Beam BraceStructural Brace ColumnStructural Column FootingStructural Footing Structural Foundations UnknownFraming

Unknown Framing

This defines the purpose of our structural family instance.

Then let's use StructuralType.Column; for structural columns here!

Let's look at the code (remember the reference before the namespace):

FilteredElementCollector fil = new FilteredElementCollector(doc);

fil.OfClass(typeof(Level));

FilteredElementCollector faaa = new FilteredElementCollector(doc);

faaa.OfClass(typeof(FamilySymbol));//Collect family types

Level le = null;

ElementId id = null;

foreach (FamilySymbol faa in faaa)

{

if(faa.Name.Contains("500 x 500"))//Find columns of type 500*500

{

id = faa.Id;//Store its ID

}

}

FamilySymbol fs = doc.GetElement( id) as FamilySymbol;//Get family type from its ID

foreach (Level ll in fil)//find elevation

{

if (ll.Name.Contains("Level 1"))//Level 1 found

{

le = ll;

}

}

FamilyInstance fa = doc.Create.NewFamilyInstance(new XYZ(0, 0, 0), fs, le, StructuralType.Column);

Effect display:

"Revit how to create column family type" content is introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!

Tags: Type structure column level instance content more knowledge space storage utility learning next code location information origin dilemma place foundation Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Shulou Tech Info MySQL OPPO Reno Shulou Technology