Check delimiter through API
Posted: Wed Jan 03, 2024 3:05 am
I just wrote a quick and dirty macro to import some dimensions that you set in a .txt file (basically because the import equations option in Solidworks is simply SO BAD!). Now I am trying to change the delimiter to the one that is used on this machine - but nothing seems to work:
This always returns
But the global decimal separator is actually a comma (I'm back in Germany here).
How do I access the global one?
Code: Select all
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim ModelDocExtension As SldWorks.ModelDocExtension
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set ModelDocExtension = swModel.Extension
Dim docUserUnit As SldWorks.UserUnit
Set docUserUnit = swModel.GetUserUnit(swLengthUnit)
Debug.Print "Decimal separator character: " & docUserUnit.SeparatorCharacter
End Sub
!Decimal separator character: .
But the global decimal separator is actually a comma (I'm back in Germany here).
How do I access the global one?