Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Forward Migration to Multiple Objects. Help.

JGoode
Expert
Hello, I am trying forward migrate to enable an old object to change to a new version of the object. The forward migration works but it will only migrate to the variation of the object. For example I have one object with 6 different options inside, I have made 6 new separate objects and when the migration happens, I want it to choose the right object to migrate to but it isn't currently. When I pick option '4' I want it to pick the 4th object but it is only choosing the first option.
actualGuid = FROM_GUID

if (test = t1) then
	IF (actualGuid = "BF01EC6E-D872-48E4-BB8D-A59B1634557A") then
	
		actualGuid = "6A6F3D13-EA87-41D7-86DD-34A6E0C08B83"
	endif
else
	if (actualGuid = "BF01EC6E-D872-48E4-BB8D-A59B1634557A") then
	
		actualGuid = "861BD837-D86A-4752-9462-A564141EA066"
	endif
endif
SETMIGRATIONGUID actualGuid
This code didn't work :S

edit: just tried putting the 2nd part before the first and that didn't work, so it can't be the order of the code.

edit 2: It seems to do it in order of file name, does anyone know how to get this to work?
ArchiCAD 23

Windows 10
11 REPLIES 11
Barry Kelly
Moderator
For those following on at home here is the info I sent JGoode directly (Archicad-talk was playing up and I couldn't post).
Amended files attached as well.
This should work now.
I modified the old test object so it could be a cube or sphere (to easily tell the difference).
I also modified new 1 to be cube and new 2 to be sphere.

In the migration script there was no need for brackets around the … actualGuid=...
I didn't notice this in your original script.

Also when checking the value of the parameter it need to be in quotes as it is a string value (not numerical ... if t1 = "1" then

And I forgot to add the command ... setmigrationguid actualGuid ... at the end of the migration script.


Amended files are attached - I have them in two libraries (folders) - old and new.
Load both.
Place the old object in the plan twice - once as a cube and once as a sphere.
Then delete (un-load) the "old" library and they should replace with each of the new objects.

No there is no need for anything in the Forward Migration script of the old object.
That stays exactly like it is.
In fact it won't even be in your loaded library so there is no need to do anything to it at all.

All you need is the GUID for it in your new objects, so they know when they come across a missing object (because it is not in your loaded libraries) with that GUID it will be replaced with the new object.

Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
JGoode
Expert
Barry wrote:
For those following on at home here is the info I sent JGoode directly (Archicad-talk was playing up and I couldn't post).
Amended files attached as well.
This should work now.
I modified the old test object so it could be a cube or sphere (to easily tell the difference).
I also modified new 1 to be cube and new 2 to be sphere.

In the migration script there was no need for brackets around the … actualGuid=...
I didn't notice this in your original script.

Also when checking the value of the parameter it need to be in quotes as it is a string value (not numerical ... if t1 = "1" then

And I forgot to add the command ... setmigrationguid actualGuid ... at the end of the migration script.


Amended files are attached - I have them in two libraries (folders) - old and new.
Load both.
Place the old object in the plan twice - once as a cube and once as a sphere.
Then delete (un-load) the "old" library and they should replace with each of the new objects.

No there is no need for anything in the Forward Migration script of the old object.
That stays exactly like it is.
In fact it won't even be in your loaded library so there is no need to do anything to it at all.

All you need is the GUID for it in your new objects, so they know when they come across a missing object (because it is not in your loaded libraries) with that GUID it will be replaced with the new object.

Barry.
So if it is just 1 old object migrated to 1 new object, I only have to search for the old object through the 'Migration' tab. If I understand correctly. I assumed I needed to put some code in the forward migration script of the old object.
ArchiCAD 23

Windows 10