Do on mouse click some graphics...Do on mouse click some graphics...RE: Do on mouse click some graphics...Melanie Schranzhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=3511892015-07-27T10:54:32Z2015-07-27T10:54:32ZThank you very much for the quick answer!Melanie Schranz2015-07-27T10:54:32ZRE: Do on mouse click some graphics...Mehmet Albayrakhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=3511792015-07-27T10:29:22Z2015-07-27T10:28:03ZDear Melanie,<br />Thank you for your question. Unfortunately there is no command to erase a line in the GraphRep definition. Nevertheless you can try one of the following two approaches.<br /><br />1) Draw a white line on the line.<br />2) Work with the opposite 'if' condition. In this approach you draw the line if the value of the attribute "ID" is " " and no line else (see code below). <br /><br /><div class="code"><span class="code-lines">1</span>AVAL t1:"ID"<br /><span class="code-lines">2</span>IF(t1=" ")<br /><span class="code-lines">3</span>LINE x1:1.1cm x2:1.1cm y1:-0.6cm y2:0.6cm<br /><span class="code-lines">4</span>ENDIF<br /></div>Mehmet Albayrak2015-07-27T10:28:03ZRE: Do on mouse click some graphics...Melanie Schranzhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=3509262015-07-27T10:10:09Z2015-07-27T09:57:53ZThank you very much, this brought me a big step further!<br />A small thing is still open: <br /><br />Is it possible to erase a line, in this style: <br /><br /><br />AVAL t1:"ID"<br /><strong></strong>LINE x1:1.1cm x2:1.1cm y1:-0.6cm y2:0.6cm<br /><br />IF(t1!=" ")<br />{<br />"ERASE LINE x1:1.1cm x2:1.1cm y1:-0.6cm y2:0.6cm"<br />}<br />ENDIF<br /><br />I wasn't able to find an appropriate command!<br /><br />Thanks and best regards, MelanieMelanie Schranz2015-07-27T09:57:53ZRE: Do on mouse click some graphics...Mehmet Albayrakhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=3483822015-07-21T11:38:52Z2015-07-21T11:36:18ZDear Melanie, <br /><br />You can make a workaround with a 'hidden' attribute and set the attribute value to 'True' during your implementation. You can read the value of this attribute in the graphRep then with AVAL. For this scenario, please follow the steps below:<br /><br />1) Create attribute: 'Clicked' of type ENUMERATION with the Enumeration Domain: False@True<br />2) Add a Command in your AdoScript that the value of the attribute "Clicked" should be set to true.<br /><br /><div class="code"><span class="code-lines">1</span>CC "Core" SET_ATTR_VAL objid: (n_ObjId) attrname:"Clicked" val:"True"</div><br />3) Configure GraphRep:<br /><br /><div class="code"><span class="code-lines">1</span>AVAL sClicked:"Clicked"<br /><span class="code-lines">2</span>IF (sClicked="True")<br /><span class="code-lines">3</span>...<br /><span class="code-lines">4</span>ENDIF<br /></div>Mehmet Albayrak2015-07-21T11:36:18ZRE: Do on mouse click some graphics...Melanie Schranzhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=3457722015-07-15T14:05:15Z2015-07-15T14:05:15ZThank you very much for your detailed answer!<br /><br />I have a, somehow, related question: <br />Is it possible to get with HOTSPOT a return value like: true ("area clicked with mouse") or false ("area not clicked with mouse")? <br />Or related, like a string "clicked" and "not_clicked" to differ and work further with this value in GraphRep?Melanie Schranz2015-07-15T14:05:15ZRE: Do on mouse click some graphics...Fadi Al Machothttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=3410472015-07-10T10:11:42Z2015-07-10T10:11:42ZThanxFadi Al Machot2015-07-10T10:11:42ZRE: Do on mouse click some graphics...Mehmet Albayrakhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=3410022015-07-10T09:51:57Z2015-07-10T08:54:31ZDear Melanie,<br />Thank you for your question. In order to realize your scenario you would need an attribute of type PROGRAMCALL with what you can trigger an AdoScript code for creating a new object. For executing this from the graphical notation of the object you have define a HOTSPOT within your GraphRep attribute.<br />You can find the GraphRep documentation and the syntax at the following link:<br /><a href="http://www.adoxx.org/live/adoxx-notation-language-graphrep">http://www.adoxx.org/live/adoxx-notation-language-graphrep</a><br /><br />Please find below an example library, and the step by step documentation how the implement the scenario.<br /><br />1) Create Class with Name "A"<br /><br />2) Create Attribute in the 'Create Object' of type PROGRAMCALL and edit the following parameters:<br /><br /><strong>-Standard value:</strong><div class="code"><span class="code-lines">1</span>CreateObject</div><br /><strong>-EnumerationDomain:</strong><div class="code"><span class="code-lines"> 1</span>ITEM "CreateObject"<br /><span class="code-lines"> 2</span>SET n_ObjId: (objid)<br /><span class="code-lines"> 3</span>CC "Modeling" GET_ACT_MODEL<br /><span class="code-lines"> 4</span>SET nModelId: (modelid)<br /><span class="code-lines"> 5</span>CC "Core" GET_CLASS_ID objid: (n_ObjId)<br /><span class="code-lines"> 6</span>SET nClassId: (classid)<br /><span class="code-lines"> 7</span>CC "AdoScript" EDITBOX text:"Enter object name!" title:"Enter object name!" <br /><span class="code-lines"> 8</span>SET sName: (text)<br /><span class="code-lines"> 9</span>CC "Core" CREATE_OBJ modelid: (modelid) classid: (nClassId) objname: (sName)<br /><span class="code-lines">10</span>#-->RESULT ecode:intValue objid:intValue<br /><span class="code-lines">11</span>SET sNewObjId: (objid)<br /><span class="code-lines">12</span>#Object names have to be unique<br /><span class="code-lines">13</span> IF (ecode!=0) {<br /><span class="code-lines">14</span> CC "AdoScript" ERRORBOX "The Name You have Chosen is not Unique!"<br /><span class="code-lines">15</span> EXIT<br /><span class="code-lines">16</span> }<br /><span class="code-lines">17</span>#Position the created new object<br /><span class="code-lines">18</span>CC "Core" GET_ATTR_VAL objid: (n_ObjId) attrname:"Position"<br /><span class="code-lines">19</span>SET sObjpos: (val)<br /><span class="code-lines">20</span>LEO parse: (sObjpos) <br /><span class="code-lines">21</span> get-str-value:xPos:"x" <br /><span class="code-lines">22</span> get-str-value:yPos:"y"<br /><span class="code-lines">23</span>SET xNewPos: ((VAL xPos) + CM 4)<br /><span class="code-lines">24</span>SET yNewPos: ((VAL yPos) + CM 3)<br /><span class="code-lines">25</span>CC "Modeling" SET_OBJ_POS objid: (sNewObjId) x: (xNewPos) y: (yNewPos)<br /></div><br />3) Define GraphRep<br /><br /><div class="code"><span class="code-lines">1</span>GRAPHREP<br /><span class="code-lines">2</span>FILL color:green<br /><span class="code-lines">3</span>RECTANGLE x:-1.2cm y:-0.8cm w:2.4cm h:1.6cm<br /><span class="code-lines">4</span>FILL color:red<br /><span class="code-lines">5</span>RECTANGLE x:0 y:-0.8cm w:1.2cm h:0.8cm<br /><span class="code-lines">6</span>HOTSPOT "Create Object" x:0 y:-0.8cm w:1.2cm h:0.8cm<br /></div><br />In this graphrep definition the HOTSPOT triggers the attribute "Create Object" in the area x:[0cm,1.2cm], y:[-0.8cm,0cm] (red rectangle in the screenshot)<br /><br /><img src="http://www.adoxx.org/live/documents/10157/110691/HOTSPOT.PNG/1e21aa91-c435-468b-8be6-1da240beca39?t=1436525548946" /><br /><br /><span style="font-size: 16px"><strong><br /></strong></span>Mehmet Albayrak2015-07-10T08:54:31ZDo on mouse click some graphics...Melanie Schranzhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=3409332015-07-10T07:00:42Z2015-07-10T07:00:42Z<span style="color: #222222"><span style="font-family: arial, sans-serif"><span style="font-size: 12px">Hello, </span></span></span><span style="color: #222222"><span style="font-family: arial, sans-serif"><span style="font-size: 12px"><br /></span></span></span><span style="color: #222222"><span style="font-family: arial, sans-serif"><span style="font-size: 12px">I want my graphical representation (rectangle 1) to open a new rectangle (rectangle 2), when the modeller performs a mouse click on a certain area of rectangle 1. <br />How do I get this reference for the mouse click? <br /></span></span></span><span style="color: #222222"><span style="font-family: arial, sans-serif"><span style="font-size: 12px"><br /></span></span></span><span style="color: #222222"><span style="font-family: arial, sans-serif"><span style="font-size: 12px">Thanks and BR,</span></span></span><span style="color: #222222"><span style="font-family: arial, sans-serif"><span style="font-size: 12px">Mel</span></span></span>Melanie Schranz2015-07-10T07:00:42Z