Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of creating walls by Revit

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

Most people do not understand the knowledge points of this article "Revit method to create walls", so the editor summarizes the following contents, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "Revit method to create walls" article.

1.Document doc is already in the template, so I won't say much about it.

2. IList (Curve), we need to prepare the curve of the wall:

IList cu = new List (); / / Line of the wall

Cu.Add (Line.CreateBound (new XYZ (100,20,0), new XYZ (100,20,0)); / / Line

Cu.Add (Line.CreateBound (new XYZ (100,20,0), new XYZ (100,20,10)

Cu.Add (Line.CreateBound (new XYZ (100,20,10), new XYZ (100,20,10))

Cu.Add (Line.CreateBound (new XYZ (100,20,10), new XYZ (100,20,0))

3. The first ElementId here is WalltypeId, which requires an ID of wall type. As long as all the wall types we have built are stored in doc, we just need to select them by category:

FilteredElementCollector fill = new FilteredElementCollector (doc)

Fill.OfClass (typeof (WallType))

ElementId idd = ID of the null;// record wall

Foreach (WallType wa in fill) / / find the type of wall

{

If (wa.FamilyName.Contains ("basic Wall") & & wa.Width*304.8==200) / / find the basic wall and the wall width is 200

{

Idd = wa.Id;// records the type of wall

}

}

4.ElementId, which requires levelId, we already talked about the code as follows:

FilteredElementCollector fil = new FilteredElementCollector (doc)

Fil.OfClass (typeof (Level))

Foreach (Level ll in fil) / / find the elevation

{

If (ll.Name.Contains ("first floor") / / find a level

{

ElementId id = new ElementId (ll.Id.IntegerValue); / / record elevation ID

}

Whether 5.Boolean is a structure, we choose false, just like the previous issue, we do not need to do structural force analysis, so choose no.

Then we string the code together:

FilteredElementCollector fil = new FilteredElementCollector (doc)

Fil.OfClass (typeof (Level))

FilteredElementCollector fill = new FilteredElementCollector (doc)

Fill.OfClass (typeof (WallType))

ElementId idd = ID of the null;// record wall

Foreach (WallType wa in fill) / / find the type of wall

{

If (wa.FamilyName.Contains ("basic Wall") & & wa.Width*304.8==200) / / find the basic wall and the wall width is 200

{

Idd = wa.Id;// records the type of wall

}

}

IList cu = new List (); / / Line of the wall

Cu.Add (Line.CreateBound (new XYZ (100,20,0), new XYZ (100,20,0)); / / Line

Cu.Add (Line.CreateBound (new XYZ (100,20,0), new XYZ (100,20,10)

Cu.Add (Line.CreateBound (new XYZ (100,20,10), new XYZ (100,20,10))

Cu.Add (Line.CreateBound (new XYZ (100,20,10), new XYZ (100,20,0))

Foreach (Level ll in fil) / / find the elevation

{

If (ll.Name.Contains ("first floor") / / find a level

{

ElementId id = new ElementId (ll.Id.IntegerValue); / / record elevation ID

Wall wa = Wall.Create (doc, cu,idd, id, false); / / draw walls

}

}

Run the effect:

You can see that the basic wall 200 is drawn at the first level, and the linetype outline of the wall can be changed at will. Note: if there is an error in the ID of your filter wall, please check whether the conditions of your wall filter meet the requirements of multiple walls. Debugging to find errors is a way to learn rapid progress.

The above is about the content of this article on "how to create walls in Revit". I believe we all have some understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report