public bool DetermineDocumentType(ValidDocumentType validDocumentType, UpdateProgressBar updateProgressBar) { DocumentTypeEnum currentDocumentType; try { currentDocumentType = thisApplication.ActiveDocument.DocumentType; if (DocumentInfo.IsAssemblyDocument(currentDocumentType)) { topLevel.TraverseAssembly((AssemblyDocument)thisApplication.ActiveDocument, 0); validDocumentType(true); return(true); } else if ((DocumentInfo.IsPartDocument(currentDocumentType))) { validDocumentType(false); return(false); } else { validDocumentType(false); return(false); } } catch (Exception e) { validDocumentType(false); updateProgressBar(true); EventLogger.CreateLogEntry(e.Message + " " + e.StackTrace); return(false); } }
public bool ImportANewInventorModel(InventorConnectionStatus inventorConnectionStatus, ValidDocumentType validDocumentType, UpdateProgressBar updateProgressBar) { thisApplication = inventorConnection.CreateInventorConnection(); if (thisApplication == null) { inventorConnectionStatus(false); return(false); } else { inventorConnectionStatus(true); } if (!DetermineDocumentType(validDocumentType, updateProgressBar)) { return(false); } updateProgressBar(true); return(false); }