GDL
About building parametric objects with GDL.

Position (exterior/interior) in GDL

Mathias Jonathan
Advocate

Hello everyone!
I'm working on a mark for a door that behaves differently if the door is inside or outside.

 

I've seen that you can display the parameter interior/exterior in a label, but when opening the GDL of the label, the corresponding macro is too complicated for me as it displays all the properties, so I can't get this one piece of information.

 

How can I retrieve the interior/exterior information simply in GDL?

Thanks a lot!

1 ACCEPTED SOLUTION
9 REPLIES 9
Barry Kelly
Moderator

There really is no interior/exterior.

It is all a bit of a trick, so long as you place your windows and doors consistently with the reveal on the 'outside' of the wall, and then the second click to place the door/window selects the swing/opening direction - you click either out side (the same as the reveal side - WIDO_REVEAL_SIDE value will = 0), or the inside (opposite side to the reveal side - WIDO_REVEAL_SIDE value will = 1)

 

Then it is a case of checking the value of the Global parameter ... WIDO_REVEAL_SIDE in your script.

 

BarryKelly_0-1686555815772.png

 

Barry.

 

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Mathias Jonathan
Advocate

Thanks Barry,

 

I wasn't talking about the interior/exterior face of the door, but the parameter that you manually check and that is exported in IFC (Position Category for Ifc).

 


@Mathias Jonathan wrote:

I wasn't talking about the interior/exterior face of the door, but the parameter that you manually check and that is exported in IFC (Position Category for Ifc).


Ah, you mean this setting.

 

BarryKelly_0-1686558428434.png

 

It is not an actual object parameter.

I think you have to get that with a REQUEST in GDL.

 

What label is it you were using?

I might be able to help track it down for you.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

Yes, it's this one!

I found the info in the label " Classification and Property Label"

 

Capture d’écran 2023-06-12 à 11.35.01.png

 

But when I open the object, it refers to the macro:

call "PropertyParamRequest_m"

 

 

Which is a macro that calls alls parameters, so it is difficult for me to find this specific info.

 

Thanks!

Solution

It is a REQUEST.

The position is a Core Property.

I found out is is a Core Property called ... Main.Position

 

You can use this REQUEST to get is value ...

 

n = REQUEST ("Property_Value_Of_Parent", "Main.Position", type, dim1, dim2, propertyValues)

print propertyValues

 

propertyValues will contain the value you want.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

It works well, thank you!

I want to use this request in order to have different representation of the door marker when the door is inside or outside the building

 

I have an error message when saving the GDL object, but It works.

 

Here is what i wrote:

In Master Script:

n = REQUEST ("Property_Value_Of_Parent", "Main.Position", type, dim1, dim2, propertyValues)

In Master Script:

IF propertyValues= "Extérieur" THEN
TEXT2 0,0,"It works"
ENDIF

 

How can I avoid this error message?

 

Thanks

Did you forget to attach the error message?

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 

Capture d’écran 2023-06-13 à 11.15.54.png

 

It says " The 2D script has errors. In the project, the library part will be shown with its 2D symbol"

Yves
Advocate

Hi Mathias,

To avoid the error message you can do this
Part of script taken from this example on GDL Center

https://gdl.graphisoft.com/tips-and-tricks/display-properties-with-labels
I removed the gosub which is not needed with a string

 

_valueToConvert = ""
_valueString = "Value: "
dim _propertyValues[][]
_dim1 = 0
_dim2 = 0
_stringPropValue = ""

n = REQUEST ("Property_Value_Of_Parent", "Main.Position" , _type, _dim1, _dim2, _propertyValues)

if n then
	! change zeros to ones - it is easier to handle all possible arrays in a double loop
	if _dim1  = 0 then _dim1 = 1	
	if _dim2  = 0 then _dim2 = 1

	for i = 1 to _dim1
		for j = 1 to _dim2
			if (i + j) > 2 then _valueString = _valueString + "; "

			if _type = 4 then		! Type is string - no conversion needed
				_stringPropValue = _propertyValues[j][i]
			else	! bool, real, integer types - conversion needed to string
				_valueToConvert = _propertyValues[j][i]
!!!				gosub "convertToString"
			endif
			_valueString =  _stringPropValue
		next j
	next i
endif


if _stringPropValue = "Extérieur" THEN
TEXT2 0,0,"It works"
endif

 

Yves Houssier
Belgium
Archicad 19 -> 24
iMac - Mac Os 10,13

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!