Issue
How to suppress the update dialog that is displayed while opening an assembly file where in one of its part file has been modified ?
When you edit a part file that has been referenced in an assembly and attempt to open the assembly this dialog is displayed. Programmatically this can be suppressed by setting the ‘SilentOperation’ property to ‘True’ as shown in the following sample VBA code:
NOTE: Before running this code make sure to edit one of the part files used in this assembly to notice the behavior.
VBA:
Sub Test()
ThisApplication.SilentOperation = True
Call ThisApplication.Documents.Open("C:\Temp\Sample.iam", True)
ThisApplication.SilentOperation = False
End Sub
C++:
void _Run()
{
HRESULT hr;
CComPtr<Application> Inv;
hr = Inv.CoCreateInstance(L"Inventor.Application");
if FAILED(hr)
{
return;
}
hr = Inv->put_Visible(TRUE);
CComPtr<Documents> Docs;
CComPtr<Document> Doc;
CComBSTR fname = "C:\\Temp\\Sample.iam";
hr = Inv->get_Documents(&Docs);
hr=Inv->put_SilentOperation(VARIANT_TRUE);
hr = Docs->Open(fname, VARIANT_TRUE, &Doc);
}
int main(int argc, char* argv[])
{
CoInitialize(NULL);
_Run();
CoUninitialize();
return 0;
}

Leave a Reply