Close function, Inventor API

Top  Previous  Next

Here's an example of using the Close function on a PartDocument. Imagine we have opened and modified and existing file. Next we SaveAs to create a copy of our original part, then we Close the original without saving:

 

    // VARIANT_TRUE = Overwrite

    hRes = pPartDoc->SaveAs (CComBSTR(csPartFullFileName),VARIANT_TRUE) ; 

 

    // VARIANT_TRUE means skip save and don't show any dialogs

    hRes = pPartDoc->Close(VARIANT_TRUE) ; 

 

Notice the comment just before the call to Close. We've already saved the part with SaveAs, and we just want to close the document, and we don't want any further saving (or dialogs) to come up. Hence VARIANT_TRUE (which means SkipSave) is used.

Text, images and diagrams © 2021 Owen F. Ransen. All rights reserved. (But copy the source code as much as you want!)