<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Piece of Cake? Hotspot2 for Angle &amp;amp; Radius of Arc in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Piece-of-Cake-Hotspot2-for-Angle-amp-Radius-of-Arc/m-p/211234#M17100</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Hi All!&lt;BR /&gt;
This forum is proving to be incredibly helpful, &lt;BR /&gt;
so here I go once again...&lt;BR /&gt;
&lt;BR /&gt;
As my Trigonometry is close to non-existent, I need some help&lt;BR /&gt;
with finishing off this attached Slice-of-Cake object.&lt;BR /&gt;
I'm sure it actually is a piece of cake... &lt;E&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/E&gt;&lt;BR /&gt;
&lt;BR /&gt;
1. I need to create a SINGLE HOTSPOT2 that will control both&lt;BR /&gt;
    the RADIUS &amp;amp; the ANGLE of the given ARC2.&lt;BR /&gt;
    In the current object I only have control of the Angle,&lt;BR /&gt;
    as the key code was pretty much copy-pasted from Fabrizio Diodati's&lt;BR /&gt;
    reply in this post:&lt;BR /&gt;
    &lt;A href="http://archicad-talk.graphisoft.com/viewtopic.php?p=2533&amp;amp;highlight=hotspots+angle#2533" target="_blank"&gt;&lt;LINK_TEXT text="http://archicad-talk.graphisoft.com/vie ... angle#2533"&gt;http://archicad-talk.graphisoft.com/viewtopic.php?p=2533&amp;amp;highlight=hotspots+angle#2533&lt;/LINK_TEXT&gt;&lt;/A&gt; &lt;BR /&gt;
&lt;BR /&gt;
2. Also, due to the pasted source code, I need to rotate the&lt;BR /&gt;
    start angle of the functions &amp;amp; ARC2 back to 0 degrees.&lt;BR /&gt;
    They currently are set to start at 90 degrees which is NOT what I need.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Here is a the 2D script code for quick reference:&lt;BR /&gt;
&lt;BR /&gt;
!*******************  READ THE PARAMETER SCRIPT FIRST  **********************! &lt;BR /&gt;
&lt;BR /&gt;
PEN mpcol&lt;BR /&gt;
SET LINE_TYPE ltm&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
!*******************  DEFINE ANGLE (angl) BY HOTSPOTS  **********************! &lt;BR /&gt;
&lt;BR /&gt;
HOTSPOT2                 0,                0, 1, angl, 6 ! This is the CENTER&lt;BR /&gt;
HOTSPOT2                 0,              rad, 2, angl, 4 ! This is the REFRNC&lt;BR /&gt;
HOTSPOT2  rad*COS(angl+90), rad*SIN(angl+90), 3, angl, 5 ! This is the MOVING&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
!********************   DRAW CENTER HS, LINES &amp;amp; ARC   ***********************! &lt;BR /&gt;
&lt;BR /&gt;
HOTSPOT2 0, 0                                    !&lt;BR /&gt;
LINE2 0, 0, rad*COS(angl+90), rad*SIN(angl+90)!&lt;BR /&gt;
LINE2 0, 0, 0               , rad             !&lt;BR /&gt;
ARC2 0, 0, rad, alpha, beta                  !&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
!           NOTES ON DEFINING THE ANGLE BY FABRIZIO DIODATI                !&lt;BR /&gt;
! -------------------------------------------------------------------------!&lt;BR /&gt;
!  The first hotspot (type 6) must describe the coordinates of the center. !&lt;BR /&gt;
!  The second one (type 4) is the reference(*), that means the point       !  &lt;BR /&gt;
!  from which the values start (you are looking for a reference            !&lt;BR /&gt;
 !  that lies on 90° that means it has X=0 and Y=radius).                   !&lt;BR /&gt;
!  The last one, the moving hotspot (type 5) must run around the circle    !&lt;BR /&gt;
 ! (which radius is indicated by the parameter R in my example)             ! &lt;BR /&gt;
