Page 1 of 1

Text is behind hatch!

Posted: 17 Jun 2019, 11:15
by Timo
Hi

How I can force text entities to front of all other objects?
I have tried sort objects and changing z-coordinates.

-- Timo

Re: Text is behind hatch!

Posted: 17 Jun 2019, 17:47
by support
Hello Timo,

You can modify this routine to bring the entities of certain type (e.g. ceText) to front of all other entities. For example:

Code: Select all

procedure BringEntitiesToFront(ACADImage: TsgCADImage; EntType: TsgCADEntities);
var
  I, Count: Integer;
  vModelSpaceBlock: TsgDXFBlock;
  vDXFEntity: TsgDXFEntity;
begin
  I := 0;
  Count := 0;
  vModelSpaceBlock := ACADImage.Converter.BlockByName('*MODEL_SPACE');

  while I < vModelSpaceBlock.Count do
  begin
    vDXFEntity := vModelSpaceBlock.Entities[I];
    if (vDXFEntity.EntType <> EntType) then
    begin
      Inc(Count);
      vModelSpaceBlock.InsertEntity(Count - 1, vDXFEntity);
      vModelSpaceBlock.DeleteEntity(I + 1);
    end;
    Inc(I);
  end;
end;
Mikhail