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

Modification of the DGNpurge tool

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

Modification of the DGNpurge tool

I tried to modify the tool posted on there in such a way that it is possible to batch processing of files. As input are the Database and the Editor (null if batch processing mode). If it has been used in the current document, there is no problem. If the function argument gave an external Database, there is an exception to the "eNtoFromThisDocument" function:

 

private static ObjectIdCollection
PurgeLinetypesReferencedNotByAnonBlocks (
Database db, Transaction tr, ObjectIdCollection ids
)

 

line 283 in the fragment:
//Open the object and check its lineType.2point=2 point

 

var obj = tr.GetObject (id, OpenMode. ForRead, true);
 
 

 

Here pasted code.
Please help.

 

 

 

 

3 REPLIES 3
Message 2 of 4

This error means that the ID you are trying to open don't belong to the database...

 

If you have an ObjectID, you can get the owner Database from ObjectId.Database property, then get the transaction from there...

 

But on your new version of the code, you may consider review to make sure this logic is as expected.

Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
Message 3 of 4
Message 4 of 4
fsztuczny
in reply to: fsztuczny

Help please. This tool is going to crash in the attached drawing (link).

https://www.dropbox.com/s/ku9bagkaak6v0sg/4228-1000-15-DW-500_RA_1.dwg

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost