Double-clicking a design variant calls a macro specified as follows:
<FMVInfo MacroHicPath ="c"
MacroAddPath ="Bsp\Designvarianten"
MacroFileName ="Func_ModifyVariant.Mac"
MacroOsPath ="m:\Daten\Ztl\Bsp\
Designvarianten"/>
These entries can, of course, be combined with 'FeatName'.
The following macro changes the data of a variant:
FUNC delete activePart |
|
FUNC Part activePart |
Note the active part, |
FUNC active-Part.StoreActive() |
to be able to update it at the end. |
rem variant feature |
|
FUNC delete varFeat |
|
FUNC VariantFeature varFeat |
Object for a variant feature |
FUNC varFeat.Init() |
Initialisation with the variant feature from the last double click. You can also initialise the feature using a part and a feature ID: FUNC varFeat.Init(activePart, %id) |
FUNC delete params |
|
FUNC Variables params |
Object for the parameter variables of the variant |
FUNC var-Feat.GetParameters (params) |
Get parameter variables of the variant |
FUNC params.SetRealVar ("diameter", 30) |
Change value of a variable. |
FUNC var-Feat.SetParameters (params) |
Write parameter variables back |
|
At this point, no data has been changed in HiCAD. Copies of the original data are used |
FUNC var-Feat.Commit() |
Transfer of the data to the HiCAD data Without the following update, you will now see, in the feature log, an * on the variant feature and the new data in the feature, as for changes without automatic recalculation. |
rem update |
|
FUNC active-Part.update() |
Recalculating the part with the new data |
FUNC delete active-Part |
|
FUNC delete varFeat |
|
FUNC delete params |
|
The data in the FMV file are XML files. This means that the double quotation marks must not contain any arbitrary characters. In particular, they must not contain umlauts or '<'resp. '>'. There are replacement codes for these characters.
© Copyright 1994-2018, ISD Software und Systeme GmbH |