Door and Window Marker

Home Forums Problems and solutions in GDL Object design Door and Window Marker

This topic contains 3 replies, has 2 voices, and was last updated by  Barry Kelly 1 week, 1 day ago.

  • Author
    Posts
  • #4275

    Eric Bergquist
    Participant

    Good morning everyone

    I am just working thru a simple Door and Window marker to display information in a format one of our client wants

    I have a question – why when I add a HOTSPOT2 it shows the hotspot but doesn’t allow the marker to be dragged?

    Cheers

    Eric

    2D code as follows:

    DEFINE STYLE "id" AC_TextFont_1, AC_TextSize_1, 5, AC_TextStyle_1
    DEFINE STYLE "dims" AC_TextFont_1, (AC_TextSize_1 * 0.75), 5, AC_TextStyle_1
    
    STYLE "ID"
    
    widoTypeID = ""
    
    hotspot2 0,1
    
    rrr = REQUEST("AssocLP_ParValue", "widoTypeID", parIndex, parType, flags, dim1, dim2, widoTypeID)
    ADD2 0, 1
    
    PEN AC_TextPen_1
    
    ! See if there is a window type id set 
    IF widoTypeID = "" THEN
    	TEXT2 0, 0, ac_wido_id
    ELSE
    	TEXT2 0, 0, ac_wido_id + " (" + widoTypeID + ")"
    ENDIF
    
    ADD2 0, -((AC_TextSize_1 * glob_scale / 1000) * 1.5)
    ! Add the window dimensions h x w
    STYLE "dims"
    TEXT2 0, 0, STR((ac_wido_b_size * 1000), 4, 0) + " " + GS_Separator + " " + STR((ac_wido_a_size * 1000), 4, 0)
    
    ! Remove all transformations
    DEL TOP

    Archicad 8 then 20-22

  • #4276

    Barry Kelly
    Participant

    That is just a simple hotspot.
    It is not a graphical (adjustable) hotspot.

    You need to add the graphical hotspots and then an ADD2 x,y to transform your marker position to match the hotspot values.

    Barry.

    Versions 6.5 to 22
    Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
    Dell Precision M6800 - i7 4700MQ @ 2.40GHz, 16GB RAM, AMD FirePro M6100 (2GB), Windows 7 64bit

  • #4277

    Eric Bergquist
    Participant

    Hi Barry

    Thanks for the reply to my question

    Are you able to ‘dumb’ it down a little for me please … unfortunately the last time I was using GDL was back around Archicad 8 so most of my knowledge has gone since then

    I thought the hotspot gave the user and node where they could then manipulate the object – stretch or move

    CHeers

    Eric

    Archicad 8 then 20-22

  • #4281

    Barry Kelly
    Participant

    A single HOTSPOT2 command will place a black hotspot that can be used to select or drag the entire object.
    I won’t drag just a portion of the object.

    To stretch just a portion you must use ‘Graphical’ hotspots.
    These are a series of commands that produce a purple (may depend on you Archicad settings) diamond shaped hotspot that can be dragged in plan (also can be used in 3D).
    You then use an ‘ADD2 x,y’ command before the part of the script you want to drag and a ‘DEL 1’ after it.
    This way you can control just a portion of your object.

    The hotspots will be something like this.

    !Stretchy x
    	HOTSPOT2 0, off_ver, 1, off_hor, 1+128 !base
    	HOTSPOT2 -1, off_ver, 2, off_hor, 3 !reference
    	HOTSPOT2 off_hor, off_ver, 3, off_hor, 2 !moveable
    
    !Stretchy y
    	HOTSPOT2 off_hor, 0, 4, off_ver, 1+128 !base
    	HOTSPOT2 off_hor, -1, 5, off_ver, 3 !reference
    	HOTSPOT2 off_hor, off_ver, 6, off_ver, 2 !moveable
    
    ADD2 off_hor, off_ver
    
    .... object script....
    
    DELL 1

    This create a single hotspot that drags both the horizontal (x) and vertical (y) position at the same time.

    You will find more info on Graphical hotspots in the GDL reference manual.

    Barry.

    Versions 6.5 to 22
    Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
    Dell Precision M6800 - i7 4700MQ @ 2.40GHz, 16GB RAM, AMD FirePro M6100 (2GB), Windows 7 64bit

You must be logged in to reply to this topic.