The Backward Migration Script


Via the Backward Migration script you can define the backward conversion logic converting new object instances to older ones.
For more and detailed information, please take a look at the section called “Backward Migration script”.

Example:

targetGUID = TO_GUID

! ==============================================================================
! Subroutines
! ==============================================================================

gosub "migrationstepname_BWM"

! ==============================================================================
! Set Migration GUID
! ==============================================================================

setmigrationguid targetGUID

! ==============================================================================
end ! end ! end ! end ! end ! end ! end ! end ! end ! end ! end ! end ! end ! en
! ==============================================================================


! ==============================================================================
! migrationstepname
! ==============================================================================
"migrationstepname _BWM":
    if targetGUID # "" then
        bMigrationSuccess = 1
        if bMigrationSuccess = 1 then
            oldParameter = newParameter
            parameters oldParameter = oldParameter
        else
            targetGuid = ""
        endif
    endif
return
				


TO_GUID is the global variable holding the main ID of the target element in the conversion.


Use the SETMIGRATIONGUID command for setting targetGUID.

NEWPARAMETER

NEWPARAMETER "name", "type" [, dim1 [, dim2]]

Adds a new parameter to the parameters of a library part in the Backward Migration Script.
The parameter creation happens only after the full interpretation of the script.
If a parameter with the given name already exists in the parameters list, an error occurs.

name: string expression, name of the parameter to be created.

type: string expression, type of the parameter. Possible values are:
Integer
Length
Angle
RealNum
LightSwitch
ColorRGB
Intensity
LineType
Material
FillPattern
PenColor
String
Boolean

dim1, dim2: 
dim1 is the first dimension of the parameter, 0 if not set. dim2 is the second dimension of the parameter, 0 if not set.
dim1 = 0, dim2 = 0: the parameter is a scalar parameter,
dim1 > 0, dim2 = 0: the parameter is a 1 dimensional array,
dim1 > 0, dim2 > 0: the parameter is a 2 dimensional array,

If dim2 > 0, then dim1 > 0.