cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations

GDL
About building parametric objects with GDL.
SOLVED!

Have my GDL object respond to the MVO's Object detail setting

pedrocollares
Enthusiast

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.

 

pedrocollares_0-1694882628334.png

 

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:

 

pedrocollares_1-1694882845859.png

 

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!

 

Architect / BIM Manager at IDEIA1 - www.ideia1.com.br
Archicad 27 / Windows 11 64
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
MF BIM
Booster

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

 

https://mfbim.fr | https://youtube.com/@mfbim
AC24 FRA 7600 - AC26 FRA 4027 | MacBook M1 Pro

View solution in original post

3 REPLIES 3
Solution
MF BIM
Booster

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

 

https://mfbim.fr | https://youtube.com/@mfbim
AC24 FRA 7600 - AC26 FRA 4027 | MacBook M1 Pro
DGSketcher
Legend

@pedrocollares You may find this link helpful... https://gdl.graphisoft.com/tips-and-tricks/model-view-options-in-general

 

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)

Worked just fine 🙂

 

pedrocollares_0-1695128173744.png

 

Thanks a bunch!

 

Architect / BIM Manager at IDEIA1 - www.ideia1.com.br
Archicad 27 / Windows 11 64

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!