.NET

.NET

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

processing drawings w/o opening them - no time improvment

210 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,285
Registered: ‎06-21-2004
Message 2 of 6 (205 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 (199 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 (198 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: 30
Registered: ‎06-22-2010
Message 5 of 6 (184 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 (160 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.
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 or visit the Installation and Licensing Forum to get help installing your software.