!  so you have to use COS &amp;amp; SIN to describe its position.                  ! &lt;BR /&gt;
!  In your case (you are looking for a reference that lies on 90°)         ! &lt;BR /&gt;
!  you have to add 90° to the angle value).                                ! &lt;BR /&gt;
!                                                                          !&lt;BR /&gt;
!  * Is HOTSPOT 4 a "BASE" or "REFERENCE"? One of these must be wrong!     !&lt;BR /&gt;
!                                                                          !&lt;BR /&gt;
!                                                                          !&lt;BR /&gt;
!           NOTES ON HOSTPOT2 FLAGS FOR LENGTH &amp;amp; ANGLE                     !&lt;BR /&gt;
!               (From GDL Reference Manual page 165)                       !&lt;BR /&gt;
! -------------------------------------------------------------------------!&lt;BR /&gt;
!  1: length type editing, base hotspot                                    !&lt;BR /&gt;
!  2: length type editing, moving hotspot                                  !&lt;BR /&gt;
!  3: length type editing, reference hotspot (always hidden)               !&lt;BR /&gt;
!                                                                          !&lt;BR /&gt;
!  4: angle type editing,  base hotspot                                    !&lt;BR /&gt;
!  5: angle type editing,  moving hotspot                                  !&lt;BR /&gt;
!  6: angle type editing,  center of angle   (always hidden)               !&lt;BR /&gt;
!  7: angle type editing,  reference hotspot (always hidden)               !     &lt;BR /&gt;
!                                                                          !&lt;BR /&gt;
!  attribute can be a combination of the following values or zero:         !&lt;BR /&gt;
!  128: hide hotspot (meaningful for types: 1,2,4,5)                       !&lt;BR /&gt;
!  256: editable base hotspot (for types: 1,4)                             !&lt;BR /&gt;
!  512: reverse the angle in 2D (for type 6)                               !&lt;BR /&gt;
&lt;BR /&gt;
Thanks -&lt;BR /&gt;
Gil&lt;BR /&gt;
(PS-Object added in next post)&lt;/R&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;IMG src="https://community.graphisoft.com/t5/image/serverpage/image-id/8707i2B04BC0EC9DAC1FA/image-size/large?v=v2&amp;amp;px=999" border="0" alt="Slice of Cake.jpg" title="Slice of Cake.jpg" /&gt;</description>
    <pubDate>Sat, 07 May 2011 07:43:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-05-07T07:43:15Z</dc:date>
    <item>
      <title>Piece of Cake? Hotspot2 for Angle &amp; Radius of Arc</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Piece-of-Cake-Hotspot2-for-Angle-amp-Radius-of-Arc/m-p/211234#M17100</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Hi All!&lt;BR /&gt;
This forum is proving to be incredibly helpful, &lt;BR /&gt;
so here I go once again...&lt;BR /&gt;
&lt;BR /&gt;
As my Trigonometry is close to non-existent, I need some help&lt;BR /&gt;
with finishing off this attached Slice-of-Cake object.&lt;BR /&gt;
I'm sure it actually is a piece of cake... &lt;E&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/E&gt;&lt;BR /&gt;
&lt;BR /&gt;
1. I need to create a SINGLE HOTSPOT2 that will control both&lt;BR /&gt;
    the RADIUS &amp;amp; the ANGLE of the given ARC2.&lt;BR /&gt;
    In the current object I only have control of the Angle,&lt;BR /&gt;
    as the key code was pretty much copy-pasted from Fabrizio Diodati's&lt;BR /&gt;
    reply in this post:&lt;BR /&gt;
    &lt;A href="http://archicad-talk.graphisoft.com/viewtopic.php?p=2533&amp;amp;highlight=hotspots+angle#2533" target="_blank"&gt;&lt;LINK_TEXT text="http://archicad-talk.graphisoft.com/vie ... angle#2533"&gt;http://archicad-talk.graphisoft.com/viewtopic.php?p=2533&amp;amp;highlight=hotspots+angle#2533&lt;/LINK_TEXT&gt;&lt;/A&gt; &lt;BR /&gt;
