We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2023-12-28 11:10 PM - last edited on 2024-09-26 01:30 PM by Doreena Deng
Hi,
Is it possible to copy 2D hotspots from the 2D script, paste them into the 3D script and add a ROTx beforehand to bring them into the z-axis?
One of my objects is rotated in 3D by 90 degrees but the hotspots remain on the x,y plane when viewed in 3D. My hope is that something like a simple rotate command could apply to 2D hotspots as well? The complexity of HOTSPOT x,y,z is way high!
Many thanks, Matt
Solved! Go to Solution.
2023-12-29 02:19 AM
Unfortunately no.
Hotspots in 3D have to be coded with HOTSPOT x,y,z. They really just follow the same logic, just with the added z coord.
You may however be able to do a rotx 90 to rotate your working plane and then just draw your hotspots with a 0 z coord.
2023-12-29 10:27 AM
Don't think that that works. Hotspots don't take the transformation stack into account i think.
On the plus side after messing with the 3D hotspots once you automatically get 2D ones aswell.
Here is my code which may make it easier since you only have to pass x,y,z to to the subroutine.
!==========================================================
! creates Hotspots in 3D
!----------------------------------------------------------
!Input paramater:
! mypoint[ti][1], mypoint[ti][2],mypoint[ti][3]
!Output parameter :
! mypoint[ti][1], mypoint[ti][2],mypoint[ti][3]
!Remark:
! set ti before calling sub
! Hotspots need to work directly on the parameter, variables don't seem to work
!==========================================================
"h_xyz":
!HOTSPOT for points_h[ti]
!HOTSPOT for X:
id_hs = id_hs+1
!Vector
HOTSPOT -1,points_s[ti][2],points_s[ti][3],
id_hs, points_s[ti][1],3
id_hs = id_hs+1
!Base
HOTSPOT 0,points_s[ti][2],points_s[ti][3],
id_hs, points_s[ti][1], 1+128 !Invisible
id_hs = id_hs+1
!Move
HOTSPOT points_s[ti][1],points_s[ti][2],points_s[ti][3],
id_hs, points_s[ti][1], 2
id_hs = id_hs+1
!HOTSPOT for Y:
!Vector
HOTSPOT points_s[ti][1],-1,points_s[ti][3],
id_hs,points_s[ti][2],3
id_hs = id_hs+1
!Base
HOTSPOT points_s[ti][1],0,points_s[ti][3],
id_hs,points_s[ti][2],1+128
id_hs = id_hs+1
!Move
HOTSPOT points_s[ti][1],points_s[ti][2],points_s[ti][3],
id_hs,points_s[ti][2],2
id_hs = id_hs+1
!HOTSPOT for Z:
!Vector
HOTSPOT points_s[ti][1],points_s[ti][2],-1,
id_hs,points_s[ti][3],3
id_hs = id_hs+1
!Base
HOTSPOT points_s[ti][1],points_s[ti][2],0,
id_hs,points_s[ti][3],1+128
id_hs = id_hs+1
!Move
HOTSPOT points_s[ti][1],points_s[ti][2],points_s[ti][3],
id_hs,points_s[ti][3],2
id_hs = id_hs+1
RETURN
2023-12-30 05:25 PM
The amount if trig I sometimes need because of the transformation stack being ignored is such a pain...
AC22-23 AUS 7000 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |
2023-12-29 02:19 AM
Unfortunately no.
Hotspots in 3D have to be coded with HOTSPOT x,y,z. They really just follow the same logic, just with the added z coord.
You may however be able to do a rotx 90 to rotate your working plane and then just draw your hotspots with a 0 z coord.
2023-12-29 10:27 AM
Don't think that that works. Hotspots don't take the transformation stack into account i think.
On the plus side after messing with the 3D hotspots once you automatically get 2D ones aswell.
Here is my code which may make it easier since you only have to pass x,y,z to to the subroutine.
!==========================================================
! creates Hotspots in 3D
!----------------------------------------------------------
!Input paramater:
! mypoint[ti][1], mypoint[ti][2],mypoint[ti][3]
!Output parameter :
! mypoint[ti][1], mypoint[ti][2],mypoint[ti][3]
!Remark:
! set ti before calling sub
! Hotspots need to work directly on the parameter, variables don't seem to work
!==========================================================
"h_xyz":
!HOTSPOT for points_h[ti]
!HOTSPOT for X:
id_hs = id_hs+1
!Vector
HOTSPOT -1,points_s[ti][2],points_s[ti][3],
id_hs, points_s[ti][1],3
id_hs = id_hs+1
!Base
HOTSPOT 0,points_s[ti][2],points_s[ti][3],
id_hs, points_s[ti][1], 1+128 !Invisible
id_hs = id_hs+1
!Move
HOTSPOT points_s[ti][1],points_s[ti][2],points_s[ti][3],
id_hs, points_s[ti][1], 2
id_hs = id_hs+1
!HOTSPOT for Y:
!Vector
HOTSPOT points_s[ti][1],-1,points_s[ti][3],
id_hs,points_s[ti][2],3
id_hs = id_hs+1
!Base
HOTSPOT points_s[ti][1],0,points_s[ti][3],
id_hs,points_s[ti][2],1+128
id_hs = id_hs+1
!Move
HOTSPOT points_s[ti][1],points_s[ti][2],points_s[ti][3],
id_hs,points_s[ti][2],2
id_hs = id_hs+1
!HOTSPOT for Z:
!Vector
HOTSPOT points_s[ti][1],points_s[ti][2],-1,
id_hs,points_s[ti][3],3
id_hs = id_hs+1
!Base
HOTSPOT points_s[ti][1],points_s[ti][2],0,
id_hs,points_s[ti][3],1+128
id_hs = id_hs+1
!Move
HOTSPOT points_s[ti][1],points_s[ti][2],points_s[ti][3],
id_hs,points_s[ti][3],2
id_hs = id_hs+1
RETURN
2023-12-30 05:25 PM
The amount if trig I sometimes need because of the transformation stack being ignored is such a pain...
AC22-23 AUS 7000 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |
2024-01-01 07:35 PM
Thank you Scott, that saved me a lot of time! Best regards, Matt
2024-01-01 07:37 PM
Hi Rudl,
Okay that is cool! I didn't know the 3D Hotspots also produce the 2D Hotspots, thank you for that info, two birds, one stone! Best regards, Matt
2024-01-01 07:38 PM
Soooo complex right!!!
2024-01-08 04:11 PM - edited 2024-01-08 04:12 PM
Hi, hotspots should work with the transformation stack as long as the axes remain unit length.