Home › Forums › Problems and solutions in GDL › Informations from the environment › Properties not working with multiple choice Option Set
Tagged: Properties
- This topic has 6 replies, 3 voices, and was last updated 4 years, 9 months ago by
Lukas Silvester Oelmüller.
-
AuthorPosts
-
-
October 11, 2019 at 16:43 #18255
James Goode
ParticipantHi,
I have a zone stamp in AC21 that requests properties to display in floor plan.
All works perfectly fine until you select a multiple choice option set and then untick all options.The Graphisoft Zone Stamp seems to not have this issue but I can’t seem to fix it.
Here is the script for this:
============================================================================== ! Get the value(s) of the stored property ! ============================================================================== !======================== 1 _valueString = "" dim _propertyValues[][] _dim1 = 0 _dim2 = 0 n = REQUEST ("Property_Value_Of_Parent", myProperty, _type, _dim1, _dim2, _propertyValues) if n then ! change zeros to ones - it is easier to handle all possible arrays in a double loop if _dim1 = 0 then _dim1 = 1 if _dim2 = 0 then _dim2 = 1 for i = 1 to _dim1 for j = 1 to _dim2 if (i + j) > 2 then _valueString = _valueString + "; " if _type = 4 then ! Type is string - no conversion needed _stringPropValue = _propertyValues[j][i] else ! bool, real, integer types - conversion needed to string _valueToConvert = _propertyValues[j][i] gosub "convertToString" endif _valueString = _valueString + _stringPropValue next j next i endif END ! ============================================================================== !====================================== 1 "convertToString": _stringPropValue = "" if _type = 3 then ! Real number to string _stringPropValue = str ("%.2", _valueToConvert) endif if _type = 2 then ! Integer to string _stringPropValue = str ("%.0", _valueToConvert) endif if _type = 1 then ! Boolean to string if _valueToConvert = 1 then _stringPropValue = <code>True</code> else _stringPropValue = <code>False</code> endif endif return
Any help would be much appreciated.
Thanks
-
May 18, 2020 at 17:21 #18801
Lukas Silvester Oelmüller
ParticipantI’m stuck with the same problem….has anyone found the answer?
-
May 19, 2020 at 07:54 #18802
Péter Baksa
KeymasterWhat is not working exactly?
Look at the complete example here.
Péter Baksa
Library Platform, Software Engineer
GRAPHISOFT SE -
May 19, 2020 at 10:01 #18803
Lukas Silvester Oelmüller
ParticipantHi Péter, I’m using the exact Code you linked…I’m using it for a ZoneStamp.
When I have multiple Options in the parameters I can check several of these. With the linked example only one of the checked boxes is shown…Lukas
-
May 19, 2020 at 11:13 #18804
Péter Baksa
KeymasterLukas I can’t reproduce that in AC23.
James’ problem is still there, the cause is in the example:
REQUEST “Property_Value_Of_Parent” returns an empty array when no options are selected for the option set, overwriting _dim1 causes “Index value greater than array dimension”. This should be an error message but is only shown with “Check Library Parts for Warnings” selected.Péter Baksa
Library Platform, Software Engineer
GRAPHISOFT SE -
May 19, 2020 at 11:24 #18805
Lukas Silvester Oelmüller
ParticipantSo there is no solution at the moment?
-
May 19, 2020 at 11:25 #18806
Lukas Silvester Oelmüller
ParticipantSo there is no solution at the moment?
-
-
AuthorPosts
- The forum ‘Informations from the environment’ is closed to new topics and replies.