Dear Melanie,
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.
You can find the GraphRep documentation and the syntax at the following link:
http://www.adoxx.org/live/adoxx-notation-language-graphrepPlease find below an example library, and the step by step documentation how the implement the scenario.
1) Create Class with Name "A"
2) Create Attribute in the 'Create Object' of type PROGRAMCALL and edit the following parameters:
-Standard value:1CreateObject
-EnumerationDomain: 1ITEM "CreateObject"
2SET n_ObjId: (objid)
3CC "Modeling" GET_ACT_MODEL
4SET nModelId: (modelid)
5CC "Core" GET_CLASS_ID objid: (n_ObjId)
6SET nClassId: (classid)
7CC "AdoScript" EDITBOX text:"Enter object name!" title:"Enter object name!"
8SET sName: (text)
9CC "Core" CREATE_OBJ modelid: (modelid) classid: (nClassId) objname: (sName)
10#-->RESULT ecode:intValue objid:intValue
11SET sNewObjId: (objid)
12#Object names have to be unique
13 IF (ecode!=0) {
14 CC "AdoScript" ERRORBOX "The Name You have Chosen is not Unique!"
15 EXIT
16 }
17#Position the created new object
18CC "Core" GET_ATTR_VAL objid: (n_ObjId) attrname:"Position"
19SET sObjpos: (val)
20LEO parse: (sObjpos)
21 get-str-value:xPos:"x"
22 get-str-value:yPos:"y"
23SET xNewPos: ((VAL xPos) + CM 4)
24SET yNewPos: ((VAL yPos) + CM 3)
25CC "Modeling" SET_OBJ_POS objid: (sNewObjId) x: (xNewPos) y: (yNewPos)
3) Define GraphRep
1GRAPHREP
2FILL color:green
3RECTANGLE x:-1.2cm y:-0.8cm w:2.4cm h:1.6cm
4FILL color:red
5RECTANGLE x:0 y:-0.8cm w:1.2cm h:0.8cm
6HOTSPOT "Create Object" x:0 y:-0.8cm w:1.2cm h:0.8cm
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)