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

Opening, saving and closing dwgs

2 REPLIES 2
Reply
Message 1 of 3
Saumitra
283 Views, 2 Replies

Opening, saving and closing dwgs

Hi:

I am programmitically trying to add a document, perform some operations(insert blocks, titles), save and close the document. This is done in a loop to work with a set of documents. AutoCAD crashes on me giving a fatal error exception.

To test a simpler case, I just created a loop and then created, opened, saved and closed the doc in the loop. What I observed is that, even though I am saving and closing the document, the document actually does not close immediately. The close occurs at the end of the loop. Does anyone have any suggestions to correct this. I would like close a doc completely before the next one opens.

For xCounter = 0 To 10
_GlobalShare.AcadDoc = Autodesk.AutoCAD.ApplicationServices.Application _
.DocumentManager.Add(rtbDwgTemplate.Text)

dwgName = _DwgDirectory & "\" & "Saumitra_" & xCounter & ".dwg"

_GlobalShare.AcadDoc.Database.SaveAs (dwgName, DwgVersion.Current)
_GlobalShare.AcadDoc.CloseAndDiscard()
_GlobalShare.AcadDoc.Dispose()
_GlobalShare.AcadDoc = Nothing

Next

Thanks

Saumitra
2 REPLIES 2
Message 2 of 3
michael_vanhoose
in reply to: Saumitra

your better off switching to sdi 1
Message 3 of 3

Hi i am doing a parametric program using VBA,Vlisp,AutoCAD. am converting to Vb.Net and CAD2006. can you please help me to insert the external drawings (sideview.dwg, Topview.dwg) in active drawing file Using VB.Net......

It will help me a lot

Thanks in Advance

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