Custom 2D Details for ARCHICAD Windows

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).

window2d_08 copy.png

Find out more about MVO at http://helpcenter.graphisoft.com/guides/archicad-18/archicad-18-int-reference-guide/user-interface-reference/dialog-boxes/model-view-options-combinations-panel/

Start with a Default Window

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

window2d_01.png

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.

window2d_02

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.

window2d_03

Master Script Explanation

!Constants for lsg_2DDetail
DETAILED = 31
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 LIBRARYCLOBAL 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.

endif

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.

window2d_04

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.

window2d_05

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

window2d_06

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.

window2d_07

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.

window2d_08

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.

window2d_09

2D Script Explanation

IF lsg_2DDetail = SIMPLE2 THEN
FRAGMENT2 1, 0
FRAGMENT2 4, 0
ENDIF

IF lsg_2DDetail = MIDDLE1 THEN
FRAGMENT2 2, 0
FRAGMENT2 4, 0
ENDIF

IF lsg_2DDetail = DETAILED THEN
FRAGMENT2 3, 0
FRAGMENT2 4, 0
ENDIF

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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s