UnitInfo Class: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
{{Template:APIClass|Repository Class|Repository}}  
{{Template:API}}{{Template:APIBreadcrumbClass}}
{{Template:UnitInfo Class.Cmt}}  


In Synthesis desktop applications, these units are shown in the Manage Units window.
 
<!--
<onlyinclude>Stores the properties of units of measurement.</onlyinclude>
== Constructors ==
*[[UnitInfo Constructors|UnitInfo( Integer, String, String, Double )]] {{APIComment|{{Template:UnitInfo Constructors.Cmt}}}}-->


== Properties  ==
== Properties  ==
*ID (as ''integer'') {{APIComment|Gets numerical ID of the unit.}}
{| {{APITable}}
*Name (as ''string'') {{APIComment| Gets the name of the unit.}}
|-
*Abbreviation (as ''string'') {{APIComment|Gets abbreviation of the unit.}}
| style="width: 130px;"|ID||Gets or sets the numerical ID of the unit. '''Integer'''.
*Multiplier (''as double'') {{APIComment|Gets the multiplier of the unit (i.e., the value to multiply by the Standard Base Unit (SBU), which determines how units are converted).}}
|-
 
|Name||Gets or sets the name of the unit. '''String'''.
== Usage Example ==
|-
In this usage example, the multiplier for the first unit of measurement in a repository is retrieved.
|Abbreviation||Gets or sets the abbreviation of the unit. '''String'''.
{{APIComment|'Declare a new repository connection object.}}
|-
  Dim MyRepository As New Repository
|Multiplier||Gets or sets the conversion factor, which is defined in relation to a repository's System Base Unit (SBU). '''Double'''.
 
|}
{{APIComment|'Connect to the first project in the specified Synthesis repository.}}
  Dim Success As Boolean = False
  Success = MyRepository.ConnectToRepository("RepositoryFileNamePath")
  MyRepository.SetCurrentProject(1)
 
{{APIComment|'Get the list of units for the current project for the connected repository. See [[Repository.GetAllUnits|GetAllUnits]].}}
  Dim ListOfUnits() As UnitInfo
  ListOfUnits = MyRepository.GetAllUnits()
 
{{APIComment|'Get the multiplier for the first unit in the list.}}
  Dim Mult As Double
  Mult = ListOfUnits(0).Multiplier

Revision as of 17:53, 7 August 2015

APIWiki.png


Member of: SynthesisAPI


Stores the properties of units of measurement.

Properties

Name Description
ID Gets or sets the numerical ID of the unit. Integer.
Name Gets or sets the name of the unit. String.
Abbreviation Gets or sets the abbreviation of the unit. String.
Multiplier Gets or sets the conversion factor, which is defined in relation to a repository's System Base Unit (SBU). Double.