cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn to manage BIM workflows and create professional Archicad templates with the BIM Manager Program.

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

Angle graphical hotspot

Anonymous
Not applicable
I can't figure how to link a radius value to an angle hotspot (like X and Y values for the same hotspot).
I get either the angle value, or the radius value, but not both (for the same hotspot).
Any advice?
3 REPLIES 3
I have a routine that does this, but it may not be what you want. You can move a point on the radius arbitrarily, modifying the radius and angle at the same time, but you can't input the radius or the angle while moving. The radius/angle and the XY position of the spot are independent parameters bound together by GLOB_MODPAR_NAME. The parameters you see as you move the spot are the XY position parameters.

If you're interested,

!Parameters
!lenx : X distance
!leny : Y distance
!rad : radius
!ng : angle
!Master Script
!when X & Y are modified graphically, recalculate rad & ng.
IF GLOB_MODPAR_NAME='lenx' OR GLOB_MODPAR_NAME='leny' THEN
	ng=ATN(leny/lenx)
	IF lenx<0 THEN ng=90+(90+ng)
	IF leny<0 THEN ng=360+ng
	IF ng>360 THEN ng=ng-360
	PARAMETERS ng=ng
	rad=SQR(lenx^2+leny^2)
	PARAMETERS rad=rad
ENDIF

!when rad & ng are modified in the settings, or with other spots, recalculate X & Y.
IF GLOB_MODPAR_NAME='rad' OR GLOB_MODPAR_NAME='ng' THEN
	lenx=rad*COS(ng)
	PARAMETERS lenx=lenx
	leny=rad*SIN(ng)
	PARAMETERS leny=leny
ENDIF
!2D Script
HOTSPOT2 0, leny, hsid, lenx, 1+128 : hsid=hsid+1 !b
HOTSPOT2 lenx, leny, hsid, lenx, 2 : hsid=hsid+1 !m
HOTSPOT2 -1, leny, hsid, lenx, 3 : hsid=hsid+1 !r

HOTSPOT2 lenx, 0, hsid, leny, 1+128 : hsid=hsid+1 !b
HOTSPOT2 lenx, leny, hsid, leny, 2 : hsid=hsid+1 !m
HOTSPOT2 lenx, -1, hsid, leny, 3 : hsid=hsid+1 !r

ARC2 0,0,rad,0,ng

HOTSPOT2 0,0
HOTSPOT2 rad,0
You could add editing hotspots for rad, or use A for the radius instead.

I have found, as you did, that overlapping angle and length hotspots don't work.
James Murray

Archicad 27 • Rill Architects • macOS • OnLand.info
Anonymous
Not applicable
James wrote:
I have found, as you did, that overlapping angle and length hotspots don't work.
May be for the whislist? I let you do it, if you agree, because you
will explain this better than me.

Thanks for the workaround, not exactly what i need, as you said, but interesting.
Done. I hope I explained it well enough.

I just realized I forgot to attach my screen shot of the posted code in action.
ArcStretch.jpg
James Murray

Archicad 27 • Rill Architects • macOS • OnLand.info