.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Take loaded overlays

3 REPLIES 3
Reply
Message 1 of 4
fsztuczny
389 Views, 3 Replies

Take loaded overlays

Hello

I have loaded a drawing by
__db.ReadDwgFile (...).

I want to iterate xrefs, so I use:
__db.ResolveXrefs (true, false);
and
XrefGraph xg = __db.GetHostDwgXrefGraph (false)
e.t.c.
For dwg drawings, it works correctly. I would like to do similarly for drawing pdf, jpg, tiff, etc. Is it possible using a similar mechanism?

3 REPLIES 3
Message 2 of 4

It depends on what release of AutoCAD you're targeting.

 

For some unexplained reason, Autodesk removed the FileDependencyManager API from recent product releases.

 


@fsztuczny wrote:

Hello

I have loaded a drawing by
__db.ReadDwgFile (...).

I want to iterate xrefs, so I use:
__db.ResolveXrefs (true, false);
and
XrefGraph xg = __db.GetHostDwgXrefGraph (false)
e.t.c.
For dwg drawings, it works correctly. I would like to do similarly for drawing pdf, jpg, tiff, etc. Is it possible using a similar mechanism?


 

Message 3 of 4

Hello

My target is autocad 2012, 2014, 2016 and 2018.

I'm trying to successfully browse dictionaries:

 

DBDictionary namedDic = ( DBDictionary )__tr.GetObject( __db.NamedObjectsDictionaryId, OpenMode.ForRead );

string pdfDicKey = PdfDefinition.GetDictionaryKey( typeof( PdfDefinition ) );

if( namedDic.Contains( pdfDicKey ) )

  DBDictionary pdfDic = __tr.GetObject( namedDic.GetAt( pdfDicKey ), OpenMode.ForRead ) as DBDictionary;

 

and

 

ObjectId imgDictId = RasterImageDef.GetImageDictionary( __db );

 

It works very well. There is another problem: If xref is not nested and this xref is the owner of pdf and image files, then the contents of pdf and images are visible in the parent drawing. This is desirable. However, I would like to detect the presence in the parent drawing of pdf files and images used by xref, but without opening the xref. Is it possible?

Message 4 of 4
fsztuczny
in reply to: fsztuczny

Hello

I have a solution:

 

Database xrefDatabase = xrefBtr.GetXrefDatabase(true );

and check above dictionaries in this xrefDatabase described in previous posts.

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report