Page 1 of 1
How to Explode Text
Posted: 09 May 2020, 02:03
by AlexBV
I know it is possible to extract the actual coordinates from a Text and MText..
Ho to do it ??
With GetTextPolylines ???
I get the list ...but I do not know how to Extract the entities..
I would appreciate a little Delphi example !!
Thanks
Re: How to Explode Text
Posted: 13 May 2020, 12:15
by support
Hello,
What do you mean by "actual coordinates"? Is a Text/MText located in a block?
Mikhail
Re: How to Explode Text
Posted: 23 May 2020, 18:04
by AlexBV
>Hello,
>What do you mean by "actual coordinates"? Is a Text/MText located in a block?
>Mikhail
Dear @Mikhail
With the very illustrative code you wrote in other post (exploiting blocks), it is possible to explode MText to Text.
What I need is to get additionally the actual line stroke of each text component, like if I was going to plot it manually (move to (xy) lineto (xy)). without having to use the shx. I know it sounds silly but I am converting each point, line stroke to a 2 parallel and simultaneous and different spaces... (3d to two stereoscopic projections) ..
Thank you so much !!
Alex
Re: How to Explode Text
Posted: 25 May 2020, 19:55
by support
Hello Alex,
There is a
TsgDXFConverter.GetTextPolylines function which converts a TsgDXFText object (AText) into a TList of lists of points (AList):
Code: Select all
function TsgDXFConverter.GetTextPolylines(const AText: TsgDXFText; const AList: TList): Integer;
To create polylines from the received TList, use the following procedure:
Code: Select all
procedure CreatePolylines(ACADImage: TsgCADImage; const AList: TList);
var
I, J: Integer;
vPoly: TsgDXFPolyline;
vVertex: TsgDXFVertex;
vContour: TList;
begin
for I := 0 to AList.Count - 1 do
begin
vPoly := TsgDXFPolyline.Create();
vPoly.Color := clRed;
vPoly.Closed := False;
vContour := AList[I];
for J := 0 to vContour.Count - 1 do
begin
vVertex := TsgDXFVertex.Create();
vVertex.Point := TFPoint(vContour[J]^);
vPoly.AddEntity(vVertex);
end;
ACADImage.Converter.Loads(vPoly);
ACADImage.CurrentLayout.AddEntity(vPoly);
end;
ACADImage.GetExtents();
vContour.Free;
end;
Mikhail
Re: How to Explode Text
Posted: 26 May 2020, 20:46
by AlexBV
Mikhail
This is exactly what I was looking for..
Thank you so much !!