Public Member Functions | List of all members
IEditParameterDefinitions Struct Referenceabstract

Provides all of the query functionality of IParameterDefinitions, as well as methods for modifying the parameter definitions. More...

#include <ParametricModeling.h>

Inheritance diagram for IEditParameterDefinitions:
IParameterDefinitions IActiveParameters RefCountedBase IParameterValues RefCounted< IRefCounted > IRefCounted

Public Member Functions

DGNPLATFORM_EXPORT ParameterStatus Add (WCharCP label, ParameterType type, double value, bool hidden=false)
 Creates a new parameter definition of type distance, angle, or scalar. More...
 
DGNPLATFORM_EXPORT ParameterStatus Add (WCharCP label, Int32 value, bool hidden=false)
 Creates a new parameter definition of type integer. More...
 
DGNPLATFORM_EXPORT ParameterStatus Add (WCharCP label, bool value, bool hidden=false)
 Creates a new parameter definition of type boolean. More...
 
DGNPLATFORM_EXPORT ParameterStatus Add (WCharCP label, WCharCP value, bool hidden=false)
 Creates a new parameter definition of type string. More...
 
DGNPLATFORM_EXPORT ParameterStatus Remove (WCharCP accessString)
 Removes the parameter definition with the specified name Removes the parameter definition with the specified internal name. More...
 
DGNPLATFORM_EXPORT ParameterStatus Replace (ParameterDefinitionCR def)
 Updates the parameter definition with the same internal name as the specified parameter definition. More...
 
DGNPLATFORM_EXPORT ParameterStatus SetDomainParameters (ECN::IECInstanceCP domainParams)
 Adds or replaces the domain parameters, or removes them if nullptr is passed. More...
 
DGNPLATFORM_EXPORT ParameterStatus SetExpressionForParameter (WCharCP accessString, IParameterExpressionCP expr)
 Associates an expression with a parameter, or removes an existing expression. More...
 
DGNPLATFORM_EXPORT
ParameterCsvSectionPresenceFlags 
ReadFromCsv (CsvFileR src, ParameterCsvReadContextCR context)
 Reads the contents of the specified CSV of a format compatible with that produced by IParameterDefinitions::WriteToCsv(), and applies the data to these parameter definitions. More...
 
- Public Member Functions inherited from IParameterDefinitions
DGNPLATFORM_EXPORT const_iterator begin () const
 Returns an iterator to the first parameter definition in this collection. More...
 
DGNPLATFORM_EXPORT const_iterator end () const
 Returns an iterator pointing just beyond the last parameter definition in this collection. More...
 
DGNPLATFORM_EXPORT
IEditParameterDefinitionsP 
GetForEdit ()
 Returns an interface for editing the parameter definitions within this collection, or nullptr if editing is not supported. More...
 
DGNPLATFORM_EXPORT ECN::ECClassCP GetDomainClass () const
 Returns the ECClass supplied as domain parameters, or nullptr if no domain parameters are defined. More...
 
DGNPLATFORM_EXPORT UInt32 GetLocalParameterCount () const
 Returns the number of local ("working") parameters defined. More...
 
DGNPLATFORM_EXPORT Int32 GetParameterSortOrder (WCharCP accessString) const
 Retrieves the sorting order of the parameter with the specified access string, or -1 if no such parameter exists. More...
 
DGNPLATFORM_EXPORT ParameterStatus FindByAccessString (ParameterDefinitionR def, WCharCP accessString) const
 Attempts to retrieve the parameter definition with the specified internal name. More...
 
DGNPLATFORM_EXPORT ParameterStatus FindByLabel (ParameterDefinitionR def, WCharCP label) const
 Attempts to retrieve the parameter definition with the specified user-visible name. More...
 
DGNPLATFORM_EXPORT bool IsParameterReferenced (WCharCP accessString) const
 Returns true if the specified parameter is referenced, e.g. by property dependencies, constraints, or expressions. More...
 
DGNPLATFORM_EXPORT
IParameterExpressionHandlerCR 
GetExpressionHandler () const
 Returns the handler responsible for parsing and deserializing parameter expressions defined for these parameter definitions. More...
 
