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

can't Close all,and get document name

0 REPLIES 0
Reply
Message 1 of 1
师兄
590 Views, 0 Replies

can't Close all,and get document name

first question,I use below code to close all document,but every one is not same,get pDocIter count,often is not equal to current Reality, why?

 

void CloseAll()
{
AcApDocumentIterator* pDocIter=acDocManager->newAcApDocumentIterator();
AcApDocument* pDoc;
while(!pDocIter->done())
{
pDoc=pDocIter->document();
acdbSetDbmod(pDoc->database(),0);
acDocManager->closeDocument(pDoc);
pDocIter->step();
}
delete pDocIter;
pDocIter=NULL;

}

 

 

the second question,a document with name "drawing1",and it is no save to disk,then save this document to "c:\test.dwg",how can i know "c:\test.dwg" is from "drawing1"? i use Reactor ,but in VC++ and lisp , the result is not same to VBA,I think the vba is right

Sorry,My English is so bad,

 

;;lisp code: myfun1 is same myfun2 with result

(defun myfun1(a b)
(princ b)
)
(vlr-dwg-reactor nil (list (cons :vlr-beginSave 'myfun1)
(cons :vlr-saveComplete 'myfun

 

 

'below is vba,For the first time ,msgbox "drawing1",Second times is "c:\test.dwg"

'I think the vba is right

Private Sub AcadDocument_BeginSave(ByVal FileName As String)
MsgBox FileName
End Sub

Private Sub AcadDocument_EndSave(ByVal

 

 

//below is VC++ code ,is same to lisp

 

void CaiqsComCtl::beginSave(AcDbDatabase* pDB, const char* pIntendedName)
{
AfxMessageBox(pIntendedName);

 

}

 

void CaiqsComCtl::saveComplete(AcDbDatabase* pDb, const char* pActualName)
{
AfxMessageBox(pActualName);
}

 

 

 

 

 

 

 

 

 

 

0 REPLIES 0

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

Post to forums  

Autodesk Design & Make Report

”Boost