VariantFeature

Object for working with an existing processing variant.


Example VariantFeature


Examples VariantFeature

START 59

 

REM Select an edge and check if the edge

REM has been created in a processing variant.

 

REM Objects

FUNC delete sel

FUNC Selection sel

 

FUNC delete edge1

FUNC Edge edge1

 

FUNC delete p1

FUNC Part p1

 

FUNC delete feat

FUNC VariantFeature feat

 

REM Select edge

FUNC sel.SetText("Select edge please")

FUNC sel.Select(edge1)

FUNC %b := edge1.Empty()

if b <> 0 then

    wait aborted

else

    wait Edge selected

ifend

 

REM Provide part for edge

FUNC edge1.GetPart(p1)

 

REM FeatureID of the edge

FUNC %i:= edge1.CreationFeatID()

 

REM Initialise variant feature

FUNC feat.init (p1, %i)

 

REM Check if initialisation was ok.

FUNC %b:= feat.empty()

if (%b <> 0) then

    wait no processing variant feature

else

    wait Processing variant feature

ifend

 

END

 

 

START 59

 

REM Change the parameter of a variant and recalculate part.

 

REM active part

FUNC delete activePart

FUNC Part activePart

FUNC activePart.StoreActive()

 

rem Variant feature

FUNC delete varFeat

FUNC VariantFeature varFeat

FUNC varFeat.Init(activePart, 20)

 

rem Parameter variables of the variant

FUNC delete params

FUNC Variables params

FUNC varFeat.GetParameters (params)

 

rem Change the parameter variables

FUNC params.SetRealVar ("durchmesser", 30)

 

rem Rewrite the parameter variables to the feature object.

FUNC varFeat.SetParameters (params)

 

rem Take over modifications into feature log.

FUNC varFeat.Commit()

 

rem NRecalculation of the part.

rem updaten

rem FUNC activePart.update()

 

FUNC delete activePart

FUNC delete varFeat

FUNC delete params

 

END

Class for Actions (FUNC)