UnitInfo Class: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Template:APIClass|Repository Class|Repository}}  
{{Template:API}}{{Template:APIBreadcrumb}}
{{Template:UnitInfo Class.Cmt}}  


In Synthesis desktop applications, these units are shown in the Manage Units window.
 
<!--
<onlyinclude>Represents the unit of measurement used by an associated [[Repository_Class|Repository]] object.</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;"|Abbreviation||Gets or sets the abbreviation of the unit. '''String'''.
*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).}}
|-
|ID||Gets or sets the numeric ID of the unit. '''Integer'''.
|-
|Multiplier||Gets or sets the conversion factor, which is defined in relation to a repository's System Base Unit (SBU). '''Double'''.
|-
|Name||Gets or sets the name of the unit. '''String'''.
|}
 
 
 
 


== Usage Example ==
==See Also==
In this usage example, the multiplier for the first unit of measurement in a repository is retrieved.
*[[Repository.Unit.GetAllUnits|Repository.Unit.GetAllUnits Method]]
{{APIComment|'Declare a new repository connection object.}}
  Dim MyRepository As New Repository
 
{{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

Latest revision as of 15:04, 8 April 2016

APIWiki.png


Member of: SynthesisAPI


Represents the unit of measurement used by an associated Repository object.

Properties

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



See Also