Page 1 of 1

Is support change Dimension's decimal separator?

Posted: 28 Mar 2016, 07:44
by uni016
Hi.
I want change over Dimension's decimal separator form ',' to '.' .
Is it possible?

Re: Is support change Dimension's decimal separator?

Posted: 28 Mar 2016, 15:56
by support
Hello,

It is possible to change a decimal separator used in a CAD drawing with a SetDecimalSeparator function implemented in sgConsts.pas. This function sets a value of the DecimalSeparator variable and also returns a previous value of the decimal separator as a result:

Code: Select all

var
  DS: Char;
...

DS := SetDecimalSeparator('.');
try
...

finally
 SetDecimalSeparator(DS);
end;
Mikhail

Re: Is support change Dimension's decimal separator?

Posted: 29 Mar 2016, 10:38
by uni016
I already test it before post this issue. but dimension's decimal separator dose not changed.
(My CadVcl version is 10.x)

Code: Select all

var
  loCad: TsgCadImage;
  loDim: TsgDxfDimension;
  loSeparator: char;
begin
  ..
  loSeparator := SetDecimalSeparator('.');
  try
    loDim := TsgDXFDimension.Create;
    loDim.LinDefPoint1 := MakeFPoint(...);
    ..
    loCad.Converter.Loads(loDim);
    loCad.CurrentLayout.AddEntity(loDim);
    ..    
  finally
    SetDecimalSeparator(loSeparator );
  end;
end;

Re: Is support change Dimension's decimal separator?

Posted: 29 Mar 2016, 22:40
by support
Hello,

Could you specify the exact version of CAD VCL (10.0 or 10.1) and your Delphi version?


Mikhail

Re: Is support change Dimension's decimal separator?

Posted: 30 Mar 2016, 04:54
by uni016
Delphi: XE8
CadVcl: maybe 10.1 (I don't known how to get the version.)

Re: Is support change Dimension's decimal separator?

Posted: 30 Mar 2016, 12:24
by support
Hello,

I didn't take into account that the DecimalSeparator variable value is overridden in the DoubleToStrF function (sgFunction.pas). This function invokes the SetDecimalSeparator function with a value of cnstDoubleSeporator constant (sgFunction.pas). Therefore, you will need to change the cnstDoubleSeporator constant value in the sgFunction.pas unit as shown below.

Code: Select all

const
  cnstDoubleSeporator = '.';
Mikhail