DGNPLATFORM_EXPORT
TextFileWriteStatus 
WriteToCsv (BeTextFileR file, ParameterCsvSectionPresenceFlags sections) const
 Exports these parameter definitions to a .csv file in a format which can subsequently be imported into a parametric model. More...
 
DGNPLATFORM_EXPORT
ParameterExpressionStatus 
EvaluateExpressions (IParameterValuesR values) const
 Attempts to evaluate all expressions defined for these parameter definitions, and assigns the result of each expression to the corresponding parameter value in the supplied IParameterValues. More...
 
- Public Member Functions inherited from IActiveParameters
DGNPLATFORM_EXPORT ElementHandle GetDependencyRoot () const
 Returns the element to which property and constraint dependencies are bound. More...
 
DGNPLATFORM_EXPORT ParameterStatus ApplyParameters (IParameterValuesCR values)
 Applies the specified values to the active parameters. More...
 
- Public Member Functions inherited from RefCounted< IRefCounted >
void * operator new (size_t size)
 
void operator delete (void *rawMemory, size_t size)
 
UInt32 AddRef () const
 
UInt32 Release () const
 
 RefCounted ()
 
 RefCounted (RefCounted const &rhs)
 
RefCountedoperator= (RefCounted const &rhs)
 
UInt32 GetRefCount () const
 
- Public Member Functions inherited from IParameterValues
DGNPLATFORM_EXPORT
ECN::IECInstanceR 
GetProperties ()
 
DGNPLATFORM_EXPORT DgnModelR GetHostModel () const
 Returns the model in which the parameter values are hosted. More...
 
DGNPLATFORM_EXPORT
ECN::ECObjectsStatus 
GetValue (ECN::ECValueR v, WCharCP accessString, ParameterUnits units=ParameterUnits::Storage) const
 Attempts to retrieve the value of a parameter by access string. More...
 
DGNPLATFORM_EXPORT
ECN::IECInstanceCR 
GetProperties () const
 Returns these parameter values as a collection of DgnECInstances. More...
 
DGNPLATFORM_EXPORT bool IsReadOnly () const
 Returns whether the values held by this object are read-only. If it returns true, methods like SetValue() and WriteValues() which attempt to modify the values will fail. More...
 
DGNPLATFORM_EXPORT
ECN::ECObjectsStatus 
SetValue (WCharCP accessString, ECN::ECValueCR value, ParameterUnits units=ParameterUnits::Storage)
 Modifies the value of the specified parameter in memory. The change does not become persistent until WriteValues() is invoked. More...
 
DGNPLATFORM_EXPORT ParameterStatus WriteValues ()
 Writes any changes made via SetValue() persistently. More...
 

Additional Inherited Members

- Public Types inherited from IParameterDefinitions
typedef
VirtualCollectionIterator
< IParameterDefinitionsIterator
const_iterator
 
- Static Public Member Functions inherited from IParameterDefinitions
static DGNPLATFORM_EXPORT
IParameterDefinitionsPtr 
GetForModel (DgnModelR model)
 Returns the parameter definitions for the specified model, or nullptr if the model does not support parameters. More...
 
- Protected Member Functions inherited from RefCounted< IRefCounted >
virtual ~RefCounted ()
 
- Protected Member Functions inherited from IRefCounted
virtual ~IRefCounted ()
 
void * operator new (size_t size)
 
void operator delete (void *rawMemory, size_t size)
 

Detailed Description

Provides all of the query functionality of IParameterDefinitions, as well as methods for modifying the parameter definitions.

Remarks
Required library : DgnPlatform<ApiNumber>.lib i.e. DgnPlatform5.lib

Member Function Documentation

DGNPLATFORM_EXPORT ParameterStatus Add ( WCharCP  label,
ParameterType  type,
double  value,
bool  hidden = false 
)

Creates a new parameter definition of type distance, angle, or scalar.

The value will be applied to the host model's active parameters and any existing parameter sets. Distance values should be specified in UORs, angles in radians, areas in square UORs

Parameters
[in]labelThe user-visible name of the new parameter. Must be non-empty and unique within all existing parameters.
[in]typeThe type of the new parameter. Must be one of the types which is stored as a floating point value.
[in]valueThe initial value of the new parameter. This value will be applied to all variations as well.
[in]hiddenIf true, the parameter will be flagged as hidden.
Returns
a status Success if the parameter was successfully created, or an error status
DGNPLATFORM_EXPORT ParameterStatus Add ( WCharCP  label,
Int32  value,
bool  hidden = false 
)

