no valid characters

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

Moderators: SDS, support, admin

Post Reply
Laker32
Posts: 8
Joined: 07 Aug 2006, 22:14
Location: USA

no valid characters

Post by Laker32 » 13 Sep 2006, 20:53

Hello!

I bought the cadimportvcl, It's very cool tool, but I'm having 2 problems:

1: Some text entities shows a box at the end of line, looks like a non printable character, how can i delete it?

2: for a demo you post (CADImportVCL_site_beta_010906) there is a method "getrect" for the TsgDXFImageAccess class that is undefined for the files I bought (for the demo libraries i don't have this problem), I need that functionality with my registerd version

Thanks for your help

Laker32
Posts: 8
Joined: 07 Aug 2006, 22:14
Location: USA

Post by Laker32 » 13 Sep 2006, 21:28

Hello again,

I realized there where some #0 characters in the text, I wrote the next code:

procedure TfmMain.delInvalidChars;
var i:integer;
s:string;
begin
for i :=0 to tsgdxfimage(sgimage.Picture.Graphic).Converter.Counts[csEntities]-1 do
begin
if (tsgdxfimage(sgimage.Picture.Graphic).Converter.Entities is TsgDXFText) then
begin
s:=TsgDXFText(tsgdxfimage(sgimage.Picture.Graphic).Converter.Entities).Text;
while pos(#0,s)>0 do delete(s,pos(#0,s),1);
TsgDXFText(tsgdxfimage(sgimage.Picture.Graphic).Converter.Entities).Text:=s;
end
else
if (tsgdxfimage(sgimage.Picture.Graphic).Converter.Entities is TsgDXFMText) then
begin
s:=TsgDXFMText(tsgdxfimage(sgimage.Picture.Graphic).Converter.Entities).Text;
while pos(#0,s)>0 do delete(s,pos(#0,s),1);
TsgDXFMText(tsgdxfimage(sgimage.Picture.Graphic).Converter.Entities).Text:=s;
end;
end;
sgimage.Refresh;
end;

I works ok for some entities but it looks like there are some unaccesible entities, so the text remain unchanged.

Laker32
Posts: 8
Joined: 07 Aug 2006, 22:14
Location: USA

Post by Laker32 » 14 Sep 2006, 04:10

Well I found a way to solve this:

1) First we need to declare a procedure like:

procedure TFormParDibComp.elimina0(Entity: TsgDXFEntity);
var
S2: String;
vBox: TFRect;
begin
if Entity is TsgDXFText then
begin
S2 := AnsiUpperCase(TsgDXFText(Entity).Text);
while pos(#0,s2)>0 do delete(s2,pos(#0,s2),1);
TsgDXFText(Entity).Text:=s2;
end;
end;

2) Then we put the next code were we want to clean the text entities (For example after we open the file):

tsgDXFIMAGE(sgpaintbox.Picture.Graphic).Converter.AutoInsert := True;
tsgDXFIMAGE(sgpaintbox.Picture.Graphic).Converter.Iterate(elimina0, FCADParams);

Maybe is not clean enough code but it works.

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

Post by support » 14 Sep 2006, 11:38

Hello Lacker32,

<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">1: Some text entities shows a box at the end of line, looks like a non printable character, how can i delete it?<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
At the first look your system has no nesessary font for viewing this symbol. If possible please send us your file for testing the problem.

<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">2: for a demo you post (CADImportVCL_site_beta_010906) there is a method "getrect" for the TsgDXFImageAccess class that is undefined for the files I bought (for the demo libraries i don't have this problem), I need that functionality with my registerd version<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
Please contact us on info@cadsofttools.com. We will prepare for you a special build of CADImportVCL beta version.
<b>Important</b>: function GetRect is protected. That is why we can't guarantee that it will not be changed or removed in future versions.
<br />Please make a reference to this topic if you mail us.
<br />Sergey.

please post questions to the forum or write to support@cadsofttools.com

Post Reply