How to get all the entities?
Moderators: SDS, support, admin
How to get all the entities?
Hi, I need to get two things from DXF files.
1. The number of all the entities (shapes)
2. All the entities points so that I can manipulate in my program.
Basically I need to extract those two info, and need to draw them in XOR fashion. (So, some shapes are filled and some shapes are unfilled.)
How do I get those info from DXF? It is quite confusing to figure them out from your demo...
Thank you so much.
1. The number of all the entities (shapes)
2. All the entities points so that I can manipulate in my program.
Basically I need to extract those two info, and need to draw them in XOR fashion. (So, some shapes are filled and some shapes are unfilled.)
How do I get those info from DXF? It is quite confusing to figure them out from your demo...
Thank you so much.
Hello!
The code below is based on Viewer demo. Find it in the ..\cadimportvcl\Delphi\Demos\Viewer\.. folder of the <b>CAD Import VCL</b> package: http://www.cadsofttools.com/download/cadimportvcl.zip It is shown how to get access to the entities on the current layout of the loaded CAD file.
Sergey.
Please post questions to the forum or write to support@cadsofttools.com
The code below is based on Viewer demo. Find it in the ..\cadimportvcl\Delphi\Demos\Viewer\.. folder of the <b>CAD Import VCL</b> package: http://www.cadsofttools.com/download/cadimportvcl.zip It is shown how to get access to the entities on the current layout of the loaded CAD file.
Code: Select all
<b>procedure</b> TForm1.btnGetEntitiesClick(Sender: TObject);
<b>var</b>
J: Integer;
vCADImg: TsgDXFImage;
vEnt: TsgDXFEntity;
<b>begin
if</b> sgPaintBox.Picture.Graphic <b>is</b> TsgDXFImage <b>then</b>
vCADImg := TsgDXFImage(sgPaintBox.Picture.Graphic)
<b>else</b>
Exit;
<b>for</b> J := 0 <b>to </b>vCADImg.CurrentLayout.Converter.Counts[csEntities] - 1 <b>do
begin</b>
vEnt := vCADImg.CurrentLayout.Converter.Sections[csEntities].Entities[J];
<font color="blue"><i>//do your actions</i></font id="blue">
<b>end</b>;
<b>end</b>;
Please post questions to the forum or write to support@cadsofttools.com