PdcMaterialFile.ConvertQuantByUnit: Difference between revisions
Jump to navigation
Jump to search
Created page with "== Declaration == ConvertQuantByUnit() == Description == Converts a quantity from a unit to a unit by the LM_STAM and LM_GEW. == Notes == The function returns 0 if the LM_ST..." |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Declaration == | == Declaration == | ||
ConvertQuantByUnit() | ConvertQuantByUnit(Quantity as double, UnitFrom as string, UnitTo as string, UnitWeightFactor as string, StandardSize as string, WeightFactor as double) as double | ||
== Description == | == Description == | ||
Line 7: | Line 7: | ||
== Notes == | == Notes == | ||
The function returns 0 if the LM_STAFM or LM_GEW isn't correctly filled. <br /> | The function returns 0 if the LM_STAFM or LM_GEW isn't correctly filled. <br /> | ||
The | The UnitWeightFactor is the unit which corresponds to the weightfactor, most likely the unit of the material in question. <br /> | ||
This function executes [[PdcMaterialFile.ConvertUnitToUnitFactor]] and multiplies it with the quantity. | |||
== Code example VB.NET == | == Code example VB.NET == | ||
<source lang="vb"> | <source lang="vb"> | ||
PDC.App.MasterData.MaterialFile.ConvertQuantByUnit(dblQuantity, strUnitFrom, strUnitTo, strUnitWeightFactor, strStandardSize, dblWeightFactor) | Dim QuantityConverted as Double = PDC.App.MasterData.MaterialFile.ConvertQuantByUnit(dblQuantity, strUnitFrom, strUnitTo, strUnitWeightFactor, strStandardSize, dblWeightFactor) | ||
</source> | </source> | ||
== Availability == | == Availability == | ||
Available since Juli 2020 (from version 5.6) | Available since Juli 2020 (from version 5.6) |
Latest revision as of 08:18, 29 June 2020
Declaration
ConvertQuantByUnit(Quantity as double, UnitFrom as string, UnitTo as string, UnitWeightFactor as string, StandardSize as string, WeightFactor as double) as double
Description
Converts a quantity from a unit to a unit by the LM_STAM and LM_GEW.
Notes
The function returns 0 if the LM_STAFM or LM_GEW isn't correctly filled.
The UnitWeightFactor is the unit which corresponds to the weightfactor, most likely the unit of the material in question.
This function executes PdcMaterialFile.ConvertUnitToUnitFactor and multiplies it with the quantity.
Code example VB.NET
Dim QuantityConverted as Double = PDC.App.MasterData.MaterialFile.ConvertQuantByUnit(dblQuantity, strUnitFrom, strUnitTo, strUnitWeightFactor, strStandardSize, dblWeightFactor)
Availability
Available since Juli 2020 (from version 5.6)