Sets the value of a property value from a passed string.

    GSErrCode  ACAPI_Property_SetPropertyValueFromString (
		const GS::UniString&				propertyValueString,
		const API_PropertyConversionUtilsInterface&	conversionUtils,
		API_Property*					property



[in] The string from which the new value will be generated.
[in] The implementation of API_PropertyConversionUtilsInterface.
[in/out] The property whose value we want to set.


Return Values

The function has completed with success.
The API_Property is nullptr, the property definition does not exist or the value creation from the string failed.
The property definition is invalid.

For other common API errors see the API Errors document.



class PropertyConversionUtils : public API_PropertyConversionUtilsInterface {
	const GS::UniString degreeSymbol	= " ";
	const GS::UniString minuteSymbol	= "'";
	const GS::UniString secondSymbol	= "\"";
	const GS::UniString gradientSymbol	= "G";
	const GS::UniString radianSymbol	= "R";
	const GS::UniString northSymbol		= "N";
	const GS::UniString southSymbol		= "S";
	const GS::UniString eastSymbol		= "E";
	const GS::UniString westSymbol		= "w";

	virtual ~PropertyConversionUtils ();

	virtual const GS::UniString& GetDegreeSymbol1 () const { return degreeSymbol; }
	virtual const GS::UniString& GetDegreeSymbol2 () const { return degreeSymbol; }
	virtual const GS::UniString& GetMinuteSymbol () const { return minuteSymbol; }
	virtual const GS::UniString& GetSecondSymbol () const { return secondSymbol; }

	virtual const GS::UniString& GetGradientSymbol () const { return gradientSymbol; }
	virtual const GS::UniString& GetRadianSymbol () const { return radianSymbol; }

	virtual const GS::UniString& GetNorthSymbol () const { return northSymbol; }
	virtual const GS::UniString& GetSouthSymbol () const { return southSymbol; }
	virtual const GS::UniString& GetEastSymbol () const { return eastSymbol; }
	virtual const GS::UniString& GetWestSymbol () const { return westSymbol; }

	virtual GS::uchar_t					GetDecimalDelimiterChar () const { return '.'; }
	virtual GS::Optional<:unichar>	GetThousandSeparatorChar () const { return ' '; }

	virtual API_LengthTypeID	GetLengthType () const { return API_LengthTypeID::Meter; }
	virtual API_AreaTypeID		GetAreaType () const { return API_AreaTypeID::SquareMeter; }
	virtual API_VolumeTypeID	GetVolumeType () const { return API_VolumeTypeID::CubicMeter; }
	virtual API_AngleTypeID		GetAngleType () const { return API_AngleTypeID::DecimalDegree; }

GSErrCode SetPropertyValue (const GS::UniString>& names)
	API_Property property = CreateIntPropertyDefinition ();
	const PropertyConversionUtils conversionUtils;
	return ACAPI_Property_SetPropertyValueFromString (L("9632 m"),

For more detailed examples, please see the Property_Test add-on.



This function doesn’t modify the database, only fills the API_Property structure with the appropriate values. In order to introduce the new values to the database the add-on has to call ACAPI_Element_SetProperty or ACAPI_Element_SetProperties.



Version: API 25 or later
Header: ACAPinc.h


See Also

API Functions