Choose your top Archicad wishes!

Read more

Custom 2D Details for Archicad Windows

Vimal Kumar

Note: This article was originally published on AsiaBIM and was written for Archicad 21 mainly for architects working on the Singaporean market.

Some users like to have their own 2D representations created with lines and fills for the default window with a little bit GDL scripting, let us look at how we can achieve that and how to control it with Archicad’s Model View Option (MVO).




Find out more about MVO at

Start with a Default Window

Select a default window object, set the desired settings and place it on a wall…



Edit the Window Object

1., Select the window in the plan view and open it by pressing CTRL/CMD+SHIFT+O.

2., Save as a new window object in the embedded library before start the editing.



Script to Control the 2D Display

This step involves some scripting to switch off the 2D display of selected MVO:

1., Click on the button Master to open the master script.

2., Add the highlighted lines to master script.



Master Script Explanation

!Constants for lsg_2DDetail
MIDDLE2 = 22
MIDDLE1 = 21
SIMPLE2 = 13
SIMPLE1 = 11

Constants that will keep the values assigned to them without change throughout the script. It is easy to use as Constant names in the later part of the code instead of using the values directly. Changing the value will be easier as well.

lsg_2DDetail = 0

success = LIBRARYGLOBAL ("LG_DWSymbSettings.gsm", 
 "iWindowMVODetlevel2D", lsg_2DDetail)

Declare a local variable (lsg_2DDetail) and assign the value 0 to it.

Call the function LIBRARYGLOBAL and pass the MVO object name (LG_DWSymbSettings.gsm – was found from the loaded Archicad library), parameter that holds the MVO’s 2D detail level settings value.
(iWindowMVODetlevel2D – was found from the MVO object) and the local variable declared in the previous step.
success is another local variable that receives the return from the function (if there is any error in the function you can find from the return value). The parameter value of iWindowMVODetlevel2D will be stored in lsg_2DDetail after the functions successful call.

if GLOB_SCRIPT_TYPE <> 2 or (lsg_2DDetail <> SIMPLE2 & 
lsg_2DDetail <> MIDDLE1 & lsg_2DDetail <> DETAILED) then

If the view is not 2D (GLOB_SCRIPT_TYPE <> 2) then the script should proceed to the next step display the default object.
If the view is 2D but the MVO is SIMPLE1 or MIDDLE2 then also the script should proceed to the next step.
If the view is 2D and the MVO option is SIMPLE2 or MIDDLE1 or DETAILED then the script should stop as it will user defined 2D representation.This step is to control the display of the window object’s 2D Symbol

<> means not equal to.

If there is & then both condition must be true to proceed to next step.

If there is or then either one condition is true, then it will proceed to next step.


Close the if – otherwise there will error in the script.

Outline for 2D Representation

1., Open plan view set the MVO to Simple 1 and using lines draw the outline of the window. Select the lines and press CTRL/CMD+C to copy.

2., Switch object window and click on the button next to 2D Symbol.



Sketching 2D Representations

In the 2D Symbol window paste the lines copied in the previous step, use the line tool and fill tool to draw the 2D representation. As it is required to work based on MVO selection draw each representation in separate layers. Ex. Simple 2 in layer 1, Middle 1 in layer 2, Detailed in layer 3 and common elements in layer 4

Hotspots shall be added as well.



Add a Background fill to layer 4. This will cover the wall area where there is window.



Add the lines for Simple 2 2D representation:

1., Window section lines to be in layer 1 that will be displayed when MVO Simple 2 is selected and

2., Wall section lines to be in layer 4 that will be displayed when MVO Simple 2 or Middle 1 or Detailed is selected.



1. Add the window section lines for Middle 1 and Detailed as well (layer 2 and layer 3 respectively) and

2. place them one on top of the other.



Add 2D Script to Call the 2D Representations

Switch to object interface and click on 2D button to open 2D script add the highlighted script.



2D Script Explanation

IF lsg_2DDetail = SIMPLE2 THEN

IF lsg_2DDetail = MIDDLE1 THEN


Conditional statement IF THEN ENDIF is used to check the MVO option.
FRAGMENT2 statement is used to call the layer:

  • if the user select Simple 2 in MVO then display the content of layer 1 and 4
  • if the user select Middle 1 in MVO then display the content of layer 2 and 4
  • if the user select Detailed in MVO then display the content of layer 3 and 4

Save and Use the Object

Save the window object and use it… See you in another blog.

NoteThis need to be done individually for each type of window. Example when there is a change in the width the user need to create a separate window object with a different 2D representation.

Still looking?

Browse more articles

Back to articles

See latest solutions

Accepted solutions

Start a new discussion!