GDL
About building parametric objects with GDL.
SOLVED!

Drawindex for Macros

NWA
Contributor

Hi all,

 

i am trying to understand the use of macros as a part of an object. In this specific case I want to use a tap object for several other objects (shower, bath and sink). I think I managed to understand the 'call' command and how to modify/use parameters of the macro.

One thing that I was not able get to work, is to understand how to place the macro object above the rest of the 2D elements. Right now the hatch of e.g. the shower covers the tap.
I understand that normally the drawing order is managed by the command 'drawindex' and I tried to use the same concept for the macro. I defined the drawindex before the 'call' command and also in the 2D script inside the macro itself.

What am I missing?

 

Thanks

ArchiCAD 26.5002
Windows 10 Professional
1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Seems fine.

The tap comes in on top for me when I set the scale to 1:50 or less.

 

BarryKelly_0-1688462714428.png

 

In my template the tap comes in with a brick fill (that is just because of my template attributes not matching yours), but it seems to not have a solid background.

So the problem may be that you tap just needs a sold white background like the main object.

 

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

View solution in original post

6 REPLIES 6
Barry Kelly
Moderator

Drawindex should work but you need to set it back to a lower value after the call.

You shouldn't need to add it to the macros - I don't think it will do much in there except within the macro itself.

 

Also the order in which you script can have an effect.

I think it draws the 2D view in the order you script, so call the taps last maybe.

 

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
NWA
Contributor

That didn't work.. The tab still sits behind the other components..

Any other ideas? 😕

if GLOB_SCALE <= 50 then
	
	hotspot2  0,	cy, hsid, cx, 1+128		:	hsid=hsid+1 !Base
	hotspot2  cx, 	cy, hsid, cx, 2			:	hsid=hsid+1 !Move
	hotspot2 -1, 	cy, hsid, cx, 3			:	hsid=hsid+1 !Vector
	
	hotspot2 cx,  0, hsid, cy, 1+128		:	hsid=hsid+1 !Base
	hotspot2 cx,  cy, hsid, cy, 2			:	hsid=hsid+1 !Move
	hotspot2 cx, -1, hsid, cy, 3			:	hsid=hsid+1 !Vector
		add2 cx-eps, cy-0.043

	if cx < eps then
		del 1		
		rot2 -90
		add2 -(cy+eps), cx-0.043
	endif
	
	if cx = eps then add2 -eps, 0

drawindex 50
call "Amatur" parameters 	macroParam1 = 0.27,
				macroParam2 = 0.208

drawindex 10
del top
endif

 

ArchiCAD 26.5002
Windows 10 Professional

Hi team.

Banking on Barry's order :

 

!2d script

DRAWindex 1
!shower
!bath 
!sink

DRawindex 50 (or any number higher than 1)
If GLOB_scale.... THEN
hotspot2 ...
CALL macro...
ENDIF

! caller object 2d script

 

 

Apple M1 Pro CPU
RAM 32 GB
1 TB OS: Ventura 13.1
NWA
Contributor

Thank you botch a lot for getting back to me.

Unfortunately there still seems to a problem with the 2D script. Attatched you will find the current state of my object. 

Perhaps one of you could help me with solving this issue..

 

"Duschwanne_nwa" is the main object and "Amatur" is the tap macro.

Sorry the parameters are in German. 

 

Any suggestion is much appreciated.

Many thanks!

 

ArchiCAD 26.5002
Windows 10 Professional
Solution

Seems fine.

The tap comes in on top for me when I set the scale to 1:50 or less.

 

BarryKelly_0-1688462714428.png

 

In my template the tap comes in with a brick fill (that is just because of my template attributes not matching yours), but it seems to not have a solid background.

So the problem may be that you tap just needs a sold white background like the main object.

 

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
NWA
Contributor

Thank you so much Barry. 

I totally mistook the grey filling in my tap macro for a solid filling and didn't even think about it being semi transparent. 😑

 

Have a great day!

ArchiCAD 26.5002
Windows 10 Professional