.NET

.NET

Reply
Valued Contributor
kcimos
Posts: 91
Registered: ‎02-18-2010
Message 1 of 6 (227 Views)

processing drawings w/o opening them - no time improvment

227 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*
arcticad
Posts: 1,286
Registered: ‎06-21-2004
Message 2 of 6 (222 Views)

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
kcimos
Posts: 91
Registered: ‎02-18-2010
Message 3 of 6 (216 Views)

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
kcimos
Posts: 91
Registered: ‎02-18-2010
Message 4 of 6 (215 Views)

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
thoman999
Posts: 39
Registered: ‎06-22-2010
Message 5 of 6 (201 Views)

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
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 6 of 6 (177 Views)

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
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.