The Global Archicad Community

Stay informed. Get help. Share your knowledge.

Everything about using Libraries and Library Parts - Doors/Windows/Objects/Stairs etc. (Example: How can I display a Transom above my Door?)

Moderators: Karl Ottenstein, LaszloNagy, ejrolon, Barry Kelly, gkmethy, Gergely Feher

By JGoode
#306948
Hello,

I'm trying to add a picture in 2D but it defaults to be behind my fill - I have tried using DRAWINDEX but that doesn't seem to work either. Is there just no way of bringing a picture in front of a fill?

Here's my code for reference:
Code: Select all
DRAWINDEX 10

add2 symb_pos_x, symb_pos_y
ROT2 symb_rot
if dis_symbol then
	if (type = t1) then ! Outlet
		if (sign_type = st1) then !dry
			picture2 "dry_riser_outlet", symb_height, symb_height, 1
		else
			picture2 "wet_riser_outlet", symb_height, symb_height, 1
		endif
	else
		if (sign_type = st1) then !dry
			picture2 "dry_riser_inlet", symb_height, symb_height, 1
		else
			picture2 "wet_riser_inlet", symb_height, symb_height, 1
		endif
	endif
endif

DEL 2

DRAWINDEX 30

pen gs_fill_pen
project2{3} 3, 270, 3 + 32, 4, gs_back_pen  ! adds fill

pen gs_cont_pen
project2 3, 270, 2 !adds outline
#306955
I can’t test your script at the moment, but just looking at it you need DRAWINDEX 30 for the picture then DRAWINDEX 10 for the fill.

Or try scripting the fill first and then the picture (I am not sure if that will change anything but try anyway).

Barry.
User avatar
By Barry Kelly
#306956
And looking at the script again you are not adding a fill.
You are using PROJECT2, so maybe that is the problem and it can’t go behind - I have never tested this.

Barry.
By JGoode
#306957
Thanks for your help Barry, I must have misread the gdl guidance.

Just to confirm - it doesn't work with the PROJECT2.