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

How Revit creates grids

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

Today, I would like to share with you the relevant knowledge about how to create a grid in Revit. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.

Revit API provides two types of grid creation, one is to create curved grids:

Create (Document, Arc)

The other is to create a straight grid:

Create (Document, Line)

It is rare to create curve grids in the same way as straight lines, so the editor mainly introduces how to create linear grids.

The code for creating a grid is very simple, without saying much, just go straight to the code.

Grid gg = Grid.Create (doc, Line.CreateBound (new XYZ (0,0,0), new XYZ (0,0,0)

Explain in detail what this line of code means:

Grid.Create is to create a grid

The parentheses are overloaded.

Line.CreateBound are the two endpoints that create a straight line

(new XYZ (0, 0, 0), new XYZ (0, 2000, 0)) is the coordinate of the two endpoints

To give a name to the grid, use gg.Name = "A"

Here's a hint of how to draw a whole grid (again, copy the template yourself):

Grid G1 = Grid.Create (doc, Line.CreateBound (new XYZ (100,0,0), new XYZ (100,0,0))

G1.Name = "A"

For (int I = 200; I < 2000; I + = 100)

{

G1 = Grid.Create (doc, Line.CreateBound (new XYZ (I, 0,0), new XYZ (I, 2000, 0)

}

Grid G2 = Grid.Create (doc, Line.CreateBound (new XYZ (0,100,0), new XYZ (2000, 100,0))

G2.Name = "1"

For (int j = 200; j < 2000; j + = 100)

{

G2 = Grid.Create (doc, Line.CreateBound (new XYZ (0, j, 0), new XYZ (2000, j, 0))

}

Here, two loops are used to draw a whole equidistant grid, and the name of the first grid is specified, and the name of the grid will be changed automatically.

Let's take a look at the effect:

These are all the contents of the article "how to create grids in Revit". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more 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