| Author |
Message |
Red
 Active member
 Joined: 31 Oct 2003 Posts: 231 Location: Sevierville,TN USA
|
Posted: Tue Dec 02, 2003 3:33 pm Post subject: Smart Hotspots |
|
|
I'm looking for a tutorial/info on how to script 2d smart hotspots. Does anyone know where I could find one?
_________________ Thanks,
Red
_______________________
www.TheSummitonBluffMountain.com |
|
| Back to top |
|
Geoffroy Magnan
 Active member
 Joined: 31 Oct 2003 Posts: 299 Location: Liège, Belgium, EU
|
Posted: Tue Dec 02, 2003 5:39 pm Post subject: Re: Smart Hotspots |
|
|
| Red wrote: | | I'm looking for a tutorial/info on how to script 2d smart hotspots. Does anyone know where I could find one? |
In the help file @ HOTSPOT
HOTSPOT
HOTSPOT x, y, z [, unID [, paramReference,
flags] [, displayParam]]
HOTSPOT2 x, y [, unID [, paramReference, flags][, displayParam]]
unID: unique identifier, which must be unique among the hotspots defined in the library part.
paramReference: parameter that can be edited by this hotspot using the graphical hotspot based parameter editing method.
displayParam: parameter to display in the information palette when editing the paramRefrence parameter. Members of arrays can be passed as well.
Examples of valid arguments:
D, Arr[5], Arr[2*I+3][D+1], etc.
flags: hotspot's type + hotspot's attribute,
type:
1: length type editing, base hotspot
2: length type editing, moving hotspot
3: length type editing, reference hotspot (always hidden)
4: angle type editing, base hotspot
5: angle type editing, moving hotspot
6: angle type editing, center of angle (always hidden)
7: angle type editing, reference hotspot (always hidden)
attribute can be a combination of the following values or zero:
128: hide hotspot (meaningful for types: 1,2,4,5)
256: editable base hotspot (for types: 1,4)
512: reverse the angle in 2D (for type 6)
To edit a length type parameter, three hotspots must be defined with types 1, 2 and 3. The positive direction of the editing line is given by the vector from the reference hotspot to the base hotspot. The moving hotspot must be placed along this line at a distance determined by the associated parameter's value, measured from the base hotspot.
To edit an angle type parameter, four hotspots must be defined with types 4, 5, 6 and 7. The plane of the angle is perpendicular to the vector that goes from the center hotspot to the reference hotspot. The positive direction in measuring the angle is counter-clockwise if we look at the plane from the reference hotspot. In 2D the plane is already given, so the reference hotspot is ignored, and the positive direction of measuring the angle is by default counter-clockwise. This can be changed to clockwise by setting the 512 attribute flag for the center hotspot (type 6). To be consistent, the vectors from the center hotspot to the moving and the base hotspots must be perpendicular to the vector from the center to the reference hotspot. The moving hotspot must be placed at an angle determined by the associated parameter measured from the base hotspot around the center hotspot.
If several sets of hotspots are defined to edit the same parameter, hotspots are grouped together in the order of the execution of the hotspot commands. If the editable attribute is set for a base hotspot, the user can also edit the parameter by dragging the base hotspot. Since the base hotspot is supposed to be fixed in the object's coordinate frame (i.e. its location must be independent of the parameter that is attached to it), the whole object is dragged or rotated along with the base point. (As the parameter's value is changing, the moving hotspot will not change its location.)
Two or three length type sets of hotspots can be combined to allow editing of two or three parameters with only one dragging. If two are combined, the motion of the hotspot is no longer constrained to a line but to the plane determined by the two lines of each set of length editing hotspots. In 3D, the combination of three sets of length editing hotspots allows the hotspot to be placed anywhere in space. The two lines must not be parallel to each other, and the three lines must not be on the same plane. A combined parameter editing operation is started if, at the location of the picked point, there are two or three editable hotspots (moving or editable base) with different associated parameters. If parameters are designed for combined editing, the base and reference hotspots are not fixed in the object's coordinate frame, but must move as the other parameter's value changes. See illustration and example .
_________________ Geoffroy Magnan - Ir Architecte
Win2000 SP4 - P4 3.8 - 3 GB - GeForce 6600 - AC10 INTL |
|
| Back to top |
|
david nicholson-cole
 Junior member
 Joined: 01 Nov 2003 Posts: 164 Location: Nottingham
