GDL
About building parametric objects with GDL.

How to migrate OFF Archicad library object?

Sam Karli
Enthusiast

I have the following, I guess, quite tipical task:

We have placed numerous instances of an Archicad generic library part, and these object are to be upgraded -some new functionality, including new parameters, must be added. These parameters' default walues depend on the current settings of the already placed instances, so its' obvious that a Forward Migration Script should be used.

But here comes the problem: there are two options:

-automigrate, that is, as I understand, ruled out, because during automigration Forward Migration Script is not run. Object is migrated but parameters are not set.

-manual migration, but this seems to be impossible, because for this, I have to remove Archicad Generic Library from Library manager (in order to enable manual migration button to be shown; with other words make Archicad not to see Generic Libraries containing the original object), then press Migrate button. But this loads up Archicad Generic Libraries, too, so the object will not be replaced (since original LibPart is seen there). At the end, this way there will be no migration at all.

 

Do I understand migration a wrong way?

Is there a sollution for this migration? Maybe remove original LibPart from Generic Library?

GDL/Python/C++ dev
8 REPLIES 8
Barry Kelly
Moderator

If you have the correct GUIDs in the migration script, then as soon as you delete the original part from your loaded library, and the object to be migrated to is in your loaded library, migration will occur.

This is all I do with my library objects.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

Miration does occur, but not the right way. By default, FWM script doesn't run, so objects are changed but parameters anen't set (as defined in FWM scirpt's "parameters" commands).

If I press the "Migrate" in Library manager, the first thing it does the loading of the Generic LIbraries with the object I want to replace so no migration.

If there is no other option, I will produce a copy of Generic Library with the original object missing.

GDL/Python/C++ dev

@Sam Karli wrote:

If there is no other option, I will produce a copy of Generic Library with the original object missing.


That is what I said - then as soon as you delete the original part from your loaded library, and the object to be migrated to is in your loaded library, migration will occur.

 

I don't use the 'auto migration' switch at all.

I am not sure what it does, but if it forces the migration even if you don't delete the old object, I can't see the point of that - especially if it doesn't run the migration script..

 

As far as I know, the old object has to be deleted from the loaded library and the new object has to be there.

If the old object still exists in the loaded library, Archicad does not detect the missing GSID and therefore does not migrate to the new object.

 

 

And if you have searched for old parameter values in the forward migration script, and then set the new parameters accordingly, you should have the new object with the new settings that you want.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

So, i tested it throughoutly and still the same.

You don't have to deal with 'AutoMigrate', because by default it's checked. So, when You do anything, the AutoMigrate will occur. But this way the FWM script does NOT run. You can test it with a test parameter and an one-liner script like 

parameters iTest = 1

and checking the test parameter (in this case iTest) value whether it is set or not. At me, it didn't and it's in accordance with the documentation.

So it's the same here.

 

It's frustrating because for a developer because at a company the first problem You'll encounter that they use the generic stuff and for this or that reason it's not enough for them so You will have to augment a part of the Generic Library object, usually with instances already placed to a plan.

 

It seems that the most basic (custom) usage doesn't work.

GDL/Python/C++ dev

So you have a 'Generic' library with objects that you want to replace by migrating them to new objects?

 

This is what I do.

I create the new objects with the forward migration script that will set new parameters based on old settings if need be.

The correct GUIDs are required for the migration.

The auto migrate switch is off.

 

I then create a new 'Generic' library that has the new objects in it and the old objects have been deleted completely.

Archicad then detects the objects are missing and the migration scripts come into play replacing them with the new objects.

 

There is no need then to use the 'Migration' button in the Library Manager.

That I believe is only needed if you want to migrate for one library to the next, to the next, to the next and your migrated object only replaces the one version before it.

 

I just list all of the GUIDs for the old objects in the new one, so they all get replaced if they are missing.

 

BarryKelly_0-1660127701966.png

 

 

Barry.

 

 

 

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

Still the same.

If I uncheck the AutoMigrate checkbox, when I remove the original libpart (while the new one being loaded) the migration will not occur. If I check AutoMigrate, the migration will occur (but without FWM script being executed). 

Dunno what the difference is.

GDL/Python/C++ dev

Make sure the GSID of the new object is not in the list of GSID to migrate.

Only the GSIDs of the old parts that are no longer in your library must be in that list.

As you can see in my image the '_endID' is not in the list of objects to be migrated.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

The migrate button is only a shortcut to change libraries in the library manager. It detects previous versions' Archicad libraries, unloads them, and adds the current and the migration libraries. It doesn't explicitly start the migration process.

 

The migration process is run when library parts become missing (library reload, hotlink or copy-paste from another file). If there are loaded library parts whose migration table refer to a missing library GUID, the FWM script will be run.

 

 

Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest