.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

mdi - iterating many DWG files

1 REPLY 1
Reply
Message 1 of 2
kcimos
451 Views, 1 Reply

mdi - iterating many DWG files

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.

1 REPLY 1
Message 2 of 2
kcimos
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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost