The Global Archicad Community

Stay informed. Get help. Share your knowledge.

Everything about using Libraries and Library Parts - Doors/Windows/Objects/Stairs etc. (Example: How can I display a Transom above my Door?)

Moderators: ejrolon, Barry Kelly, Karl Ottenstein, LaszloNagy, gkmethy, Gergely Feher

By JaseBee
#273988
Ok, I've trawled ArchiTalk and looked at all the migration related posts I could find.

I can't seem to get an old parameters value to be assigned to the new one...

I've got this in the forward migration of the new one, the old one in the parameter tab and it correctly replaces the right part.

[code]
_sActualGUID = FROM_GUID
_sStartGUID = "702C61AD-000F-854B-9C83-AA30EB63E947"!19ver
_sEndGUID = "9B974D0B-BCA4-494E-83F8-8EB7604807E9"!21ver
IF _sActualGUID = _sStartGUID THEN
PRINT "PRINT"
_OldNode = 0
check_migration = DELETED_PAR_VALUE ("node_x1", _OldNode)
nX1 = _OldNode
PARAMETERS nX1 = nX1


_sActualGUID = _sEndGUID
ENDIF
SETMIGRATIONGUID _sActualGUID
[/code]


Where "node_x1" is being replaced with "nX1" (did a total format on my whole library parameter naming scheme and this is the last step, probably should her checked it first).

I've tried various versions of this and they all seem to result with the part swapping over and just coming in with the new ones default values...

Any help would be much appreciated. Thanks.
#273990
I don't think you need to set _OldNode = 0
I don't do this when I am migrating.

Also you definitely have a parameter called "node_x1" in the old object?
And "nX1" is in your new object.

Here is a bit of script I have in one of my objects.
basically the same as you have.
Code: Select all
		xx = DELETED_PAR_VALUE ("tile_on", tile_on_old)

		if tile_on_old = 1 then
			wall_tile_swch = 1
			hob_tile_swch = 1
		else
			wall_tile_swch = 0
			hob_tile_swch = 0
		endif
		
		PARAMETERS wall_tile_swch = wall_tile_swch, hob_tile_swch = hob_tile_swch
Also comment or delete the PRINT "PRINT" line.
I am not sure it will do anything anyway - will you get a message?

You will know if it has worked if your object swaps which you say it is doing.

Barry.
#273996
Thanks for the quick reply and suggestions Barry.

That snippit was the latest test of my code, I had previously tried it without the _OldNode = 0 and the PRINT "PRINT" I forgot to get rid of, it was part of a few PRINT commands to see which parts of the script were running and what values were present. Inconsequential as I never got any readouts from it. The node_x1 parameter is present in the previous version.

I shall have another go with the suggestions you mentioned. Thanks.
#274000
Ok, I got it working.

Tried all you suggestions Barry, unfortunately no avail. But then I ticked the "Auto Migration" to Off, (for some reason I decided to tick it on thinking auto migration would be a good thing, apparently not). Not sure if this is just in 21 or all versions.

So it seems to be functioning properly now, I'm going to put my IF check_migration > 0 THEN replace parameter back in as I just have a blanket list of parameters that have shifted and I'm too lazy to individualise it for each object.

Hope it works, Thanks again Barry.
#274026
I have no idea what "auto migration' does.
Can't even see anything about it in GDLCenter or HelpCenter

I just leave it off as well.

Barry.
#274089
Automigration is a special type for migration: it simply does an ID change, without running migration scripts. It is useful to eliminate migrations from new elements, and create step-by-step migration logic through many versions.
#274105
Gergely Feher wrote:Automigration is a special type for migration: it simply does an ID change, without running migration scripts. It is useful to eliminate migrations from new elements, and create step-by-step migration logic through many versions.
Thanks Gergely.
Good to know.

Barry.