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

Forward Migration Parameter Change

JGoode
Advocate
Hello,

I finally got forward migration working but I have one small issue. Due to the fact that I have a parameter which contains the ArchiCAD version number the old value from the parameter carries through. Is there a way to change the parameter value when migrating? If so what it the script and in which object should I place it? The reference guide doesn't really explain very well.

Thanks
ArchiCAD 23

Windows 10
5 REPLIES 5
Barry Kelly
Moderator
In the Migration script you just do the old parameter setting routine.

if actualGuid = _startID_1 then

archicad_ver = REQ("GDL_version")
PARAMETERS archicad_ver = archicad_ver

actualGuid = _endID

endif

I would use the REQ("GDL_version") but you could just hard code the number as well.

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
JGoode
Advocate
Barry wrote:
In the Migration script you just do the old parameter setting routine.

if actualGuid = _startID_1 then

archicad_ver = REQ("GDL_version")
PARAMETERS archicad_ver = archicad_ver

actualGuid = _endID

endif
I would use the REQ("GDL_version") but you could just hard code the number as well.

Barry.
Hi, this didn't seem to work for me. No errors or anything, it just didn't work.
ArchiCAD 23

Windows 10
Barry Kelly
Moderator
OK this is your code you posted before.
Fill in your GUID numbers and change "achicad_ver" for the name of the parameter you are using in your object for the version number.
actualGuid = FROM_GUID 
 if actualGuid = "???????????" then 

archicad_ver = REQ("GDL_version") 
PARAMETERS archicad_ver = archicad_ver

 actualGuid = "???????????" 
 endif 
 SETMIGRATIONGUID actualGuid
It could also be because your version number parameter is not a numerical variable but is a string variable?
In that case just use ...
archicad_ver = "21"
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
JGoode
Advocate
Barry wrote:
OK this is your code you posted before.
Fill in your GUID numbers and change "achicad_ver" for the name of the parameter you are using in your object for the version number.
actualGuid = FROM_GUID 
 if actualGuid = "???????????" then 

archicad_ver = REQ("GDL_version") 
PARAMETERS archicad_ver = archicad_ver

 actualGuid = "???????????" 
 endif 
 SETMIGRATIONGUID actualGuid
It could also be because your version number parameter is not a numerical variable but is a string variable?
In that case just use ...
archicad_ver = "21"
Barry.
I tried this exact code both the hardcode and the REQ command but neither of those worked for some reason. I just hardcoded it into my 21 object so it just refreshes script upon migration.

Thanks
ArchiCAD 23

Windows 10
Barry Kelly
Moderator
The only other thing I can think of is you may need to check that the old object has the parameter and get its value before you change it.
actualGuid = FROM_GUID 
 if actualGuid = "???????????" then 

xx = DELETED_PAR_VALUE ("archicad_ver", archicad_ver)

archicad_ver = REQ("GDL_version") 
PARAMETERS archicad_ver = archicad_ver 

 actualGuid = "???????????" 
 endif 
 SETMIGRATIONGUID actualGuid
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