|
Posted: Sun Jan 11, 2004 4:16 pm Post subject: Re: Smart Hotspots |
|
|
| Red wrote: | | I'm looking for a tutorial/info on how to script 2d smart hotspots. Does anyone know where I could find one? |
Its my next big challenge in the Cookbook 4 authoring.
I was in Denmark for 3 days doing a sort of masterclass with the Undergraduates in Aarhus who are doing an excellent GDL project to study industrialised building components - and perhaps 60-70% of my tutoring time was spent giving their objects super smart hotspots. Once you have identified what you want the hotspots to do, the actual procedure is not too difficult once you have done it enough times not to need to keep consulting the tutorial/manual. Its very 'copy and paste' - once you have done the first one the rest follow more easily.
Sometime ago in Feb/March 2003 I printed out a PDF tutorial that I must have got from GS on updates from 7 to 8 which was quite good on the hotspots and which taught me how to do it! it was better than the help menu in archiCAD which is short of examples.
I have done one exercise in the CB with the hotspots, but still need to write a primer on the idea behind it, and make it easier to read than GS's somehow.
_________________ --:David Nicholson-Cole GDLA:--
Book for ArchiCAD Summer School 2009, 8-12 Sept 2009, please see the website! http://www.archicad-university.com |
|
| Back to top |
|
Sean McMurtrey
 New member
 Joined: 13 Nov 2003 Posts: 41 Location: Boise, ID
|
Posted: Thu Feb 19, 2004 7:15 pm Post subject: Re: Smart Hotspots |
|
|
Sheesh, I havent been here in a while and cant believe I missed this post.
I havent played with the angle editing but the length type is pretty fun. I added a feature to our objects that allow the user to drag the joist and beam labels across the length of the member.
In the following example, locx is the location of the label along the length of the joist (x-axis), labl_v is a verticle placement either above or below the member. The first hotspot determines a start point, the second creates a vector or direction to move from the start point and the last is the moving point itself. I also borrowed a tip from DNC concerning the unique ID by increasing the number by 1 before each HOTSPOT statement. That way you dont have to keep track of which ID's you have used and it becomes more "Cut & Paste" friendly.
hsp=hsp+1
HOTSPOT2 0, labl_v, hsp, locx, 1+128 ! base
hsp=hsp+1
HOTSPOT2 -1", labl_v, hsp, locx, 3 ! vector
hsp=hsp+1
HOTSPOT2 locx, labl_v, hsp, locx, 2 !move-able
TEXT2 locx,labl_v,lstr
_________________ P4 3GHz
Windows XP Pro
AC10 |
|
| Back to top |
|
Sergio
 Active member
 Joined: 26 Feb 2004 Posts: 311 Location: Chicago, USA
