GetInventorDocTypeDesc |
Top Previous Next |
Here is a function which will show you a description of the document type using the document type enumerator:
typedef struct { DocumentTypeEnum eEnum ; const char* const pszDesc ; } DocDesc_t;
const DocDesc_t kDocDescs [] = { {kAssemblyDocumentObject, "Assembly Document"}, {kDesignElementDocumentObject, "Design Element Document"}, {kDrawingDocumentObject, "Drawing Document"}, {kForeignModelDocumentObject, "Foreign Model Document"}, {kNoDocument, "No Document"}, {kPartDocumentObject, "Part Document"}, {kPresentationDocumentObject, "Presentation Document"}, {kSATFileDocumentObject, "SAT File Document"}, {kUnknownDocumentObject, "Unknown Document"} } ;
static const UINT ikNumDocTypeDescs = sizeof (kDocDescs)/sizeof(kDocDescs[0]) ;
const char* const GetInventorDocTypeDesc(const DocumentTypeEnum eDocTypeEnum) { for (UINT i = 0 ; i < ikNumDocTypeDescs ; i++) { if (kDocDescs[i].eEnum == eDocTypeEnum) { return kDocDescs[i].pszDesc ; } }
// This is an error, I handle it recursively... return GetInventorDocTypeDesc(kUnknownDocumentObject) ; } |
Text, images and diagrams © 2021 Owen F. Ransen. All rights reserved. (But copy the source code as much as you want!)