Design forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Forward Migration Parameters Not Updating

JaseBee
Booster
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.


_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



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.
AC 24 5004 AUS
iMac OSX (10.13.6) 4.2ghz i7
8gb ram/8gb vram
6 REPLIES 6

Barry Kelly
Moderator
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.
		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.

One of the forum moderators.
Versions 6.5 to 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

JaseBee
Booster
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.
AC 24 5004 AUS
iMac OSX (10.13.6) 4.2ghz i7
8gb ram/8gb vram

JaseBee
Booster
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.
AC 24 5004 AUS
iMac OSX (10.13.6) 4.2ghz i7
8gb ram/8gb vram

Barry Kelly
Moderator
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.

One of the forum moderators.
Versions 6.5 to 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

Gergely Feher
Newcomer
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.
_________________
Gergely Fehér
Team Leader, Library Team
GRAPHISOFT SE

Barry Kelly
Moderator
Gergely 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.

One of the forum moderators.
Versions 6.5 to 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

Didn't find the answer? Start a new discussion

Labels

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!