Page 1 of 1

Set dimension style current (active)

Posted: 21 Apr 2014, 19:59
by fisad
As can activate a dimensionstyle before drawing a dimension

After opening a file, a new type of dimensionstyle is inserted, after several operations, I need to add a dimension using the style created but the only way to use the new style is inserted immediately before inserting the dimension, thus which is necessary to insert the new style each time a dimension is created.

What is the procedure to activate a style before inserting a dimension?.

Thank you ..

Re: Set dimension style current (active)

Posted: 22 Apr 2014, 11:32
by support
Hello,

The new dimension style should be added to TsgDXFConverter after creation, so it will be possible to retrieve this style from TsgDXFConverter when needed.

The following example shows how to add a dimension style to TsgDXFConverter:

Code: Select all

procedure CreateDimensionStyle;
var
  vDimStyle: TsgDXFDimensionStyle;
begin
  vDimStyle := TsgDXFDimensionStyle.Create;
  ...

  Img.Converter.Sections[csDimStyles].AddEntity(vDimStyle);
  if Assigned(Img.Converter.OnCreate) then
    Img.Converter.OnCreate(vDimStyle);
  Img.Converter.Loads(vDimStyle);
end;
You can use TsgDXFConverter.DimensionStyleByName() function to get a dimension style from TsgDXFConverter.


Mikhail.