Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: st33ve on June 20, 2014, 08:27:31 pm

Title: Put image file to diagram
Post by: st33ve on June 20, 2014, 08:27:31 pm
Can I place an image to diagram via automation API? I have an EMF file that I want to be displayed in a diagram. I suppose that I need to interact with image manager, but I don't know how.

Thanks

Stepan
Title: Re: Put image file to diagram
Post by: qwerty on June 21, 2014, 10:55:03 pm
Unfortunately there is no direct handling via the API. You need to to the following:

q.
Title: Re: Put image file to diagram
Post by: st33ve on June 23, 2014, 08:54:37 pm
Hi,

thank you. One last thing - there is no Repository.Execute. Did you mean Repository.SQLQuery? Unfortunatelly, the method does not allow query parameters, only SQL string. Therefore, there is problem with binary data encoding. I want to avoid database specific code, but it is probably impossible.

S.
Title: Re: Put image file to diagram
Post by: Stefan Bolleininger on June 23, 2014, 09:19:50 pm
Hi Stepan,

Repository.Execute is an "unsupported" command. It can be used for updating the SQL-tables. As it is unsupported, it is not declared within the documentation. Within the forum you may find many topics related to the function of this command.

Best regards

Stefan
Stefan
Title: Re: Put image file to diagram
Post by: qwerty on June 24, 2014, 01:12:37 am
To circumvent the parameter issue I used native access to the database (or at least ODBC). Since I'm used to Perl there are libraries which allow to supply parameterized queries. The connection string can be retrieved via Repository.ConnectionString();

q.