Problems with saving DXF

If you have any comments or questions about our developing tools, please do not hesitate to contact us at this forum

Moderators: admin, SDS, support

Problems with saving DXF

Postby AmperNr1 » 18 Nov 2010, 11:05

I have a big problem with saving DXF file.
When I try to save the result of my program consist many DXF's on the canva (picture) then instead of one big DXF consist my previous positioned DXF's in proper positions, I recieve one file with chaotic placed DXF's.
To save a file I use folowing code:
Code: Select all
TsgCADtoDXF * vExpCADfile;
   TGraphic * vGr = sgPaintBox->Picture->Graphic;
   if ((vGr)&&(vGr->InheritsFrom(__classid(TsgCADImage))))
   {
   vExpCADfile = new TsgCADtoDXF((TsgCADImage *)vGr);
   try
    {
    vExpCADfile->SaveToFile(SaveDialog3->FileName);
    ShowMessage("Export to DXF done");
    }
   __finally
    {
    delete vExpCADfile;
    }


To insert next DXF's on the canva I use AddScaledDXFEx method and I work on TsgDXFInsert objects, as follow:
Code: Select all
if(InsertList == NULL)
   {
   Insert = vGlobalCADFile->AddScaledDXFEx(vCADFiles,FileName,P,Scale,0);

   vGlobalCADFile->Converter->Loads(Insert);

   InsertList = new TList;
   InsertList->Add(Insert);
   sgPaintBox->Picture->Graphic = vGlobalCADFile;
   vGlobalCADFile = GetImg();
   }


The problem is bigger than I thought before, because users on other computers don't see even chaotic placed DXF on the canva, but only first DXF (first means that one which was read first during my program work). It looks like SaveToFile functions save some kind of references - not DXF file which I really want and which should be readable on each computer (especially in AutoCAD enviroment).

Thank you for any help.

Best regards,

Mariusz Hyżorek
AmperNr1
 
Posts: 12
Joined: 13 Oct 2010, 12:16

Re: Problems with saving DXF

Postby support » 19 Nov 2010, 13:12

Hello Mariusz.
XRef image doesn't stored within DXF file. Main file contains only reference paths to files that will be loaded on file-container import. That is why users on other computers can't see referenced images - the local path on another PC doesn't contain referenced file. One more addition, AutoCAD doesn't support referenced DXF, but DWG only. Such functionality accessible with CAD Import VCL only.
If I'm correct then you need receive the file that will contain entities from some specified files. One of our clients deal with such problem recently. Possibly you find the following topic as helpful: http://www.cadsofttools.com/forum/viewtopic.php?f=14&t=1925

Also such code is incorrect:
Code: Select all
   Insert = vGlobalCADFile->AddScaledDXFEx(vCADFiles,FileName,P,Scale,0);

   vGlobalCADFile->Converter->Loads(Insert);

XRef object added to converter within AddScaledDXFEx function, you don't need load it as Insert again.

Alexander.
Please post questions to the forum or write to support@cadsofttools.com
support
 
Posts: 2226
Joined: 30 Mar 2005, 08:36
Location: Russia

Re: Problems with saving DXF

Postby AmperNr1 » 22 Nov 2010, 14:41

Hello Alexander.

Thank you for a clue. I've made some changes basing on viewtopic.php?f=14&t=1925 and now I'm thinking is much better than was before.

Best regards,

Mariusz Hyżorek
AmperNr1
 
Posts: 12
Joined: 13 Oct 2010, 12:16


Return to CADImportVCL + DXFExportVCL

Who is online

Users browsing this forum: No registered users and 1 guest