C# Script to store to a database

Hi,

I am working on a project where I need to create a new sub-circuit and save it to the database as a new item.

I have managed to save all the data to the database, but I need help with saving the .e3p file to the database. 

Is there any way I can do this or any other way ?

Thanks in advance for your help!

 

0

Comments

5 comments
  • Hi Guest500,

    what do you mean with the sentence "saving the .e3p file to the database"? You want to save a link into a record? The file itself as blob data into a field? Or what?

    Thanks

    Best regards

    mm

  • Hey Michele,

    I mean that I have a newly created sub circuit, and I want to save it to the database so that I can re use it.

    I know I can save a sub circuit to the database using the e3 menu commands in the application, but I want to do it using script.

    Basically if I do it through the e3 application, I will open the DB editor, select 'new component', select new sub circuit, add details and then when I click next, I need to attach an .e3p file, and finally it gives me the option to select to the database. I need help on how to attach the .e3p file to the new component, but using C# script.

    Is there a way?

     

    Thanks!

  • I still did not check if the COM interface has some class/methods to solve this task but I thought about two possible solutions:

    1) Do it manually writing data directly into the database (not so easy and you have to master the .e3p format and the data-model of the database itself.

    2) Create a procedure that controls the application and, using the interface, performs automatically the same operations a user do with mouse and keyboard.

    (I saw an example of solution nr.2 here in Italy, during ZIW 2018 in Bologna).

  • Hey Michele,

    I want to try saving it using script, I can save it manually in the component database, but even there I have no idea how the .e3p file is saved.

    And for the second suggestion, I am working on that one, and that's the place I am stuck. I cannot find any methods that will store a new sub circuit's .e3p file to the database.

    Is there any other way around ?

    Thanks!

  • Maybe I was not clear enough..

    When I said:

    2) Create a procedure that controls the application and, using the interface, performs automatically the same operations a user do with mouse and keyboard.

    I meant to write code to interact with the application through code and not using COM interface.

    It's like the VB command "SendKeys" that sends keystrokes to an application..

    Example: send ALT+F to Word to open the File menu and then send "N" and "D" to create a new blank document. (Office 365)

Please sign in to leave a comment.

Didn't find what you were looking for?

New post