Folks,
I wonder if this is a bug with model imports when there is only a single root.
EA enforces a 'rule' that there must be a project root, even if there is nothing else in the project. It seems that EA 'protects' this initial node from deletion. More specifically, although I can create additional root nodes, I cannot ever delete the first such node that EA provided when the project was created. [I can rename the node, just like any other root node, but only root nodes added later can be deleted.]
Please try the following experiment, to help characterize the problem, and see if it is a bug or a 'feature.'
- In your empty model, create another root node. [To do this, right-click the current root node in the Project Browser, and from the context menu choose New Model (root node).]
- Attempt your import with the code you've been using, but change the index of the target node to ...Models.GetAt(1)...
Please let us know if it works.
If it
does work, please also report this directly to Sparx as a bug. My premise here is that if you can import to one of the other root nodes, but not to the default root node, something is broken in the default case. [You might want to report this as a bug even if it does not work. The 'feature' itself seems to be a bug.]
You can make a bug report via the Report a Bug link below the Support link at the
bottom of any forum page. Please quote the title of this thread, and paste in the URL of your post with the results of the above experiment.
IMHO, this should work for
any root node. In particular, since a majority of models have only the default single root, it is most important that it work in that case.
David