Is support change Dimension's decimal separator?

Discuss and ask questions about CAD VCL (Delphi and C++ Builder).

Moderators: support, SDS, admin

Post Reply
uni016
Posts: 8
Joined: 30 Nov 2015, 07:21

Is support change Dimension's decimal separator?

Post by uni016 » 28 Mar 2016, 07:44

Hi.
I want change over Dimension's decimal separator form ',' to '.' .
Is it possible?

support
Posts: 2930
Joined: 30 Mar 2005, 11:36
Contact:

Re: Is support change Dimension's decimal separator?

Post by support » 28 Mar 2016, 15:56

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
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

uni016
Posts: 8
Joined: 30 Nov 2015, 07:21

Re: Is support change Dimension's decimal separator?

Post by uni016 » 29 Mar 2016, 10:38

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;

support
Posts: 2930
Joined: 30 Mar 2005, 11:36
Contact:

Re: Is support change Dimension's decimal separator?

Post by support » 29 Mar 2016, 22:40

Hello,

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


Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

uni016
Posts: 8
Joined: 30 Nov 2015, 07:21

Re: Is support change Dimension's decimal separator?

Post by uni016 » 30 Mar 2016, 04:54

Delphi: XE8
CadVcl: maybe 10.1 (I don't known how to get the version.)

support
Posts: 2930
Joined: 30 Mar 2005, 11:36
Contact:

Re: Is support change Dimension's decimal separator?

Post by support » 30 Mar 2016, 12:24

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
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply