воскресенье, 15 июля 2012 г.

Чтение структуры файла SolidWorks 2007


Простецкий алгоритм для чтения структуры файла SolidWorks 2007


private void moveIter(Iterator iterator, String name) {
        while (iterator.hasNext()) {
            def it = iterator.next()
            if (it instanceof DocumentNode) {
                readDocumentNode(it, name)
            }
            if (it instanceof DirectoryNode) {
                DirectoryNode dn = (DirectoryNode) it
                String path = createPath(dn)
                moveIter(dn.entries, path)
            }
        }
    } 
private def readDocumentNode(DocumentNode documentNode, String path) {
        log.error('==-' + documentNode.name + path)
    }
private String createPath(DirectoryEntry directoryEntry) {
        String result = ''
        if (directoryEntry.parent) {
            result = createPath(directoryEntry.parent)
        }
        result = result + '/' + directoryEntry.name
        result
   }

В результате чего я получил такой список:


  • \005 DocumentSummaryInformation
  • \005SummaryInformation
  • Config-0-Properties
  • Header2
  • ISolidWorksInformation
  • ModelStamps
  • Preview
  • PreviewPNG

директория Contents
  • Config-0
  • CMgrHdr2
  • eModelLic
  • Config-0-GhostPartition
  • CnfgObjs
  • CMgr
  • OleItems
  • Config-0-LWDATA
  • Config-0-Partition
  • DisplayLists__ZLB
  • Definition

директория ThirdPty
  • MOLDFLOWXpress
  • Pw2StorageStream.1.35
  • Intermech_internal_structure
  • CM_MOTION_LOAD_1
  • Intermech_document_settings
  • CMMotionLoadMapU
  • PBPDFlt
  • SWA_Schedules
  • Animator__ZLB

директория ThirdPtyStore
  • VisualStates__ZLB
  • VisualStates_DisplayPane

директория _DL_VERSION_4400
  • DLUpdateStamp
  • History 
  • Biography 
  • AssyVisualData

директория swXmlContents
  • Tables__ZLB
  • KeyWords__ZLB
  • MATERIALTREE

Интересно, что в файле есть такие поля как Intermech, видимо они остаются если у вас в SolideWorks-е подключен плагин Intermech 

Комментариев нет:

Отправить комментарий