Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Can't get Graphical Hotspots to work

derekjackson
Enthusiast
Hi, not sure why this isn't working. Trying to make an L shaped poly that lets me change the width of the 'L' arms, as opposed to the overall dimensions of the L. This is my 2D script:
line2 a,0,a,c
line2 a,c,d,c
line2 d,c,d,b
line2 d,b,0,b
line2 0,0,0,b

hotspot2 0,0
hotspot2 a,0


	hsid=hsid+1
	HOTSPOT2 (d+((a-d)/2)),0,	hsid,c,1+256
	hsid=hsid+1
	HOTSPOT2 (d+((a-d)/2)),c,	hsid,c,2+256
	hsid=hsid+1
	HOTSPOT2 0,1,	hsid,c,3+256
	
hotspot2 0,b

I want the graphical hotspot to allow me to change the width of the table piece, but it doesn't seem to give me the option - I can just change the overall size of the table. (c & d are the width of the two arms).

Any ideas?!
10 REPLIES 10
Anonymous
Not applicable
line2 a,0,a,c
line2 a,c,d,c
line2 d,c,d,b
line2 d,b,0,b
line2 0,0,0,b

hotspot2 0,0
hotspot2 a,0


hsid=hsid+1
HOTSPOT2 (d+((a-d)/2)),0, hsid,c,1+256
hsid=hsid+1
HOTSPOT2 (d+((a-d)/2)),c, hsid,c,2+256
hsid=hsid+1
HOTSPOT2 (d+((a-d)/2)),-1, hsid,c,3+256

hotspot2 0,b



This should fix the problem. The value in the type 3 hotspot defines the negative direction (opposite from the positive value of the variable). it also needs to align with the other two (AFAIK). In this case the X coordinate needs to match the other two since the variable is stretching parallel to the Y axis.
derekjackson
Enthusiast
Cheers, but no luck - still doesn't let the arm change in width...
Anonymous
Not applicable
Try this
uid = 1
hotspot2 (d+((A-d)/2)),  0, uid, c, 1+128 : uid = uid+1    ! base
hotspot2 (d+((A-d)/2)), -1, uid, c, 3     : uid = uid+1    ! ref 
hotspot2 (d+((A-d)/2)),  c, uid, c, 2     : uid = uid+1    ! moving
Change status code 128 to 256, according to your needs. See GDL Guide.
Erich
Contributor
Oliver,

Just curious...I write my hotspots with the moving and reference lines switched from what you show. Like this:
hotspot2 (d+((A-d)/2)),  0, uid, c, 1+128 : uid = uid+1    ! base 
hotspot2 (d+((A-d)/2)),  c, uid, c, 2     : uid = uid+1    ! moving
hotspot2 (d+((A-d)/2)), -1, uid, c, 3    : uid = uid+1    ! ref 
While I know this is not what is indicated in the GDL style guide (or whatever that document is called) it seems to work just fine and I prefer having the flags sequential. Do you know any reason why I should not do this or is it just a style issue?
Erich

AC 19 6006 & AC 20
Mac OS 10.11.5
15" Retina MacBook Pro 2.6
27" iMac Retina 5K
Anonymous
Not applicable
Erich wrote:
While I know this is not what is indicated in the GDL style guide (or whatever that document is called) it seems to work just fine and I prefer having the flags sequential. Do you know any reason why I should not do this or is it just a style issue?
Hi Erich,

I have seen both ways (1, 2, 3 and 1, 3, 2) in GS scripts.
It works the same, therefore I think the order doesn't matter.

Just a question of preference. I find more convenient to indicate
the vector from the reference hotspot before the moving hotspot.
derekjackson
Enthusiast
Hmm, still not working. I'm sure what I'm after is quite simple (when you know how), so maybe I haven't been explaining what I'm after properly!!

I've attached a JPG showing the end result I need - The outer corner hotspots (essentially A & B) correctly stretch the overall lengths of the 'L' as any other basic object. I'm wanting to add a hotspot to vary the width of one of the arms - so moving the circled hotspot will change the width of the arm (C)

I think I've got the hotspot in the right place, and the vector of movement is in the right axis, so how come I don't get the stretch option on the pet palette?
Anonymous
Not applicable
Just to check the obvious... Have you listed the C-parameter in your parameters window as a length-type parameter?
derekjackson
Enthusiast
I hadn't. Now changed it to a length and the hotpots turn magenta and give me the stretch option. Unfortunately it still doesn't stretch - just moves the overall dimension as if I was affecting B instead...
Anonymous
Not applicable
Hmm.

I've just copypasted your original script and replaced the hotspot definition part with Erich's snippet, and it seems to work just fine.

My code looks like this:

line2 a,0,a,c
line2 a,c,d,c
line2 d,c,d,b
line2 d,b,0,b
line2 0,0,0,b

hotspot2 0,0
hotspot2 a,0

hotspot2 (d+((A-d)/2)),  0, uid, c, 1+128 : uid = uid+1    ! base
hotspot2 (d+((A-d)/2)),  c, uid, c, 2     : uid = uid+1    ! moving
hotspot2 (d+((A-d)/2)), -1, uid, c, 3    : uid = uid+1    ! ref 
   
hotspot2 0,b 
It's not yet the object your picture describes, but at least the c-parameter seems to stretch fine...