![]() |
Adding a BindingRepresentation through the API |
Post Reply
|
| Author | |
Simon_VM
Contributor
Joined: 29.Nov.2011 Points: 11 |
Post Options
Thanks(0)
Quote Reply
Topic: Adding a BindingRepresentation through the APIPosted: 29.Nov.2011 at 22:39 |
|
Hello,
I've created a small language for production systems (these production systems can assemble APC's) using MetaEdit+, and I'm trying to simulate my models using the API. One of the things that needs to be done is that an operator needs to be moved to another machine. The relationship looks like this: MachineOperator --> MachineOperatorToProcessor --> Processor I can remove the old binding and its representation, as well as create a new one. However, I cannot create a new representation for it. My code runs just fine, but when I try to open my model in MetaEdit+, it gives me the following error: "Unhandled exception: Message not understood: #- Press Proceed (if shown) to attempt to ignore the error and continue. ..." The proceed option doesn't work and I'm basically left with a corrupted model. I cannot open the diagram representation anymore, the matrix representation however does still work. It shows there that the new binding has been created (so the operator conceptually moved, it just can't show it for some reason). Here is the relevant part of my code (I'm working in Python with the suds library). 'self.instance' is the object MEOop of the operator, 'self.parent.diagram' is the diagram representation MEOop of the Graph I'm working on. The objectID and areaID of the binding are hardcoded for performance reasons. Obviously this will have to change, but they are the correct values.
Can someone tell me what I'm doing wrong? Thanks! |
|
![]() |
|
stevek
MetaCase
Joined: 11.Mar.2008 Points: 643 |
Post Options
Thanks(0)
Quote Reply
Posted: 29.Nov.2011 at 23:01 |
|
Just a quick check before looking into the details: do you have the reprCreationAPI.mep patch?
If you post (or email metaedit.support@metacase.com) the meplus0.err file, that will give us more information. Thanks, Steve
|
|
![]() |
|
Simon_VM
Contributor
Joined: 29.Nov.2011 Points: 11 |
Post Options
Thanks(0)
Quote Reply
Posted: 29.Nov.2011 at 23:09 |
|
Yes, I forgot to tell you that I have installed the patch.
I have attached the meplus0.err file: http://www.metacase.com/forums/uploads/294/meplus0.txt. Thanks for the help! |
|
![]() |
|
stevek
MetaCase
Joined: 11.Mar.2008 Points: 643 |
Post Options
Thanks(0)
Quote Reply
Posted: 30.Nov.2011 at 14:43 |
|
From the error log, it looks like the resulting BindingRep's place is null. The simplest cause for that would be that the place argument in the last line was null (presumably an MEAny containing an MENull)? Given that you're getting the place from a hard-coded MEOop, perhaps that MEOop is long dead (or was never fully initialized)? The correct format for a place is an MEAny with meType=Point and meValue=10,20 (i.e. x,y - note no space after the comma).
|
|
![]() |
|
stevek
MetaCase
Joined: 11.Mar.2008 Points: 643 |
Post Options
Thanks(0)
Quote Reply
Posted: 30.Nov.2011 at 14:58 |
|
...and it looks like the API place method is returning an MEAny that doesn't fit that format - it adds single quotes around the meValue. So, for now the quickest solution is to remove any extra quotes from the meValue string you get back from the place(relRep) call. And of course we'll make sure that the conversion between Point and MEAny is corrected in the next release - thanks for pointing this out!
|
|
![]() |
|
Simon_VM
Contributor
Joined: 29.Nov.2011 Points: 11 |
Post Options
Thanks(0)
Quote Reply
Posted: 01.Dec.2011 at 22:56 |
|
Thanks for your help, that seems to work!
![]() |
|
![]() |
|
stevek
MetaCase
Joined: 11.Mar.2008 Points: 643 |
Post Options
Thanks(0)
Quote Reply
Posted: 02.Dec.2011 at 12:25 |
|
That's great, thanks for letting us know! And many thanks for reporting this, the fix is implemented and will be in the next 5.0 beta.
|
|
![]() |
|
djuka
Major Contributor
Joined: 22.Jun.2011 Location: Germany Points: 33 |
Post Options
Thanks(0)
Quote Reply
Posted: 27.Apr.2012 at 11:50 |
|
Hello !
Does anybody maybe have C# function that uses API and: - creates object; - creates properties; - sets some properties; and - defines visual presentation with one text (type) and one bitmap ? It would save my time. Regards, Djuka |
|
![]() |
|
xingqing
Member
Joined: 15.May.2012 Points: 1 |
Post Options
Thanks(0)
Quote Reply
Posted: 15.May.2012 at 11:50 |
|
Thank you for all the things learned from here and congratulations for the good work.
|
|
![]() |
|
Post Reply
|
|
| Tweet |
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |