问题
I am working on an EA Addin in c# (thanks Geert) and would like to move exisiting elements from a package to another using the code.
It is clear how to add or delete elements to/from EA.Collection p.Elements, but this does not work sincethis procedure changes the GUID of the element.
Is it possible at all?
回答1:
Yes. You simply need to change the packageId
property to be that of the new package and you're done. Don't forget the update()
after you changed it.
Additionally you can change the position in the browser with TreePos
in which case you should explicitly number all elements that are listed for the according package. Ordering ad hoc will likely produce strange results since the sort order in EA is - I have no words for that ;-)
来源:https://stackoverflow.com/questions/28819597/how-to-move-exisiting-elements-between-packages-with-an-ea-addin-in-c