How to move exisiting elements between packages with an EA Addin in c#?

為{幸葍}努か 提交于 2019-12-10 14:43:15

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!