Creates a new parameter definition of type integer.

Parameters
[in]labelThe user-visible name of the new parameter. Must be non-empty and unique within all existing parameters.
[in]valueThe initial value of the new parameter. This value will be applied to all variations as well.
[in]hiddenIf true, the parameter will be flagged as hidden.
Returns
a status Success if the parameter was successfully created, or an error status
DGNPLATFORM_EXPORT ParameterStatus Add ( WCharCP  label,
bool  value,
bool  hidden = false 
)

Creates a new parameter definition of type boolean.

Parameters
[in]labelThe user-visible name of the new parameter. Must be non-empty and unique within all existing parameters.
[in]valueThe initial value of the new parameter. This value will be applied to all variations as well.
[in]hiddenIf true, the parameter will be flagged as hidden.
Returns
a status Success if the parameter was successfully created, or an error status
DGNPLATFORM_EXPORT ParameterStatus Add ( WCharCP  label,
WCharCP  value,
bool  hidden = false 
)

Creates a new parameter definition of type string.

Parameters
[in]labelThe user-visible name of the new parameter. Must be non-empty and unique within all existing parameters.
[in]valueThe initial value of the new parameter. This value will be applied to all variations as well.
[in]hiddenIf true, the parameter will be flagged as hidden.
Returns
a status Success if the parameter was successfully created, or an error status
DGNPLATFORM_EXPORT ParameterCsvSectionPresenceFlags ReadFromCsv ( CsvFileR  src,
ParameterCsvReadContextCR  context 
)

Reads the contents of the specified CSV of a format compatible with that produced by IParameterDefinitions::WriteToCsv(), and applies the data to these parameter definitions.

Parameters
[in]srcThe CSV file from which to read the data
[in]contextThe context in which to read the contents. In particular, this context specifies which sections of the CSV to include and which to ignore.
Returns
The sections of CSV which were successfully read and applied.
DGNPLATFORM_EXPORT ParameterStatus Remove ( WCharCP  accessString)

Removes the parameter definition with the specified name Removes the parameter definition with the specified internal name.

Parameters
[in]accessStringThe internal name of the parameter
Returns
Success if the parameter was successfully removed, or else an error status
DGNPLATFORM_EXPORT ParameterStatus Replace ( ParameterDefinitionCR  def)

Updates the parameter definition with the same internal name as the specified parameter definition.

Parameters
[in]defThe updated parameter definition
Returns
Success if the parameter definition was updated, or an error status
DGNPLATFORM_EXPORT ParameterStatus SetDomainParameters ( ECN::IECInstanceCP  domainParams)

Adds or replaces the domain parameters, or removes them if nullptr is passed.

Domain parameters are obtained from an ECClass (e.g., as defined by a CustomItemType) supplied by the user or application. All ECProperties within the ECClass which are usable for parametric modeling (i.e., of a type convertible to one of those defined by ParameterType enum) will become "domain" parameters. Domain parameters support more limited modification than local ("working") parameters - in particular, their names and types cannot be modified as they are defined by the user's ECSchema. The scope and visibility of a domain parameter can be modified, and their values can be defined by expressions. The property values of the supplied IECInstance will provide the initial values of each domain parameter. These values will be applied to all IParameterSets as well.

Parameters
[in]domainParamsAn IECInstance of the desired ECClass, or nullptr to remove existing domain parameters.
Returns
Success if the domain parameters were successfully updated, or an error status.
DGNPLATFORM_EXPORT ParameterStatus SetExpressionForParameter ( WCharCP  accessString,
IParameterExpressionCP  expr 
)

Associates an expression with a parameter, or removes an existing expression.

If an expression is associated with a parameter, the parameter becomes read-only and its value will be calculated dynamically by evaluating the expression. Expressions can reference other parameters, as well as various functions and constants.

Parameters
[in]accessStringThe internal name of the parameter associated with the expression
[in]exprThe expression to be associated with the parameter, or nullptr if the existing expression is to be removed
Returns
Success if the expression was updated for the specified parameter, or an error status

The documentation for this struct was generated from the following file:

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.