Model View Options in general

This post features the Model View Options (MVO) of the Library:

  • where to find it
  • how to use its functions shipped with the GS Library
  • special constrains

MVO in general provides the possibility to save individual views with special combination of display settings.
Some of these settings are coming from ARCHICAD itself, affecting construction elements mostly, but others are coming from special library parts, using a special subtype:
General GDL Object/Documentation Element/Drawing Symbol/Library Global Settings, affecting other library parts only.

Any loaded librarypart saved under this subtype will have the following features/limitations:

  • its scripted UI will become a part of ARCHICAD’s Model View Options settings dialog as an individual panel (600 pixels wide)
  • its current parameter values may differ in each saved view of the Model View Options (opposite any other library part, which can only have exactly one set of stored parameter values within one planfile)
  • its parameter values can be accessed from any other loaded library part via a special “request” called LIBRARYGLOBAL. This query will return the value belonging to the active MVO combination used to display the object
  • no 3D script (comes from subtype ancestry)
  • no migration function

Model View Options settings can be found in the following menu:
Document/Model View/Model View Options…

Currently (in ARCHICAD 20) there are 2 panels belonging to library part settings (see the green markup):
mvo_panels_closed
Their object names and corresponding panel titles:

  • LibraryGlobals13 – Miscellaneous Settings for Library Parts (ARCHICAD Library 20)
  • LG_DWSymbSettings – Floor Plan Detail Level of Door, Window and Skylight Symbols (ARCHICAD Library 20)

Note: additional MVO objects can be part of localized library contents.

The basic mechanics of MVO and Library

Let’s assume the following:

  • an MVO library part is present, with 2 possible values for display option,
  • a library object has 3 display values, one of them relies on the similar parameter of the MVO object ("by MVO").

mvo

In the planfile, 2 view combinations are defined, using the 2 different parameter values of the MVO object.
The library object is placed with 3 instances, each with different display parameter value.
The possible outcomes are the following:
mvocombinations_example

The library object instance will be displayed based on its one and only display setting parameter value. This parameter value is stored within the planfile, and takes affect in all view combinations.
On the other hand, the MVO library part has some special features: its parameters can have different stored values in each view combination, alongside with the “default” value stored within the MVO library part:
mvoconslusion

Accessing existing MVO parameters from objects

In the following example, we will create a simple 2D symbol for Lamps, which will be able to react to the current settings of Miscellaneous Settings for Library Parts (ARCHICAD Library 20)/Lamps and HVAC Floor Plan Symbols.
Note: custom created objects which contain reference to existing, GRAPHISOFT-shipped MVO objects of the official library are currently not eligible to BIMcomponents.com upload (external reference handling check requirements can not be met).
The object has an integer parameter ("iSymbolType2D"), with the following options:

  • Realistic (1)
  • Electrical (2)
  • Reflected Ceiling Plan (3)
  • by MVO (4)

In Master script, inicialize the constant values for the 4 options:

! constant variables for "iSymbolType2D"
PLANSYMB_REALISTIC = 1
PLANSYMB_ELECTRIC = 2
PLANSYMB_RCP = 3
PLANSYMB_BY_MVO = 4

In Parameter script, set up the value list for the "iSymbolType2D" parameter:

values{2} "iSymbolType2D"	PLANSYMB_REALISTIC,	"Realistic",
				PLANSYMB_ELECTRIC,	"Electrical",
				PLANSYMB_RCP,		"Reflected Ceiling Plan",
				PLANSYMB_BY_MVO,	"by MVO"

The 2D script takes care of the rest:

! ----------------------------------------------------------------------
! inicialize attributes
! ----------------------------------------------------------------------
pen gs_cont_pen
fill gs_fill_type
! ----------------------------------------------------------------------
! set default for variable of 2D symbol drawing
! according to Symbol Type parameter
! ----------------------------------------------------------------------
_lampSymbolType = iSymbolType2D

! ----------------------------------------------------------------------
! request MVO values from "LibraryGlobals13" MVO object
! if Symbol Type = "by MVO"
! successful return value will be set for _lampSymbolType
! in case of no success, RCP is the failsafe
! ----------------------------------------------------------------------
if iSymbolType2D = PLANSYMB_BY_MVO then
  _reqLampSymbolType = 0
  _bSuccess = LIBRARYGLOBAL ("LibraryGlobals13", "iLSymbol", _reqLampSymbolType)
  if _bSuccess > 0 then
    _lampSymbolType = _reqLampSymbolType
  else
    _lampSymbolType = PLANSYMB_RCP
  endif
endif

! ----------------------------------------------------------------------
! draw symbols depending on _lampSymbolType variable
! ----------------------------------------------------------------------
if _lampSymbolType = PLANSYMB_REALISTIC then
  gosub "drawCircularPolygon"
endif

if _lampSymbolType = PLANSYMB_RCP then
  gosub "drawCircularPolygon"
  line2     0, A*sqr(2), 0, -(A)*sqr(2)
  line2    -(A)*sqr(2), 0, A*sqr(2), 0
endif

if _lampSymbolType = PLANSYMB_ELECTRIC then
  gosub "drawCircularPolygon"
  line2    -(A/2)*sqr(2), (A/2)*sqr(2), (A/2)*sqr(2), -(A/2)*sqr(2)
  line2    -(A/2)*sqr(2), -(A/2)*sqr(2), (A/2)*sqr(2), (A/2)*sqr(2)
endif

! ======================================================================
end
! ======================================================================

"drawCircularPolygon":
  poly2_b 2, 1+2+64,gs_fill_pen,gs_back_pen,
        0,0,901,
        A/2,360,4001
return

The result looks like this:
mvo_example