&lt;BR /&gt;
2. Also, due to the pasted source code, I need to rotate the&lt;BR /&gt;
    start angle of the functions &amp;amp; ARC2 back to 0 degrees.&lt;BR /&gt;
    They currently are set to start at 90 degrees which is NOT what I need.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Here is a the 2D script code for quick reference:&lt;BR /&gt;
&lt;BR /&gt;
!*******************  READ THE PARAMETER SCRIPT FIRST  **********************! &lt;BR /&gt;
&lt;BR /&gt;
PEN mpcol&lt;BR /&gt;
SET LINE_TYPE ltm&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
!*******************  DEFINE ANGLE (angl) BY HOTSPOTS  **********************! &lt;BR /&gt;
&lt;BR /&gt;
HOTSPOT2                 0,                0, 1, angl, 6 ! This is the CENTER&lt;BR /&gt;
HOTSPOT2                 0,              rad, 2, angl, 4 ! This is the REFRNC&lt;BR /&gt;
HOTSPOT2  rad*COS(angl+90), rad*SIN(angl+90), 3, angl, 5 ! This is the MOVING&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
!********************   DRAW CENTER HS, LINES &amp;amp; ARC   ***********************! &lt;BR /&gt;
&lt;BR /&gt;
HOTSPOT2 0, 0                                    !&lt;BR /&gt;
LINE2 0, 0, rad*COS(angl+90), rad*SIN(angl+90)!&lt;BR /&gt;
LINE2 0, 0, 0               , rad             !&lt;BR /&gt;
ARC2 0, 0, rad, alpha, beta                  !&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
!           NOTES ON DEFINING THE ANGLE BY FABRIZIO DIODATI                !&lt;BR /&gt;
! -------------------------------------------------------------------------!&lt;BR /&gt;
!  The first hotspot (type 6) must describe the coordinates of the center. !&lt;BR /&gt;
!  The second one (type 4) is the reference(*), that means the point       !  &lt;BR /&gt;
!  from which the values start (you are looking for a reference            !&lt;BR /&gt;
 !  that lies on 90° that means it has X=0 and Y=radius).                   !&lt;BR /&gt;
!  The last one, the moving hotspot (type 5) must run around the circle    !&lt;BR /&gt;
 ! (which radius is indicated by the parameter R in my example)             ! &lt;BR /&gt;
