Toolbox Override default Toolbox IconsToolbox Override default Toolbox IconsRE: Toolbox Override default Toolbox IconsMartin Paczonahttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=13798952018-09-28T08:00:19Z2018-09-28T08:00:13ZThanky you for your help this solution works well =)<br /><br />BR<br />MartinMartin Paczona2018-09-28T08:00:13ZRE: Toolbox Override default Toolbox IconsMateusz Dziedzichttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=13435362018-08-13T07:45:13Z2018-08-13T07:38:48ZOne possibility is to create two different representations in the GraphRep code and switch between them using an attribute e.g. „Representation“ (type: Integer). For example you can set Representation to 0 by default and define the GraphRep code for the case that Representation=0. This graphical representation will be then shown in the Toolbox. If you want to model and thus create an instance of the specific class, then you can use an event to change the value of the Representation variable to 1. Then you can define a different graphical representation in the GraphRep attribute for the case Representation = 1.<br /><br />Example: Different representation for the class „W“ in the Toolbox and the Modelling area:<br />1. Create an attribute “Representation” of type integer for the class „W“<br /><br />2. Define the code in the GraphRep attribute for the 2 different cases:<div class="code"><span class="code-lines"> 1</span>GRAPHREP layer:-1 sizing:asymmetrical<br /><span class="code-lines"> 2</span><br /><span class="code-lines"> 3</span>#get the value of Representation attribute (0 by default) and assign it to the variable rep<br /><span class="code-lines"> 4</span>AVAL rep:"Representation"<br /><span class="code-lines"> 5</span><br /><span class="code-lines"> 6</span>IF (rep = "0") {<br /><span class="code-lines"> 7</span> #this graphical representation will be shown in the Toolbox<br /><span class="code-lines"> 8</span> FILL color:blue<br /><span class="code-lines"> 9</span> POLYGON 3 x1:-1cm y1:1cm x2:0cm<br /><span class="code-lines">10</span> y2:-1cm x3:1cm y3:1cm<br /><span class="code-lines">11</span> ATTR "Name" x:0cm y:1cm w:c<br /><span class="code-lines">12</span>}<br /><span class="code-lines">13</span>ELSIF (rep = "1") {<br /><span class="code-lines">14</span> #this graphical representation will be shown in the Modelling area<br /><span class="code-lines">15</span> SHADOW off<br /><span class="code-lines">16</span><br /><span class="code-lines">17</span> FILL color:blue<br /><span class="code-lines">18</span> ELLIPSE x:0.00cm y:0cm rx:1cm ry:1cm<br /><span class="code-lines">19</span> FILL color:yellow<br /><span class="code-lines">20</span> ELLIPSE x:0.00cm y:0cm rx:0.5cm ry:0.5cm<br /><span class="code-lines">21</span><br /><span class="code-lines">22</span> ATTR "Name" x:0.00cm y:1.0cm w:c<br /><span class="code-lines">23</span>}<br /></div><br />3. Go to Library attributes→Add-ons and add the event „CreateInstance“ to the External coupling:<div class="code"><span class="code-lines"> 1</span>ON_EVENT "CreateInstance" {<br /><span class="code-lines"> 2</span> CC "Core" GET_CLASS_NAME classid:(classid)<br /><span class="code-lines"> 3</span> #--> RESULT ecode:intValue classname:strValue isrel:intValue<br /><span class="code-lines"> 4</span> <br /><span class="code-lines"> 5</span> IF (classname = "W") {<br /><span class="code-lines"> 6</span> #if an object of class "W" is created then the value of the "Representation" attribute is changed to 1<br /><span class="code-lines"> 7</span> CC "Core" SET_ATTR_VAL objid:(instid) attrname:("Representation") val:(1)<br /><span class="code-lines"> 8</span> }<br /><span class="code-lines"> 9</span>}<br /></div>Mateusz Dziedzic2018-08-13T07:38:48ZToolbox Override default Toolbox IconsMartin Paczonahttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=13427672019-01-09T13:28:39Z2018-08-12T10:57:30ZHello,<br /><br />Is there a possiblity to overwrite the default toolbox represenation by defining a graphrep which is only used for the toolbox represenation?<br />This means i want to have a graphrep for the toolbox icon and one graphrep which is used for modeling.<br /><br />By default as you can see in the attached picture adoxx the toolbox and modeling editor represenation is similar.<br /><br />(I use adoxx Version 1.5)<br /><br />Thank you for your help.<br /><br />BR<br />MartinMartin Paczona2018-08-12T10:57:30Z