Page 1 of 1
Load DWG file without direct opening X-Reference files
Posted: 08 Sep 2011, 17:43
by jeff_mi
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
Re: Load DWG file without direct opening X-Reference files
Posted: 09 Sep 2011, 11:08
by support
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.
Re: Load DWG file without direct opening X-Reference files
Posted: 09 Sep 2011, 11:39
by jeff_mi
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...
Re: Load DWG file without direct opening X-Reference files
Posted: 09 Sep 2011, 12:38
by support
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.
Re: Load DWG file without direct opening X-Reference files
Posted: 09 Sep 2011, 13:35
by jeff_mi
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.
Re: Load DWG file without direct opening X-Reference files
Posted: 09 Sep 2011, 14:28
by support
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.