.NET

Reply
Valued Contributor
fsztuczny
Posts: 51
Registered: ‎02-25-2010
Message 1 of 4 (378 Views)

Modification of the DGNpurge tool

378 Views, 3 Replies
07-30-2013 01:11 AM

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.

 

 

 

 

ADN Support Specialist
augusto.goncalves
Posts: 311
Registered: ‎04-30-2009
Message 2 of 4 (347 Views)

Re: Modification of the DGNpurge tool

08-01-2013 09:51 AM in reply to: fsztuczny

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
Autodesk Developer Network
Valued Contributor
fsztuczny
Posts: 51
Registered: ‎02-25-2010
Message 3 of 4 (333 Views)

Re: Modification of the DGNpurge tool

08-04-2013 05:26 AM in reply to: augusto.goncalves
Valued Contributor
fsztuczny
Posts: 51
Registered: ‎02-25-2010
Message 4 of 4 (306 Views)

Re: Modification of the DGNpurge tool

08-08-2013 12:42 AM 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community