|
Posted: Mon Oct 11, 2004 9:25 pm Post subject: Re: Smart Hotspots |
|
|
(... just maybe this tread isn't dead... )
Okay, I've read these explanations for a while, and have tried to play around with them, but no luck. What I'm trying to do is insert some TEXT2 in a block at a specified default location (with a HOTSPOT2), but I'd like the user to be able to relocate it (hotspot and text) once the block is inserted by draging the hotspot to a new location.
So what's the trick here.
_________________ __________________________
Gateway P4/3.2/512Mb/128MbVram
AC9.0 US (2219) w/ PM9 & AC10 US (987) on XP Pro |
|
| Back to top |
|
Olivier Dentan
 Active member
 Joined: 01 Feb 2004 Posts: 402 Location: France
|
Posted: Tue Oct 12, 2004 8:41 am Post subject: Re: Smart Hotspots |
|
|
Hi Sergio, i finally understand what you tried to achieve with your post "Text treatment in GDL" on this same thread.
Sorry, your question was not clear enough the first time. Try this
unID=1 ! always declare the first unID
!!! ------------ static hotspots ------------
HOTSPOT2 x1, y1, unID : unID=unID+1 ! first hotspot=anchor point
HOTSPOT2 x2, y2, unID : unID=unID+1
HOTSPOT2 xn, yn, unID : unID=unID+1
!!! ------------ moveable hotspots ------------
!!! ------------ x location
HOTSPOT2 0 , yy, unID, xx, 1+128 : unID=unID+1 ! base
HOTSPOT2 -1 , yy, unID, xx, 3 : unID=unID+1 ! ref
HOTSPOT2 xx, yy, unID, xx, 2 : unID=unID+1 ! moveable
!!! ------------ y location
HOTSPOT2 xx, 0 , unID, yy, 1+128 : unID=unID+1
HOTSPOT2 xx, -1 , unID, yy, 3 : unID=unID+1
HOTSPOT2 xx, yy, unID, yy, 2 : unID=unID+1
TEXT2 xx, yy, your text
You have to declare xx and yy as lenght parameters, but you can hide them in the parameters windpw.
_________________ Olivier Dentan
Free Library Parts for ArchiCAD |
|
| Back to top |
|
Sergio
 Active member
 Joined: 26 Feb 2004 Posts: 311 Location: Chicago, USA
|
Posted: Wed Oct 13, 2004 8:20 pm Post subject: Re: Smart Hotspots |
|
|
FINALLY!!!!.... A HUGE thank you for this bit of code. I've been looking for something like this for the longest time. I always found ArchiCAD's help rather cryptic in some areas, and the GDL Cookbook is still not out. Makes figuring out new things rather tough.
Now to understand the logic behind what is going on... and to finally start writing some useful GDL...
_________________ __________________________
Gateway P4/3.2/512Mb/128MbVram
AC9.0 US (2219) w/ PM9 & AC10 US (987) on XP Pro |
|
| Back to top |
|
Barry Kelly
 Senior member
 Joined: 28 Oct 2003 Posts: 1044 Location: Perth, Western Australia
|
Posted: Tue Nov 02, 2004 6:44 am Post subject: Re: Smart Hotspots |
|
|
Is anyone having much luck with 3D editable hotspots
I am trying to move a point in the X, Y and Z directions at the same time.
Seems impossible.
Try as I might I can only get a dialogue box that allows me to change two values.
Here is the 3D script I am using.
!Stretchy x
HOTSPOT 0, dist_y, dist_z, unID, dist_x, 1+128 !base
HOTSPOT -1, dist_y, dist_z, unID, dist_x, 3 !reference
HOTSPOT dist_x, dist_y, dist_z, unID, dist_x, 2 !moveable
unID=unID+1
!Stretchy y
HOTSPOT dist_x, 0, dist_z, unID, dist_y, 1+128 !base
HOTSPOT dist_x, -1, dist_z, unID, dist_y, 3 !reference
HOTSPOT dist_x, dist_y, dist_z, unID, dist_y, 2 !moveable
unID=unID+1
!Stretchy z
HOTSPOT dist_x, dist_y, 0, unID, dist_z, 1+128 !base
HOTSPOT dist_x, dist_y, -1, unID, dist_z, 3 !reference
HOTSPOT dist_x, dist_y, dist_z, unID, dist_z, 2 !moveable
unID=unID+1
add dist_x, dist_y, dist_z
sphere 0.1
With this I can only move in the X or Y direction.
Only X and Y appear in the dialogue box.
I can use the SHIFT button to constrain along either axis.
Remark the X or Y hotspots out and then the Z value suddenly appears in the dialogue box.
But using the SHIFT button to constrain only allows me to move in the X or Y direction (whichever was not commented out) and the Z value drops to zero.
I must type in a value for Z - it can not be constrained with SHIFT.
Ideally I would like to graphically move in all 3 directions with the ability to use the SHIFT button to constrain the X, Y or Z values.
To quote from the on-line GDL help file: -
"In 3D, the combination of three sets of length editing hotspots allows the hotspot to be placed anywhere in space. "
And from the Archicad 8 Training Guide (page 192): -
"Depending on their programming, GDL Objects can have smart editing hotspots in 3D. If you select such an object in 3D view, click a 3D hotspot and choose the horizontal or vertical stretch icon in the pet palette (whichever is appropriate), you will get both a visualfeedback of the available stretching range and the name of the value of the parameter you are modifying"
Normally only the horizontal stretch button is available in the pet palette.
The only way I can get the vertical stretch button to appear is if I use ZZYZX as my height variable.
But still the dialogue box only shows the Z value and X OR Y, but not all three.
I am using V8.1 R2c (build 2284) on Windows XP professional.
Could anyone please shed some light on this?
Thanks,
Barry.
|
|
| Back to top |
|
Joachim Suehlo
 Junior member
Joined: 30 Oct 2003 Posts: 94 Location: Neustadt
|
Posted: Tue Nov 02, 2004 9:49 am Post subject: Re: Smart Hotspots |
|
|
A litte demonstration object for 2D movable hotspots you can find attached.
The reference hotspots are made visible so you can see them moving together with the moving hotspots on the border of the rectangles.
| Description: |
|
 Download |
| Filename: |
Hotspot.zip |
| Filesize: |
878 Bytes |
| Downloaded: |
510 Time(s) |
_________________ Joachim Suehlo . AC7-13 . MAC OSX . WIN7 |
|
| Back to top |
|
Olivier Dentan
 Active member
 Joined: 01 Feb 2004 Posts: 402 Location: France
|
Posted: Tue Nov 02, 2004 10:34 am Post subject: Re: Smart Hotspots |
|
|
Barry, you can move the 3D hotspot in xyz dimensions, but only two palettes of coordinates will show.
Look at this example, Tentmaker_1.gsm, the interface allows to choose z or xy or xyz coordinates for 3D hotspots.
http://archicad-talk.graphisoft.com/viewtopic.php?t=3183
Unfortunatelly with xyz, the control is not easy, because the shift key does not work as expected with z axis.
The hotspot feature needs some improvement.
_________________ Olivier Dentan
Free Library Parts for ArchiCAD |
|
| Back to top |
|
|
| View previous topic :: View next topic |