VariantFeature
Object for working with an existing processing variant.
|
|
|
FUNC |
COM |
SF |
---|---|---|---|---|---|
Init |
Allocates the feature and the body that was double-clicked last to the object. |
void Init ( ) |
1211.2 |
1211.2 |
- |
GetParameters |
Provides the parameter variables of the variant. |
void GetParameters (Variables& v) |
1211.2 |
1211.2 |
- |
SetParameters |
Sets the parameter variables of the variant |
void SetParameters (const Variables& v) |
1211.2 |
1211.2 |
- |
Commit |
Transfers the data to HiCAD. 'set_parameters' sets temporary data only. The modified data will only be taken over into the HiCAD data structure with 'commit'. |
void Commit ( ) |
1211.2 |
1211.2 |
- |
Empty |
Is the object empty? |
bool Empty( ) const |
1211.2 |
1211.2 |
- |
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