• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    .NET

    Reply
    Valued Contributor
    Posts: 60
    Registered: ‎02-18-2010

    mdi - iterating many DWG files

    128 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.

    Please use plain text.
    Valued Contributor
    Posts: 60
    Registered: ‎02-18-2010

    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.

    Please use plain text.