#pragma once /** \details Block parameter representing a "free variable" of the assoc network (OdDbAssocVariable) Corresponding C++ library: TD_DynBlocks */ class DYNBLOCKS_EXPORT OdDbBlockUserParameter : public OdDbBlock1PtParameter { public: //DOM-IGNORE-BEGIN ODDB_EVAL_DECLARE_MEMBERS(OdDbBlockUserParameter); //DOM-IGNORE-END /** \details Creates a new instance of an OdDbBlockUserParameter object with default parameters. */ OdDbBlockUserParameter(); /** \details Defines user parameter types. */ enum UserParameterType { /** User parameter type is distance. */ kDistance = 0, /** User parameter type is area. */ kArea = 1, /** User parameter type is volume. */ kVolume = 2, /** User parameter type is floating point value. */ kReal = 3, /** User parameter type is angle. */ kAngle = 4, /** User parameter type is string. */ kString = 5 }; /** \details Gets the associated variable ID. \returns Associated variable ID as an OdDbObjectId object. */ OdDbObjectId assocVarId() const; /** \details Sets an associated variable ID. \param id [in] ID to set. */ void setAssocVarId(OdDbObjectId id); /** \details Gets the user variable name. \returns User variable name as an OdString value. \remarks Returns OdString::kEmpty if variable is NULL or if there is no associated variable for this parameter. */ OdString userVarName() const; /** \details Sets the user variable name. \param name [in] New user variable name as an OdString value. \remarks Returns an error if there is no associated variable for this parameter. */ OdResult setUserVarName(const OdString& name); /** \details Gets the user variable description */ OdString userVarDescription()const; /** \details Sets the user variable description */ void setUserVarDescription(const OdString&); /** \details Gets the expression from the associated variable for this parameter. */ OdString expression() const; /** \details Sets the expression string to the associated variable for this parameter. */ OdResult setExpression(const OdString&); /** \details Gets the user variable type */ UserParameterType userParameterType()const; /** \details Sets the user variable type */ void setUserParameterType(UserParameterType t); /** \details Try to convert input value to the user variable type */ OdResult convertValue(OdDbEvalVariant&)const; /** \details Scale the value according with the parameter type */ static OdResult scaleParamValue(OdDbEvalVariant& value, double scale, UserParameterType t, bool invertScale = false); //static OdDbObjectId create(OdDbObjectId, OdDbObjectId&); //static OdDbObjectId create(OdDbDatabase*, OdDbObjectId&, class AcString&); }; /** \details This template class is a specialization of the OdSmartPtr class for OdDbBlockUserParameter objects. */ typedef OdSmartPtr OdDbBlockUserParameterPtr;