Quantcast
Channel: Autodesk AutoCAD forums
Viewing all articles
Browse latest Browse all 14319

Batch process and transaction not declared..

$
0
0

Hi:

I have a command to open some dwg files and print them. I´m using the Sub imprimePDF. When I did the code with (AutoCAD 2011 and VS 2008) , it runs ok but now it´s wrong.

This is the sub

Sub imprimePDF()
   Dim myDWG As Autodesk.AutoCAD.ApplicationServices.Document
   myDWG = Application.DocumentManager.MdiActiveDocument
   Application.SetSystemVariable("BACKGROUNDPLOT", 0)
   Using tr As Transaction =   Application.DocumentManager.MdiActiveDocument.TransactionManager.StartTransaction()
   Try
       Dim layMgr As LayoutManager = LayoutManager.Current
      Dim loObjId As ObjectId = layMgr.GetLayoutId(layMgr.CurrentLayout)
      Dim lo As Layout = DirectCast(tr.GetObject(loObjId, Autodesk.AutoCAD.DatabaseServices.OpenMode.ForRead), Layout)    error!
.........

end try

.........

end using

...

end sub

 

When I´m debugging the code, last sentence produces an error: 'tr not declared'  and I don't know why.

any ideas?

thanks


Viewing all articles
Browse latest Browse all 14319

Trending Articles