Heightmap in ARCHICAD

Heightmap in ARCHICAD

Greetings !

In this article, we experiment with the ARCHICAD + Grasshopper + GDL link. We will look at this connection in the example of transformation of ARCHICAD mesh into a gradient map of heights. Before you start, we'll now talk about what the map of heights is and what it is useful for.

A map of heights is a man-made relief model that uses "pseudo-colors" to represent elevation as a color. The "vertical exaggeration" is used to make the difference in height more visible.

You can use a map of heights for presentations, as well as plans for a pronounced relief image.

Fig. 1

To begin, we will create a file in ARCHICAD and build our mesh. For example purposes, the mesh was divided into 2 parts, for better visual presentation of changes.

Fig. 2

Now we need the Grasshopper-ARCHICAD Live Connection V2.0 component, download it at Graphisoft's website for free. The next step is activating Live Connection V2.0 (In ARCHICAD, open File-Interaction-Grasshopper connection).

Then open the Rhinoceros and launch Grasshopper in it, then press Start Connection in ARCHICAD. After that, in Grasshopper we create a mesh component to which we assign the mesh from ARCHICAD.

Fig. 3

The next step is to build the algorithm in Grasshopper. First, we break the mesh to get Grasshopper's native components to work with them. Next we rebuild from the points of the ARCHICAD mesh a Delone mesh, we break it into faces. In order to exclude the possibility of translation of incorrect geometry into ARCHICAD, we check that all of them are correct, and exclude all incorrect from the array. We obtain face boundary line, get it's edges and then work with them individually.

Fig. 4

For further export to ARCHICAD, we need an object in which we will place the data from Grashopper and the data that we place into it. These data are x, y, z coordinates of the three vertices of the triangle and r, g, b of the color data. Several GHPython components were used to conveniently filter the data inside Grasshopper, without which the script would be slower and more cumbersome.

Fig. 5

You must select GHPython, open the node by double-clicking on it, rewrite the data as pictured above.

#Sorting coordinate points and prepearing for ARCHICAD
xx, yy, zz = point.split(“,”)

X = round(((float(xx))/1000),2)
Y = round(((float(yy))/1000),2)
Z = round(((float(zz))/1000),2)


#rgb is input string, looksd like Color [A=255, R=198, G=216, B=198]
color, red, green, blue = rgb.split(“,”) 

R = red[3:]
G = green[3:]
B = blue[3:-1]

It is also necessary to change the type of input data to string and the names of the variables on the input and output must be strictly consistent.

Fig. 6

Now we need to write an object for ARCHICAD because only through the object we can manipulate these data, in addition to the relatively high performance within the ARCHICAD objects, therefore, their use is always a priority.

Fig. 7

To control the parameters of an object in Grasshopper, we need to add a parameter of the boolean type with the variable ParamcontrolByGrasshopper and set its value to YES. More about the connection with Grasshopper can be found in the Grasshopper-ARCHICAD Live Connection 2.X User Guide (contained within the ARCHICAD directory documentation).

For the very logic of the object, it was decided to create a separate instance of the object for each face in order to be able to control its color. In a 3D script, we create our color using the DEFINE MATERIAL command (more about GDL can be read in the GDL Reference Guide (contained within the ARCHICAD Documentation Documentation folder)), we use the pre-configured type matte which corresponds to figure 2, the color values are specified in the range [0.0 ... 1.0] therefore we divide our variables into which the values from Grasshopper will be written to 255. Next, we assign the newly created material to our object. For the most accurate mimicry of the ARCHICAD mesh object was selected CSLAB_ because of the constant verticality of its faces, the ability to define a separate material for the faces and the ability to control the image of the individual faces and sides. To make the bottom horizontal, the CUTPLANE ... CUTEND command was used. Hot spots have been added in all corners for convenience in the ARCHICAD window.

!3D script

hh = MAX(z1, z2, z3)

pen pnn

DEFINE MATERIAL “rgb” 2, rr/255, gg/255, bb/255

MATERIAL rgb

j1=1 !: lower horizontal edge
j2=1 !: vertical edge
j3=0 !: upper horizontal edge
j4=1 !: side face

s=j1+2*j2+4*j3+8*j4

CUTPLANE 1, 1, 0, 1

CSLAB_ rgb, sidemat, sidemat,
3, -hh,
x1, y1, z1, s,
x2, y2, z2, s,
x3, y3, z3, s

CUTEND

HOTSPOT x1, y1, z1
HOTSPOT x2, y2, z2
HOTSPOT x3, y3, z3

HOTSPOT x1, y1, 0
HOTSPOT x2, y2, 0
HOTSPOT x3, y3, 0

!2D script

PROJECT2{3} 3, 270, 2, 16+8+4+2

The data type for the coordinate values must be selected as a float, and for color values as an integer.

To inject data from Grasshopper into an object, you must use the object settings node to select the Use existing Library Part option, then select an element using the select ARCHICAD Library Part and select the values to be monitored.

Fig. 8

Next, we connect the node of the parameters of the object to the object node, you must also set the starting point node, it can be 0, 0,0. It is also recommended to connect the boolean toggle node to the synchronization parameter, so it will be possible to manually enable the sending of data to ARCHICAD, which will simplify the work with a large amount of data.

Here's an example of a customized Grasshopper algorithm associated with an GDL object.

Fig. 9

When activating the Object node synchronization in Grasshopper, data for creating objects will be transferred to ARCHICAD, this may take some time with a large number of objects, you need to be patient. After completing the calculations, we will get the desired result - a color map of heights in ARCHICAD, which can be used after the closure of Rhinoceros + Grashhopper.

By default, objects from Grasshopper come blocked, so that they can be edited within ARCHICAD, they need to be unlocked.

Fig. 10

Grasshopper and GDL offer enormous opportunities in ARCHICAD. The most effective way to use Grasshopper is to split into elements / obtain data, and to import the elements themselves into ARCHICAD as objects. This approach greatly improves performance.

The principles outlined in this material can be used to transfer any complex forms from Grasshopper to ARCHICAD, as well as to color these forms within ARCHICAD without the need to create a large number of color materials in the usual cover editor.

Got all of the logic working completely inside Archicad, without grasshopper.

  • 该图片无替代文字
Mahmoud Amine Abdallah

Reality capture spécialiste chez Geosystems Tunisia

5 å¹´

Nice work

赞
回复
Philip Read

Over 25 years UK experience | Director at RIBA Chartered Architects Practice | Corporate clients across the world.

5 å¹´

Something to keep an eye on!

赞
回复

la précisons? !

赞
回复

要查看或添加评论,请登录

Pavlo Menshykh的更多文章

  • Procedural terrain for BIM

    Procedural terrain for BIM

    Greetings! In this article, we explore BIM optimized procedural terrain generation, not in one but in 3 CAD software…

    5 条评论
  • Particle system animation for BIM

    Particle system animation for BIM

    Greetings! In this article, we explore BIM optimized particle systems to replicate the phenomena of snow and rain. We…

    14 条评论
  • Procedural vegetation for BIM

    Procedural vegetation for BIM

    Greetings ! In this article we explore BIM optimized procedural vegetation generation. We will be using Archicad as BIM…

    22 条评论

社区洞察

其他会员也浏览了