Load DWG file without direct opening X-Reference files

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

Load DWG file without direct opening X-Reference files

Postby jeff_mi » 08 Sep 2011, 14:43

Hello,

Is there any method to open main DWG file and load metainfos all X-References and Images
inserted in it without opening X-Reference files?

we use the following code:

DXFImage := TsgDWGImage.Create
DXFImage.IsProcessMessages := False;
DXFImage.LoadFromFile(AFileName);
....
where AFileName - is the path of main DWG file where specified

and if X-reference file is absent on the file system than X-Reference metainfo in main file does not exist at all
and more over if X-reference files exist than all of them will be opened and analyzed by CADImportVCL.
We want to open and analyze just main file.

Thanks in advanced
jeff_mi
 
Posts: 3
Joined: 08 Sep 2011, 14:30

Re: Load DWG file without direct opening X-Reference files

Postby support » 09 Sep 2011, 08:08

Hello.
The XRef object is a variant of inserted block. The block data loaded via specified path on drawing import. The file that contains XRef doesn't include any referenced drawing data. So, there is no way to import any data from referenced file without open it.

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: Load DWG file without direct opening X-Reference files

Postby jeff_mi » 09 Sep 2011, 08:39

Hello,

Actually I don't want to open and load X-Reference files I want to load the main file only in spite of its incorrect view
and I want to know just XReference metainfo - just their types (INSERT or OVERLAY) and filepathes and that' all.
This metainfo is kept in main file and I can get it without openning the X-Reference file.
It is not required to open every X-Ref files to get the info I have specified below.

Can I skip openning the X-Reference files while the main file loading?
Can I decide what I want to open and load? May be exist any event or method where I can get metainfo about X-Reference
and my logic will decide what X-Ref files will be loaded and what ones don't.

Thanks a lot for your quick answers...
jeff_mi
 
Posts: 3
Joined: 08 Sep 2011, 14:30

Re: Load DWG file without direct opening X-Reference files

Postby support » 09 Sep 2011, 09:38

Hello.
The reference path and reference type can be accessed without loading an XRef. Please use TsgDXFBlock.XrefPath and TsgDXFBlock.Flags properties. The library doesn't allow optional XRefs loading.

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: Load DWG file without direct opening X-Reference files

Postby jeff_mi » 09 Sep 2011, 10:35

Hello,

The reference path and reference type can be accessed without loading an XRef.
Please use TsgDXFBlock.XrefPath and TsgDXFBlock.Flags properties.


I did a simple example and it is failed.
Because while loading the main file the library try to load X-Reference files as well.
I invoked just these methods and nothing more.
Code: Select all
  DXFImage := TsgDXFImage.Create;
  DXFImage.IsProcessMessages := False;
  DXFImage.LoadFromFile(AFileName);

where AFileName - main file path

Please hint me how to load just main file.

Thanks in advanced.
jeff_mi
 
Posts: 3
Joined: 08 Sep 2011, 14:30

Re: Load DWG file without direct opening X-Reference files

Postby support » 09 Sep 2011, 11:28

Hello.
The library doesn't allow optional XRefs loading.
XRefs will be loaded automatically, you can't switch it off. By "accessed without loading an XRef" I meant what even if an referenced file wasn't loaded (because not accessible via searched path) the XrefPath and Flags properties will contain required data.

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


Return to CADImportVCL + DXFExportVCL

Who is online

Users browsing this forum: No registered users and 0 guests

cron