Reconnect Edge Tool - What is the Variable for "the previous target"? [message #1832403] |
Thu, 17 September 2020 09:28  |
Eclipse User |
|
|
|
I'm trying to write a reconnect edge tool between two objects that have their inputs and outputs stored as bi-directional lists.
When editing the .odesign file, I can set and unset. So I believe I need to use a Service to help me.
Trouble is, when I reconnect an edge that existed between S1 and T1 and I want to connect S1 to T2, I need to do the following:
1) go to T1 and remove S1 from its input list (which will automatically remove T1 from S1's output list)
2) Go to T2 and add S1 to its input list (which will automatically add T2 to S1's output list)
Step 2) seems easier, because I've already done that when I created the edge to begin with. and the odesign set method seems to understand that it's adding an element to a list. Maybe unset understands removing an element from a list as well when the feature is a list - but I need to know what element to remove (the previous target)
I'm stuck on step 1 however. I can't figure out what the variable is called to send to my service for T1. I would call T1 the "previous target". That's not preTarget mind you - i.e. the evaluation candidate for the new Target, it's the "previous target" - like the target that existed in the previous connection.
element, source, and target variables seem to only be aware of what the new target is - but have no knowledge of what the previous target was.
Without that knowledge, I can't write the service.
|
|
|
|
|
Re: Reconnect Edge Tool - What is the Variable for "the previous target"? [message #1833118 is a reply to message #1832434] |
Fri, 02 October 2020 11:42  |
Eclipse User |
|
|
|
Thank you very much for the link. This helped a lot and I have it working now.
I did use a java services call to pass these mentioned variables to so I could debug through the process and make sure I understood what object each variable was referring to. I got all of them backwards at least once, so being able to step debug through it helped too.
But once I wrapped my head around it, I was able to do it, like you suggested, without the use of a java service.
|
|
|
Powered by
FUDForum. Page generated in 0.04638 seconds