08-06-2016 11:17 AM
14-10-2016 02:14 PM
Hi Gregory,
This is regarding the solution you've given me for message flow creation:
http://community.mega.com/t5/Technical-Product/Diagram-API-Message-Flow-Creation/m-p/12717#M2458
Am trying to insert message flow twice on the diagram (which is possible from V1R3 cp13 on Application environment diagram)
//this part is working fine am able to see the link on diagram
Set flowdrawingitem1 = mydrawing.megaobjectinsert(myflow)
set parentdrawingitem1 = flowdrawingitem1.ItemProperty("ParentDrawingItem")
//This part is not working the parent drawing item is null here
Set flowdrawingitem2 = mydrawing.megaobjectinsert(myflow)
set parentdrawingitem2 = flowdrawingitem2.ItemProperty("ParentDrawingItem")
how I can I place a message flow object twice on diagram
Can you please help me to fix this.
21-06-2016 11:45 AM
hi,
Can you please tell me How I can set customized line style and Draw Line Points to the newely created object.
I already have a link on diagram. I need to draw the new line just on the same points.
How can I get the draw line points og old link, and how I can draw new line on same points.
Set oLineStyle = oDrawingItem.LineStyle //get old line style
parentdrawingitem.LineStyle = oLineStyle //set style to new line
parentdrawingitem.ItemProperty("DrwLine_Points") = oDrawingItem.ItemProperty("DrwLine_Points") //assign draw line points
The above code is not working for me.
Thanks in advance.
10-06-2016 04:32 PM
Thanks Gregory. It worked for me 🙂 .
08-06-2016 02:55 PM
Hi,
First you need to create the message flow and connect the sender and receiver using the standard MEGA API.
Then add the message flow to the diagram by calling the "megaobjectinsert" method on the drawing object (the sender and receiver must be in the diagram already).
This method returns a DrawingItem object that you can use to position the object nicely in your drawing.
Set myFlow = getcollection("message flow").create
myflow.getcollection("Source Element").add getobjectfromid("~16ixex(JNzp5[Management System] ")
myflow.getCollection("Target Element").add getobjectfromid("~Azr9AZ2KN5X6[Customer] ")
Set mydiagram = getobjectfromid("~v5oxSz(JNH0T[Application Environment Diagram] ")
set mydrawing = mydiagram.drawing("RW")
Set flowdrawingitem = mydrawing.megaobjectinsert(myflow)
'removing all points except both ends to make the line straight
set parentdrawingitem = flowdrawingitem.ItemProperty("ParentDrawingItem")
set flowpoints = parentdrawingitem.ItemProperty("DrwLine_Points")
For i = 1 to flowpoints.count - 2
flowpoints.removepoint(1)
Next
parentdrawingitem.ItemProperty("DrwLine_Points") = flowpoints
mydrawing.flush
mydiagram.open
Gregory