2023-06-30 01:55 PM
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
Solved! Go to Solution.
2023-07-04 11:29 AM
Seems fine.
The tap comes in on top for me when I set the scale to 1:50 or less.
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.
2023-06-30 03:27 PM
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.
2023-06-30 03:49 PM
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
2023-06-30 05:35 PM - last edited on 2023-07-01 07:17 AM by Laszlo Nagy
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
2023-07-04 11:15 AM
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!
2023-07-04 11:29 AM
Seems fine.
The tap comes in on top for me when I set the scale to 1:50 or less.
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.
2023-07-04 11:43 AM
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!