!  so you have to use COS &amp;amp; SIN to describe its position.                  ! &lt;BR /&gt;
!  In your case (you are looking for a reference that lies on 90°)         ! &lt;BR /&gt;
!  you have to add 90° to the angle value).                                ! &lt;BR /&gt;
!                                                                          !&lt;BR /&gt;
!  * Is HOTSPOT 4 a "BASE" or "REFERENCE"? One of these must be wrong!     !&lt;BR /&gt;
!                                                                          !&lt;BR /&gt;
!                                                                          !&lt;BR /&gt;
!           NOTES ON HOSTPOT2 FLAGS FOR LENGTH &amp;amp; ANGLE                     !&lt;BR /&gt;
!               (From GDL Reference Manual page 165)                       !&lt;BR /&gt;
! -------------------------------------------------------------------------!&lt;BR /&gt;
!  1: length type editing, base hotspot                                    !&lt;BR /&gt;
!  2: length type editing, moving hotspot                                  !&lt;BR /&gt;
!  3: length type editing, reference hotspot (always hidden)               !&lt;BR /&gt;
!                                                                          !&lt;BR /&gt;
!  4: angle type editing,  base hotspot                                    !&lt;BR /&gt;
!  5: angle type editing,  moving hotspot                                  !&lt;BR /&gt;
!  6: angle type editing,  center of angle   (always hidden)               !&lt;BR /&gt;
!  7: angle type editing,  reference hotspot (always hidden)               !     &lt;BR /&gt;
!                                                                          !&lt;BR /&gt;
!  attribute can be a combination of the following values or zero:         !&lt;BR /&gt;
!  128: hide hotspot (meaningful for types: 1,2,4,5)                       !&lt;BR /&gt;
!  256: editable base hotspot (for types: 1,4)                             !&lt;BR /&gt;
!  512: reverse the angle in 2D (for type 6)                               !&lt;BR /&gt;
&lt;BR /&gt;
Thanks -&lt;BR /&gt;
Gil&lt;BR /&gt;
(PS-Object added in next post)&lt;/R&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;IMG src="https://community.graphisoft.com/t5/image/serverpage/image-id/8707i2B04BC0EC9DAC1FA/image-size/large?v=v2&amp;amp;px=999" border="0" alt="Slice of Cake.jpg" title="Slice of Cake.jpg" /&gt;</description>
      <pubDate>Sat, 07 May 2011 07:43:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Piece-of-Cake-Hotspot2-for-Angle-amp-Radius-of-Arc/m-p/211234#M17100</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-07T07:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Piece of Cake? Hotspot2 for Angle &amp; Radius of Arc</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Piece-of-Cake-Hotspot2-for-Angle-amp-Radius-of-Arc/m-p/211235#M17101</link>
      <description>And the half baked object...</description>
      <pubDate>Sat, 07 May 2011 07:44:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Piece-of-Cake-Hotspot2-for-Angle-amp-Radius-of-Arc/m-p/211235#M17101</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-07T07:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Piece of Cake? Hotspot2 for Angle &amp; Radius of Arc</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Piece-of-Cake-Hotspot2-for-Angle-amp-Radius-of-Arc/m-p/211236#M17102</link>
      <description>You can not mix length and angle for a same hotspot.&lt;BR /&gt;
In result, only the first hotspot (declared in tab parameters) will be active.&lt;BR /&gt;
&lt;BR /&gt;
You could achieve this with x, y coords of the hotspot. I would avoid this (trigonometric calculations needed). &lt;BR /&gt;
Better to script two hotspots, with distinct locations.&lt;BR /&gt;

&lt;PRE&gt;uid = 1    ! first unique identifier

!!! ---------- radius ----------
hotspot2  0             ,  0             , uid, rad, 1 : uid = uid+1    ! base (anchor)         
hotspot2 -rad*cos(ang/2), -rad*sin(ang/2), uid, rad, 3 : uid = uid+1    ! ref 
hotspot2  rad*cos(ang/2),  rad*sin(ang/2), uid, rad, 2 : uid = uid+1    ! moving

!!! ---------- angle ---------- 
hotspot2 0           , 0           , uid, ang, 6     : uid = uid+1     ! centre
hotspot2 rad         , 0           , uid, ang, 4+256 : uid = uid+1     ! base (editable)    
hotspot2 rad*cos(ang), rad*sin(ang), uid, ang, 5     : uid = uid+1     ! moving&lt;/PRE&gt;</description>
      <pubDate>Sun, 08 May 2011 18:57:23 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Piece-of-Cake-Hotspot2-for-Angle-amp-Radius-of-Arc/m-p/211236#M17102</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-08T18:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: Piece of Cake? Hotspot2 for Angle &amp; Radius of Arc</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Piece-of-Cake-Hotspot2-for-Angle-amp-Radius-of-Arc/m-p/211237#M17103</link>
      <description>ThanX!&lt;BR /&gt;
I pretty much ended up doing something very similar.&lt;BR /&gt;
&lt;E&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/E&gt;&lt;BR /&gt;
Gil</description>
      <pubDate>Sun, 08 May 2011 23:23:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Piece-of-Cake-Hotspot2-for-Angle-amp-Radius-of-Arc/m-p/211237#M17103</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-08T23:23:03Z</dc:date>
    </item>
  </channel>
</rss>

