Export "Atom channel connections" to XML

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
EDstudent
Posts: 5
Joined: Tuesday 10 June, 2014 - 09:36

Export "Atom channel connections" to XML

Post by EDstudent »

Hello,

is it possible to save the information "channel c of atom x is connected to channel y of atom z" to XML? Or to any other files/databases..

Thx for answers!
Nick
Posts: 48
Joined: Saturday 15 February, 2014 - 01:52

Re: Export "Atom channel connections" to XML

Post by Nick »

Hi ED Student,

There are multiple ways to write data from ED to an external source:

Connect with a database

Enterprise Dynamics is capable of communicating (reading and writing) to any kind of database (as long as it has an ODBC driver available). The Database Connection atom assists you in creating such connection with a database. It allows you to connect to a Paradox® table, but also to a Microsoft Access® database. After making a connection to the database you are able to view a database table, or a database query (and to change data within this table or query).

Write to Excel with the ExcelActivX atom

Enterprise Dynamics is capable of communicating (reading and writing) to Microsoft Excel®. The ExcelActiveX atom allows you to define to which Excel sheet you want to read or write individual data, or an entire table at once.

Incontrol Academy - Quickstart guide to XML

http://academy.incontrolsim.com/downloa ... nload.html

The code below returns the atom/inputchannel based on the selected atom/outputchannel. This example is just to give you an idea of the possibilities of ED:

Code: Select all

Do(
 Var([channelc], vbValue, 2), {output channel c = 2} 
 Var([atomx], vbValue, Animatom), {atom x = selected animatom }
 Concat([output-channel ], Valuetostring(channelc),[ of atom ],name(atomx),[ is connected to input-channel ],  ValuetoString(OCICNo(channelc,animatom)), [ of atom ], name(Out(1,animatom)))
)
Selected Server5 as animatom returns:

output-channel 2 of atom Server5 is connected to input-channel 3 of atom Sink4

To test it yourself:
Open the attached example model.
Copy the code to the 4DScript Interact (shift+F6)
Select Server5 and click 'Execute'

Regards, Nick
Attachments
exampleOCIC.mod
(4.87 KiB) Downloaded 270 times
EDstudent
Posts: 5
Joined: Tuesday 10 June, 2014 - 09:36

Re: Export "Atom channel connections" to XML

Post by EDstudent »

Hi Nick,

thank you for your detailed reply! Your code-example helps me a lot.

BR, EDstudent
Post Reply