.NET

.NET

Reply
Valued Contributor
91 Posts
3 Kudos
Registered: ‎02-18-2010
Post 1 of 6

processing drawings w/o opening them - no time improvment

233 Views, 5 Replies
05-23-2013 07:46 AM

I modified a routine that processed xref names & paths w/in a set of folders. Thie original version would open each drawing & do its thing. THis would take about 20 minutes (aprroximately 90 files). I modified it to work w/o opening each drawing. This still takes about 20 minutes.

 

I would have though that not avtually opeing each drawing would dramitically decrease the overall time required to run this routine.

 

anyone have any insight to this?

*Expert Elite*
1,286 Posts
37 Kudos
Registered: ‎06-21-2004
Post 2 of 6

Re: processing drawings w/o opening them - no time improvment

05-23-2013 08:42 AM in reply to: kcimos

Opening the file as a side database or with ObjectDBX is much much faster then opening it in the editor.

How are you modifying the drawings?

---------------------------



(defun botsbuildbots() (botsbuildbots))
Valued Contributor
91 Posts
3 Kudos
Registered: ‎02-18-2010
Post 3 of 6

Re: processing drawings w/o opening them - no time improvment

05-23-2013 09:39 AM in reply to: arcticad

here is what my routine does to each DWG file in the set:

 

check that each XREF is on a particular layer which is locked & that the insertion point is 0,0

read the XREF status into an array

unlock that layer

reset the path of each XREF to a known existing location & reload the XREF

unload all XREFs

reload those that were loaded originally (status from the array)(most remain unloaded)

lock that layer

save

 

Valued Contributor
91 Posts
3 Kudos
Registered: ‎02-18-2010
Post 4 of 6

Re: processing drawings w/o opening them - no time improvment

05-23-2013 09:42 AM in reply to: kcimos

PS, this is done over a network

Active Contributor
39 Posts
1 Kudo
Registered: ‎06-22-2010
Post 5 of 6

Re: processing drawings w/o opening them - no time improvment

05-23-2013 12:30 PM in reply to: kcimos

Any way to test your code against a file on the local machine rather than the network?

 

FWIW - I usually pull files from a different building and the network latencies can greatly override the benefit of doing your processing in a side database. Especially when you consider the fact that others are doing their own network stuff and filling up the pipe as it were.

 

Regards,

 

Tom

Valued Mentor
370 Posts
175 Kudos
Registered: ‎05-06-2012
Post 6 of 6

Re: processing drawings w/o opening them - no time improvment

05-23-2013 09:25 PM in reply to: kcimos
If the drawings contain very little geometry visible in the initial view, and there is not a lot of startup code that runs on the opening of each drawing, the drawings may open quickly in the editor, and the difference between that and opening the drawings via Database.ReadDwgFile() may not be too significant, which is because AutoCAD doesn't initially read the entire database when it opens a drawing file in the editor.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!