MetaCase Homepage
Forum Home Forum Home > > MetaEdit+
  New Posts New Posts RSS Feed - Move a Type between Projects
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Move a Type between Projects

 Post Reply Post Reply
Author
Message
jlafer View Drop Down
Member
Member
Avatar

Joined: 29.Jan.2012
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote jlafer Quote  Post ReplyReply Direct Link To This Post Topic: Move a Type between Projects
    Posted: 15.Nov.2016 at 20:00
Hello,

Is there a way to move a few Types defined in one project to another project? Both projects are in the same repository. I am doing refactoring and would like to organize (and eventually secure) the projects differently.

Thanks,
John
Back to Top
stevek View Drop Down
MetaCase
MetaCase
Avatar

Joined: 11.Mar.2008
Points: 641
Answer Answer
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevek Quote  Post ReplyReply Direct Link To This Post Posted: 15.Nov.2016 at 23:28
Hello John, 

You can certainly make a repository where those types would be in a different project: create a new repository with the desired projects, and use Type Manager to export types, separating them into a file per desired project. The later files can also contain types from earlier files: they'll just be updated, without changing the project they are in. You can then export and import the models similarly with Graph Manager. In both phases an easy way to separate things as you want is to create a new temporary graph type or graph that refers to just the elements you want in a given project.

Actually changing the project of a type or instance in-place in a repository isn't possible. The problem is the references from other objects, e.g. every instance refers to its type by pointing to the type's area ID and object ID. If the type were moved to a new project, all those references would break. For instances, you can effectively achieve a move within a repository by copying with Replace to correct the references, then deleting the original (see the recent question on moving a graph between projects); for types this option isn't available, as having an identical duplicate type would be illegal. 

You can of course simply create a new type with the same user-visible name, if you don't have instances that you need to maintain. You'd then just need to edit the other types that refer to the original, making them point to the new one instead (Type Info will show you what needs doing). Renaming the old type by appending XXX helps avoid the confusion of two types with the same name. 

All the best,
Steve
Back to Top
jlafer View Drop Down
Member
Member
Avatar

Joined: 29.Jan.2012
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote jlafer Quote  Post ReplyReply Direct Link To This Post Posted: 16.Nov.2016 at 06:41
Thanks Steve. Putting the types to be moved in a temporary project for use in the Type Manager made that a simple operation.

Regards, John
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.05
Copyright ©2001-2022 Web Wiz Ltd.

This page was generated in 0.063 seconds.