We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2023-09-16 06:50 PM - last edited on 2024-09-26 01:49 PM by Doreena Deng
I'm attempting to create a quite simple parametric object meant for shower fixtures, in which I choose to show the Shower Head and a variety of Shower Handles.
I used PARAM-O to model it and configure the parameters to show/hide. But I'd like to be able to create Draft and Simplified versions of it, responding to MVO, tinkering with it inside GDL.
Are there global variables meant to 'Request' which is the setting used to object display in MVO which I can simply input to an IF statement?
I don't even intend to create those dropdown menus like this:
I can have it fixed to MVO always, just to be sure my IFC's showing it don't become too heavy.
Thanks in advance!
Solved! Go to Solution.
2023-09-16 08:12 PM - edited 2023-09-16 08:13 PM
Hello @pedrocollares ,
You indeed need to request some values from a default macro library named "LibraryGlobals13" (or your custom one eventually) : the command to do so is LIBRARYGLOBAL() and the parameter in the Globals library is iDetlevelMVO3D. In the MVO library there are many parameters than can be tied to and if you open the "LibraryGlobals13", you will see which one you'll need to get values from.
Here's an example of code to get which LOD in 3D, the MVO is set to :
returnedValue = 0 ! Variable to hold the value returned from the request
returnsSomething = LIBRARYGLOBAL("LibraryGlobals13", "iDetlevelMVO3D", returnedValue) ! Get the value of the iDetlevelMVO3D parameter in the LibraryGlobals lib
if returnsSomething > 0 then
mvoLOD = returnedValue
else
mvoLOD = defaultLOD
endif
Important to note, the values are specific and you will need to use that exact value are input. For LODs, here's the enum in LibraryGlobals13 :
! iDetlevelMVO3D:
DETLEVEL_3D_DETAILED = 3
DETLEVEL_3D_SIMPLE = 4
DETLEVEL_3D_DRAFT = 5
Here's a full example (that you can tweak and optimize obviously, there may be better ways), you will need a parameter named iDetlevel3D for this example. This is just the condition for when your detlevel parameter is set to "by MVO", you would need to finish the script for the remaining choices.
! In master script
DETLEVEL_3D_MVO = 1 ! by MVO choice
DETLEVEL_3D_DETAILED = 3 ! Default value in the MVO library enum
DETLEVEL_3D_SIMPLE = 4 ! Default value in the MVO library enum
DETLEVEL_3D_DRAFT = 5 ! Default value in the MVO library enum
DETLEVEL_3D_OFF = 6 ! No 3D display
! In 3D script
DEFAULT_DETLEVEL_3D = DETLEVEL_3D_DRAFT
DETLEVEL = 0 ! Variable that will hold the detail level for the conditions
if iDetlevel3D = DETLEVEL_3D_MVO then
returnedValue = 0
returnsSomething = LIBRARYGLOBAL("LibraryGlobals13", "iDetlevelMVO3D", returnedValue)
if returnsSomething > 0 then
DETLEVEL = returnedValue
else
DETLEVEL = DEFAULT_DETLEVEL_3D
endif
if DETLEVEL = DETLEVEL_3D_DETAILED then
gosub "DetailedGeometry"
else
if DETLEVEL = DETLEVEL_3D_SIMPLE then
gosub "SimpleGeometry"
else ! DETLEVEL_3D_DRAFT
gosub "DraftGeometry"
endif
endif
endif
2023-09-16 08:12 PM - edited 2023-09-16 08:13 PM
Hello @pedrocollares ,
You indeed need to request some values from a default macro library named "LibraryGlobals13" (or your custom one eventually) : the command to do so is LIBRARYGLOBAL() and the parameter in the Globals library is iDetlevelMVO3D. In the MVO library there are many parameters than can be tied to and if you open the "LibraryGlobals13", you will see which one you'll need to get values from.
Here's an example of code to get which LOD in 3D, the MVO is set to :
returnedValue = 0 ! Variable to hold the value returned from the request
returnsSomething = LIBRARYGLOBAL("LibraryGlobals13", "iDetlevelMVO3D", returnedValue) ! Get the value of the iDetlevelMVO3D parameter in the LibraryGlobals lib
if returnsSomething > 0 then
mvoLOD = returnedValue
else
mvoLOD = defaultLOD
endif
Important to note, the values are specific and you will need to use that exact value are input. For LODs, here's the enum in LibraryGlobals13 :
! iDetlevelMVO3D:
DETLEVEL_3D_DETAILED = 3
DETLEVEL_3D_SIMPLE = 4
DETLEVEL_3D_DRAFT = 5
Here's a full example (that you can tweak and optimize obviously, there may be better ways), you will need a parameter named iDetlevel3D for this example. This is just the condition for when your detlevel parameter is set to "by MVO", you would need to finish the script for the remaining choices.
! In master script
DETLEVEL_3D_MVO = 1 ! by MVO choice
DETLEVEL_3D_DETAILED = 3 ! Default value in the MVO library enum
DETLEVEL_3D_SIMPLE = 4 ! Default value in the MVO library enum
DETLEVEL_3D_DRAFT = 5 ! Default value in the MVO library enum
DETLEVEL_3D_OFF = 6 ! No 3D display
! In 3D script
DEFAULT_DETLEVEL_3D = DETLEVEL_3D_DRAFT
DETLEVEL = 0 ! Variable that will hold the detail level for the conditions
if iDetlevel3D = DETLEVEL_3D_MVO then
returnedValue = 0
returnsSomething = LIBRARYGLOBAL("LibraryGlobals13", "iDetlevelMVO3D", returnedValue)
if returnsSomething > 0 then
DETLEVEL = returnedValue
else
DETLEVEL = DEFAULT_DETLEVEL_3D
endif
if DETLEVEL = DETLEVEL_3D_DETAILED then
gosub "DetailedGeometry"
else
if DETLEVEL = DETLEVEL_3D_SIMPLE then
gosub "SimpleGeometry"
else ! DETLEVEL_3D_DRAFT
gosub "DraftGeometry"
endif
endif
endif
2023-09-16 09:30 PM
@pedrocollares You may find this link helpful... https://gdl.graphisoft.com/tips-and-tricks/model-view-options-in-general
2023-09-19 02:57 PM
Worked just fine 🙂
Thanks a bunch!