Community
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"doormat" <fitia@lvvwd.com>How
wrote in message
href="news:f06574c.3@WebX.maYIadrTaRb">news:f06574c.3@WebX.maYIadrTaRb...
would one go about doing that in Single doc mode? Documents.close doesnt work
when SD is on.
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
Norm Yuan <
href="mailto:nyuan@trulinedrafting.com">nyuan@trulinedrafting.com>
wrote in message
href="news:528F31A69E4895A3FBAC1F629A74FEFE@in.WebX.maYIadrTaRb">news:528F31A69E4895A3FBAC1F629A7......
I don't know why you have to stick with SDI.
It is pose some problem with AutoCAD' SDI when doing automation in
AutoCAD.
If you have to go with SDI for some reason while
doing batch processing, you need start a new AutoCAD session, because
AcadDocument.Close ( ) method not only close the document, but also close the
AutoCAD session. So the ode should be like following:
Dim aApp as
AutoCAD.AcadApplication
Dim aDoc As
AcadDocument
Do
Set
aApp = New AutoCAD.AcadApplication
aApp.Visible = True
'Set SDI to
True because your special reason
aApp.Preferences.System.SingleDocumentMode = True
Set aDoc =
aApp.Documents.Open("yourFile.dwg")
'Do
something
here
aDoc.Close False 'AutoCAD is also
closed
Loop while an="Process
continue"
Since the AutoCAD sesion is on and off repeatedly, the batch processing
will take longer time than MDI. But due to Windows caching the last lauched
application, it is not that badly slow, now that you "have to" go with
SDI.
This code only works for VB program, not AutoCAD's VBA. For AutoCAD VBA,
you can only do such batch processing in MDI.
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
"doormat" <fitia@lvvwd.com>How
wrote in message
href="news:f06574c.3@WebX.maYIadrTaRb">news:f06574c.3@WebX.maYIadrTaRb...
would one go about doing that in Single doc mode? Documents.close doesnt
work when SD is on.