niedzviedz
Mechanical
- Apr 1, 2012
- 307
Hello,
Can someone can help with this question - how to change / set default unit by Nxopen? I found new code in NX 12:
But how to use it?
I have something like this:
But I receive an error, that last sentence doesn't give an output.
With best regards
Michael
Can someone can help with this question - how to change / set default unit by Nxopen? I found new code in NX 12:
Code:
SetDefaultDataEntryUnits¶
UnitCollection.SetDefaultDataEntryUnits
Set a choice of default set of units for data entry in the given part.
Signature SetDefaultDataEntryUnits(defaults)
Parameters: defaults (NXOpen.UnitCollectionUnitDefaults) –
New in version NX12.0.0.
License requirements: None.
But how to use it?
I have something like this:
Code:
Dim myMeasure As MeasureManager = theSession.Parts.work.MeasureManager()
Dim massUnits(7) As Unit
lw.open()
massUnits(0) = theSession.Parts.Display.UnitCollection.GetBase("Area")
massUnits(1) = theSession.Parts.Display.UnitCollection.GetBase("Volume")
massUnits(2) = theSession.Parts.Display.UnitCollection.GetBase("Mass")
massUnits(3) = theSession.Parts.Display.UnitCollection.GetBase("Length")
massUnits(4) = theSession.Parts.Display.UnitCollection.GetBase("Angle")
massUnits(5) = theSession.Parts.Display.UnitCollection.GetBase("Force")
massUnits(6) = theSession.Parts.Display.UnitCollection.GetBase("Temperature")
mass_ = massUnits(2).symbol
Length_ = massUnits(3).symbol
Angle_ = massUnits(4).symbol
Force_ = massUnits(5).symbol
tempr_ = massUnits(6).symbol
lw.writeline(mass_)
lw.writeline(Length_)
lw.writeline(Angle_)
lw.writeline(Force_)
lw.writeline(tempr_)
massUnits(4) = theSession.Parts.Display.UnitCollection.SetDefaultDataEntryUnits("radian")
But I receive an error, that last sentence doesn't give an output.
With best regards
Michael