In the System Explorer you can Copy and then Paste an Event Frame.
Any suggestion about How can we do the same with AF-SDK?
Could you describe to us where do you want to paste the Event Frame which you have copied?
If you copy an EventFrame A and paste it on an Event Frame B, Event Frame A would be also a child event frame of Event Frame B. If this is the scenario where you intend to copy and paste, please refer to the methods Add(AFEventFrame item) and Add(AFEventFrame item, AFReferenceType refType) from the AFEventFrames class.
Don’t forget to check in.
To complete what Marcos wrote:
AFReferenceType parentChild = myAFDB.ReferenceTypes["Parent-Child"];
The code snippet below is actually used if you want to paste a reference. However, if you want to copy, it is slightly different. You will need to use other techniques as exporting your EventFrame configuration to xml and then import it. Below there is a code snippet:
AFEventFrame EventFrameA = EventFrameList;
AFEventFrame EventFrameB = EventFrameList;
string xml = myDB.PISystem.ExportXml(EventFrameA, PIExportMode.DefaultValues | PIExportMode.StrongReferences);
myDB.PISystem.ImportXml(EventFrameB, PIImportMode.PasteOperation, xml);
Let me know if you still have any question,
We will use the Export/Import technic...very interesting
We are using EventFrames to represent the product movements between tanks (In a Petrol Refinery). Each EventFrame have a reference to all the elements involved in the movement (Tanks, lines, valves). These Event Frames are automatically generated and managed in a ACE calculation (each valve value change)....
We would like to do a EventFrame copy when there are Tanks involved in the movement.
Retrieving data ...