API Help
Eplan.EplApi.Base Namespace / UnitParser Class
Members Example

In This Topic
    UnitParser Class
    In This Topic
    The UnitParser class. Here it is possible to read the unit from a string and convert it in other units (of the same unit group)
    Inheritance Hierarchy

    System.Object
       Eplan.EplApi.Base.UnitParser

    Syntax
    public class UnitParser 
    public ref class UnitParser 
    Example
    Example of using UnitParser class
    UnitParser oUnitParser = new UnitParser();
    
    ParserParameter oParserParameter = new ParserParameter();
    oParserParameter.UnitID = Unit.Length_cm;
    
    //Set value in cm
    oUnitParser.Set("200 cm", oParserParameter);
    
    //Get value in mm
    ParserParameter oParserParameter_mm = new ParserParameter();
    oParserParameter_mm.UnitID = Unit.Length_mm;
    
    double dValue_mm = oUnitParser.ValueToUnit(oParserParameter_mm);
    
    //Get value in m
    ParserParameter oParserParameter_m = new ParserParameter();
    oParserParameter_m.UnitID = Unit.Length_m;
    
    double dValue_m = oUnitParser.ValueToUnit(oParserParameter_m);
    
    
    Public Constructors
     NameDescription
    Public ConstructorThe Constructor  
    Top
    Public Methods
     NameDescription
    Public MethodDestructor for deterministic finalization of UnitParser object.  
    Public MethodGet the base unit of the parsed result of this unit group.  
    Public MethodGet the value of the parsed result in the base unit of this unit group.  
    Public MethodGet the unit of the parsed result.  
    Public MethodGet the value of the parsed result.  
    Public MethodOverloaded. The start of any parse. Set the number and the unit to parse and fill the unit of this text in the parser parameters.  
    Public MethodConvert the value to a new unit (of parameterForConversion) of this group and make a display string out of it.  
    Public MethodConvert the value to a new unit (of parameterForConversion) of this group.  
    Top
    See Also