Properties not working with multiple choice Option Set

Home Forums Problems and solutions in GDL Informations from the environment Properties not working with multiple choice Option Set

Tagged: 

Viewing 6 reply threads
  • Author
    Posts
    • #18255
      James Goode
      Participant

      Hi,

      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

    • #18801

      I’m stuck with the same problem….has anyone found the answer?

    • #18802
      Péter Baksa
      Keymaster

      What is not working exactly?

      Look at the complete example here.

      Péter Baksa
      Library Platform, Software Engineer
      GRAPHISOFT SE

    • #18803

      Hi 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

    • #18804
      Péter Baksa
      Keymaster

      Lukas 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

    • #18805

      So there is no solution at the moment?

    • #18806

      So there is no solution at the moment?

Viewing 6 reply threads
  • The forum ‘Informations from the environment’ is closed to new topics and replies.