.NET

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

mdi - iterating many DWG files

199 Views, 1 Replies
01-08-2012 12:47 PM

I'm working on translating a VBA routine that worked just fine, to VB.NET & I have had a lot of porblems with it. Yes, I am new to VB.NET. My routine renames XREF file names & opens  drawings that have these files XREF'd into them & resets their paths to the renamed file. My VBA routine used a few thisdrawing.sendcommand operations to do things like reload xrefs, unlock layers etc. Some of these worked in the VB.NET version while I only had getten as far as having the only DWG open that  was the one which I call the routing from. When it gets into opening another drawing I start getting all sorts of problems.

 

I worked these out by creating a NEWDOC as DOCUMENT object & setting autodesk....MDIcurrentdocument to the filename of the just opened DWG file &  then eliminating my sendcommand calls & replaceing them with record table operations.

 

Now I'm getting a file access error when trying to reload an XREF using document.reloadxrefs(objectidcollection).

 

I can't post any code ight now, because I need to leave to go to the office & continue working on this + my code is a big huge mess & it would take anyone wanting to help a few hours to sift through it all. so I'll get back with some relevent portions.

 

I've tried not to nest transactions. I've tried to make sure all my transactions frpm  the current DWG not the original.

 

Any advise about how to work with multiple DWG files would be greatly apprieciated.

 

Maybe a simple example of reloading an XREF named "X" in a bunch of DWGs saved at some specific location could be given? Focusing on transactions, documents, & databases.

Valued Contributor
kcimos
Posts: 91
Registered: ‎02-18-2010
Message 2 of 2 (185 Views)

Re: mdi - iterating many DWG files

01-08-2012 04:11 PM in reply to: kcimos

OK, I figured out what was going on & it had nothing to do with my MDI processing per se. It was a string manipulation error that caused an XREF path to get renamed when it shouldn't have, therefore the file access error on reload.

 

I was working on an untested minor variation of the original VBA routine & thats why that error slipped throuogh the cracks.

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.