-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathimporterBrowser.py
1286 lines (1062 loc) · 35.8 KB
/
importerBrowser.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- coding: utf-8 -*-
'''
importerBrowser.py:
Simple approach to read/analyse Autodesk (R) Invetor (R) part file's (IPT) browser view data.
The importer can read files from Autodesk (R) Invetor (R) Inventro V2010 on. Older versions will fail!
'''
from importerSegment import SegmentReader, checkReadAll
from importerUtils import *
from importerConstants import VAL_UINT16, VAL_UINT32, VAL_ENUM
import importerSegNode
__author__ = "Jens M. Plonka"
__copyright__ = 'Copyright 2018, Germany'
__url__ = "https://www.github.com/jmplonka/InventorLoader"
class BrowserReader(SegmentReader):
def __init__(self, segment):
super(BrowserReader, self).__init__(segment)
self.__Str53_u16_0 = 0
def Read_664(self, offset, node):
i = node.ReadUInt32(offset, 'index')
i = node.ReadUInt32(i, 'a2a')
i = node.ReadUInt8(i, 'u8_1a')
cnt, i = getUInt32(node.data, i)
i = node.ReadUInt32A(i, cnt, 'a2')
i = node.ReadUInt8(i, 'u8_1b')
i = node.ReadChildRef(i, 'ref_2')
i = node.ReadUInt16A(i, 3, 'a3')
i = node.ReadBoolean(i, 'b_1')
i = node.ReadUInt8(i, 'u8_2')
i = node.ReadUInt32(i, 'grIdx')
i = node.ReadUInt8(i, 'u8_3')
i = node.ReadUInt32(i, 'u32_0')
i = self.skipBlockSize(i)
return i
def ReadHeaderStr53(self, node, typeName = None):
if (typeName is not None):
node.typeName = typeName
i = node.ReadLen32Text16(0)
i = node.ReadUInt32(i, 'flags')
b, i = getBoolean(node.data, i)
if (b):
i = node.ReadUInt16(i, 'u16_0')
self.__Str53_u16_0 = node.get('u16_0')
else:
self.__Str53_u16_0 += 1
node.set('u16_0', self.__Str53_u16_0, VAL_UINT16)
i = node.ReadUInt16A(i, 3, 'a0')
i = self.skipBlockSize(i)
return i
def Read_Str01(self, offset, node):
i = node.ReadLen32Text16(offset)
i = node.ReadLen32Text16(i, 'txt_1')
i = node.ReadUInt8(i, 'b0')
i = self.skipBlockSize(i)
return i
def Read_09CB9719(self, node):
i = node.ReadUInt32A(0, 2, 'a0')
i = node.ReadList2(i, importerSegNode._TYP_UINT32_, 'lst0')
i = node.ReadList2(i, importerSegNode._TYP_UINT32_, 'lst1')
i = node.ReadSInt32A(i, 2, 'a1')
return i
def Read_09CB971A(self, node):
i = node.ReadUInt32A(0, 2, 'a0')
i = node.ReadList2(i, importerSegNode._TYP_NODE_X_REF_, 'lst0')
i = node.ReadList2(i, importerSegNode._TYP_UINT32_, 'lst1')
i = node.ReadSInt32A(i, 2, 'a1')
return i
def Read_189B3560(self, node):
i = node.Read_Header0()
i = node.ReadList2(i, importerSegNode._TYP_NODE_REF_, 'lst0')
i = node.ReadLen32Text16(i)
i = node.ReadUInt32(i, 'grIdx')
return i
def Read_1B16984A(self, node): # Hospital
node.typeName = 'Hospital'
i = node.ReadUInt16A(0, 3, 'a0')
i = self.skipBlockSize(i, 2)
i = node.ReadList6(i, importerSegNode._TYP_MAP_KEY_REF_, 'lst0')
i = node.ReadUInt8(i, 'u8_0')
return i
def Read_3683CE33(self, node): # RDxDiagSketchDimRefGeomFailed
node.typeName = "DiagSketchDimRefGeomFailed"
i = node.ReadParentRef(0)
i = node.ReadUInt32A(i, 3, 'a0')
return i
def Read_75839EBD(self, node):
i = node.ReadUInt32A(0, 2, 'a0')
i = node.ReadList2(i, importerSegNode._TYP_UINT32_, 'lst0')
i = node.ReadList2(i, importerSegNode._TYP_UINT32_, 'lst1')
i = node.ReadSInt32A(i, 2, 'a1')
return i
def Read_89B87C6F(self, node): # DiagProfileInvalidLoop
node.typeName = 'DiagProfileInvalidLoop'
i = self.skipBlockSize(0)
i = node.ReadUInt32A(i, 2, 'a0')
i = self.skipBlockSize(i)
return i
def Read_B251BFC0(self, node): # EntryManager
i = node.Read_Header0('EntryManager')
i = node.ReadList7(i, importerSegNode._TYP_MAP_KEY_REF_, 'entries')
i = node.ReadUInt32(i, 'u32_0')
return i
def Read_B75AE9EF(self, node):
i = node.ReadLen32Text16(0)
i = node.ReadUInt8(i, 'u8_0')
if (node.get('u8_0') > 0):
i = node.ReadUInt32(i, 'u32_0')
# i = node.ReadList1(i, importerSegNode._TYP_UINT8_, 'blob')
else:
i = node.ReadUInt16(i, 'u16_0')
i = node.ReadLen32Text16(i, 'str0')
i = node.ReadLen32Text16(i, 'str1')
i = node.ReadSInt32A(i, 4, 'a1')
i = node.ReadUInt8(i, 'u8_1')
i = node.ReadUInt16(i, 'u16_1')
i = node.ReadLen32Text16(i, 'str2')
i = node.ReadLen32Text16(i, 'str3')
i = node.ReadSInt32A(i, 2, 'a2')
return i
def Read_CBBCFA51(self, node):
i = node.ReadParentRef(0)
i = node.ReadUInt32A(i, 3, 'a0')
i = node.ReadUInt32(i, 'mask')
return i
def Read_D81CDE47(self, node): # NBxEntry
i = node.Read_Header0('NBxEntry')
i = node.ReadList2(i, importerSegNode._TYP_NODE_REF_, 'lst0')
i = self.Read_664(i, node)
i = node.ReadLen32Text16(i)
i = node.ReadLen32Text16(i, 'str0')
i = self.skipBlockSize(i)
i = node.ReadUInt16A(i, 3, 'a4')
i = node.ReadUInt8(i, 'u8_4')
return i
def Read_D9389A04(self, node):
i = node.ReadUInt16A(0, 10, 'a0')
i = self.skipBlockSize(i)
i = node.ReadList2(i, importerSegNode._TYP_NODE_X_REF_, 'lst0')
i = node.ReadUInt32A(i, 3, 'a1')
i = node.ReadBoolean(i, 'b0')
i = node.ReadUInt32A(i, 3, 'a2')
i = node.ReadBoolean(i, 'b1')
i = node.ReadUInt32A(i, 2, 'a3')
i = node.ReadBoolean(i, 'b2')
i = self.skipBlockSize(i, 3)
return i
def Read_D9F96B81(self, node):
i = node.Read_Header0()
i = node.ReadList2(i, importerSegNode._TYP_SINT32_, 'lst0')
i = node.ReadUInt32A(i, 3, 'a1')
i = node.ReadBoolean(i, 'b1')
i = node.ReadUInt32A(i, 3, 'a2')
i = node.ReadBoolean(i, 'b2')
i = node.ReadUInt32A(i, 2, 'a3')
i = node.ReadBoolean(i, 'b3')
i = node.ReadLen32Text16(i, 'txt1')
i = node.ReadLen32Text16(i, 'txt2')
return i
def Read_DDC7ED24(self, node):
i = node.Read_Header0()
i = self.skipBlockSize(i)
i = node.ReadUUID(i, 'uid_0')
i = node.ReadLen32Text16(i)
i = node.ReadUInt32(i, 'u32_0')
return i
def Read_DF9CA7B0(self, node):
i = node.Read_Header0()
i = node.ReadParentRef(i)
i = node.ReadChildRef(i, 'ref_0')
i = node.ReadLen32Text16(i)
i = node.ReadList4(i, importerSegNode._TYP_STRING8_, 'lst0')
i = node.ReadUInt16(i, 'u16')
i = node.ReadLen32Text16(i, 'val')
return i
def Read_E82BC461(self, node): # Slot Pattern
i = node.ReadUInt32(0, 'u32_2')
i = node.ReadList2(i, importerSegNode._TYP_NODE_REF_, 'lst0')
i = node.ReadList2(i, importerSegNode._TYP_NODE_REF_, 'lst1')
if (self.version > 2015):
i = node.ReadList2(i, importerSegNode._TYP_NODE_REF_, 'lst2')
else:
i = node.ReadChildRef(i, 'ref_1')
i = node.ReadUInt8(i, 'u8_0')
if (self.version > 2024): i += 1 # skip 00
i = node.ReadLen32Text16(i)
i = node.ReadUInt8A(i, 5, 'a0')
if (node.get('a0')[4] == 0):
node.set('u16_0', 0, VAL_UINT16)
else:
i = node.ReadUInt16(i, 'u16_0')
i = node.ReadUInt16A(i, 3, 'a4')
i = self.skipBlockSize(i)
i = node.ReadList2(i, importerSegNode._TYP_NODE_REF_, 'items')
i = self.Read_664(i, node)
i = self.skipBlockSize(i)
i = node.ReadUUID(i, 'uid_0')
i = node.ReadUInt32(i, 'u32_3')
i += 4 # skip 00 00 00 00
if (self.version > 2011): i += 4 # skip FF FF FF FF
node.Entry = True
return i
def Read_F757BC76(self, node):
i = node.Read_Header0()
i = node.ReadList2(i, importerSegNode._TYP_NODE_REF_, 'lst0')
i = node.ReadUInt32(i, 'index')
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadUInt8(i, 'u8_0')
i = self.ReadNodeRefs(node, i, 'lst1', importerSegNode.REF_CHILD)
i = node.ReadUInt8(i, 'u8_1')
i = node.ReadChildRef(i, 'ref_1')
i = node.ReadUInt32A(i, 2, 'a1')
i = node.ReadUInt32(i, 'u32_1')
i = node.ReadUInt8A(i, 5, 'a2')
i = self.skipBlockSize(i)
i = node.ReadLen32Text16(i)
i = node.ReadLen32Text16(i, 'str1')
i = node.ReadLen32Text16(i, 'str2')
i = node.ReadUInt32(i, 'u32_2')
i = node.ReadList2(i, importerSegNode._TYP_NODE_REF_, 'lst1')
i = node.ReadUInt8(i, 'u8_2')
i = self.skipBlockSize(i)
# 01 01 B7 00 00 00 00 00 00
return i
def Read_F7676AB1(self, node): # ???
i = node.ReadUInt32(0, 'flags')
i = node.ReadUInt8(i, 'u8_0')
i = node.ReadLen32Text16(i)
i = node.ReadUInt8(i, 'u8_4')
i = node.ReadUInt16A(i, 5, 'a0')
i = self.skipBlockSize(i)
i = node.ReadList2(i, importerSegNode._TYP_NODE_X_REF_, 'items')
i = self.Read_664(i, node)
i = self.skipBlockSize(i)
node.Entry = True
return i
###############
# Folder items
def ReadHeaderFolderItem(self, node, typeName = None):
i = node.Read_Header0(typeName)
i = node.ReadList2(i, importerSegNode._TYP_NODE_REF_, 'lst0')
i = self.Read_664(i, node)
i = self.Read_Str01(i, node)
return i
def Read_19910142(self, node): # 3rdParty
i = self.ReadHeaderFolderItem(node, '3rdParty')
return i
def Read_1A05345D(self, node): # AmFlushEntry
i = self.ReadHeaderFolderItem(node, '3rdParty')
return i
def Read_2178C7DA(self, node): # AmAssemblyFeaturePatternOccurrence
i = self.ReadHeaderFolderItem(node)
return i
def Read_2524F6EB(self, node): # AmDocEntry
i = self.ReadHeaderFolderItem(node)
i = node.ReadCrossRef(i, 'ref_0')
i = node.ReadUInt32(i, 'u32_1')
i = node.ReadBoolean(i, 'b4')
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadCrossRef(i, 'ref_3')
i = node.ReadCrossRef(i, 'ref_4')
i = node.ReadCrossRef(i, 'ref_5')
if (self.version > 2010): i += 4
return i
def Read_2AFABC56(self, node): # AmWeldSymMember
i = self.ReadHeaderFolderItem(node)
i = node.ReadUInt32(i, 'u32_2')
return i
def Read_2C57678C(self, node): # AmAssemblyFeaturesFolder
i = self.ReadHeaderFolderItem(node)
i = node.ReadUInt32(i, 'u32_2')
i = self.skipBlockSize(i)
return i
def Read_390F605A(self, node): # AmRepresentationFolder
i = self.ReadHeaderFolderItem(node)
i = node.ReadCrossRef(i, 'ref_0')
return i
def Read_41289EFF(self, node): # AmAssemblyFeatureParticipant
i = self.ReadHeaderFolderItem(node)
i = node.ReadUInt32(i, 'u32_2')
return i
def Read_44664C6F(self, node): # PartInterfaceFolderEntry
i = self.ReadHeaderFolderItem(node)
return i
def Read_44A91CA8(self, node): # AmAnnotationFolder
i = self.ReadHeaderFolderItem(node)
return i
def Read_48344B92(self, node): # AmRelateRotateTranslateEntry
i = self.ReadHeaderFolderItem(node)
return i
def Read_562BDC08(self, node): # AmConfiguration
i = self.ReadHeaderFolderItem(node)
i = node.ReadUUID(i, 'uid')
i = node.ReadUInt32(i, 'u32_2')
return i
def Read_58732973(self, node): # AmAssemblyFeaturesFolder
i = self.ReadHeaderFolderItem(node)
i = node.ReadUInt32(i, 'u32_3')
return i
def Read_5900CD82(self, node): # AmConfigurationsFolder
i = self.ReadHeaderFolderItem(node)
i = node.ReadUInt32(i, 'u32_3')
i = self.skipBlockSize(i)
return i
def Read_5913EBD7(self, node): # AmAssemblyFeature
i = self.ReadHeaderFolderItem(node)
i = node.ReadUInt32A(i, 2, 'a1')
i += 4
return i
def Read_60BEF47B(self, node): # BrowserFolder
i = self.ReadHeaderFolderItem(node)
i = node.ReadUInt32(i, 'u32_3')
i = self.skipBlockSize(i)
return i
def Read_684507FA(self, node): # AmAssemblyFeaturesFolder
i = self.ReadHeaderFolderItem(node)
return i
def Read_716B5CD1(self, node): # ATEntry
i = self.ReadHeaderFolderItem(node, 'AnalysisToolEntry')
i = node.ReadUInt32A(i, 2, 'a0')
return i
def Read_7427F757(self, node): # AmAssemblyFeature
i = self.ReadHeaderFolderItem(node)
i = node.ReadUInt32(i, 'u32_1')
i += 4
return i
def Read_767A2031(self, node): # AmPartInstEntry
i = self.ReadHeaderFolderItem(node)
i = node.ReadUInt32(i, 'u32_1')
if (self.version > 2022): i += 4 # skip 01 00 00 00
i = node.ReadUInt8(i, 'u8_4')
i = node.ReadUInt8(i, 'u8_5')
i = node.ReadUInt32(i, 'u32_2')
i = node.ReadLen32Text16(i, 'txt_2')
if (node.get('u8_4') == 0):
i = node.ReadUInt16(i, 'u16_1')
i = self.skipBlockSize(i)
return i
def Read_76D92543(self, node): # AmAnnotationEntry
i = self.ReadHeaderFolderItem(node)
return i
def Read_7DFCC817(self, node): # ConstructionFolderEntry
i = self.ReadHeaderFolderItem(node, 'ConstructionFolderEntry')
i = node.ReadSInt32(i, 's32_0')
return i
def Read_7DFCC818(self, node): # BucketEntry
i = self.ReadHeaderFolderItem(node)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadLen32Text16(i, 'str0')
i = node.ReadUInt32A(i, 2, 'a0')
return i
def Read_8326B9DD(self, node): # AmTransitionalEntry
i = self.ReadHeaderFolderItem(node)
return i
def Read_83FB036D(self, node):
i = self.ReadHeaderFolderItem(node)
i = node.ReadUInt32A(i, 4, 'a4')
return i
def Read_9180FF9E(self, node): # OriginEntryFolder
i = self.ReadHeaderFolderItem(node)
return i
def Read_9180FF9F(self, node): # OriginWorkFeatureEntry
i = self.ReadHeaderFolderItem(node)
i = node.ReadUInt32(i, 'u32_2')
i = node.ReadUInt8(i, 'u8_6')
return i
def Read_9E77CCC1(self, node): # AssmInterfaceFolderEntry
i = self.ReadHeaderFolderItem(node)
return i
def Read_9FFCDAFC(self, node): # AmConfigurationsFolder
i = self.ReadHeaderFolderItem(node)
i = node.ReadUInt32(i, 'u32_3')
i = self.skipBlockSize(i)
return i
def Read_6CDE7496(self, node): # AmAssemblyFeaturePatter
i = self.ReadHeaderFolderItem(node)
return i
def Read_A742A7CD(self, node): # AmAssemblyFeature
i = self.ReadHeaderFolderItem(node)
i = node.ReadUInt8(i, 'u8_6')
return i
def Read_AB12B392(self, node): # AssmMateInterfaceResultEntry
i = self.ReadHeaderFolderItem(node)
i = node.ReadUInt32A(i, 5, 'a4')
i = self.skipBlockSize(i, 2)
i = node.ReadUInt32(i, 'u32_3')
return i
def Read_AB12B393(self, node): # AssmFlushInterfaceResultEntry
i = self.ReadHeaderFolderItem(node)
i = node.ReadUInt32A(i, 5, 'a4')
i = self.skipBlockSize(i, 2)
return i
def Read_AB12B394(self, node): # AssmAngleInterfaceResultEntry
i = self.ReadHeaderFolderItem(node)
return i
def Read_AB12B396(self, node): # AssmInsertInterfaceResultEntry
i = self.ReadHeaderFolderItem(node)
i = node.ReadUInt32A(i, 5, 'a4')
i = self.skipBlockSize(i, 2)
return i
def Read_CA0059C5(self, node): # AmWeldingSymbol
i = self.ReadHeaderFolderItem(node)
i = node.ReadUInt32(i, 'u32_2')
return i
def Read_CAFCADC8(self, node): # AmSymmetryEntry
i = self.ReadHeaderFolderItem(node)
i = node.ReadUInt32A(i, 5, 'a4')
return i
def Read_CC79C7E9(self, node): # AmRepresentationFolder
i = self.ReadHeaderFolderItem(node)
i = node.ReadUInt32(i, 'u32_3')
i = self.skipBlockSize(i)
i = node.ReadCrossRef(i, 'ref_0')
if (self.version < 2012): i += 4 # skip REF
return i
def Read_D95A2DF2(self, node): # OleLinkAndEmbedEntry
i = self.ReadHeaderFolderItem(node)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadLen32Text16(i, 'str2')
i = node.ReadLen32Text16(i, 'str3')
i = node.ReadChildRef(i, 'ref_0')
return i
def Read_DAB388B1(self, node): # AmWeldsFolder
i = self.ReadHeaderFolderItem(node)
return i
def Read_E4DF20BB(self, node): # AmUCSEntry
i = self.ReadHeaderFolderItem(node)
return i
def Read_E50694D7(self, node): # AmPatternElementEntry
i = self.ReadHeaderFolderItem(node)
i = node.ReadUInt32A(i, 2, 'a4')
return i
def Read_E9AC0931(self, node): # AmViewRep
i = self.ReadHeaderFolderItem(node)
i = self.skipBlockSize(i)
i = node.ReadUInt32(i, 'u32_2')
return i
def Read_EA6894C1(self, node): # AmConstraintsEntry
i = self.ReadHeaderFolderItem(node)
return i
def Read_F02052E0(self, node): # AmConfiguration
i = self.ReadHeaderFolderItem(node)
i = self.skipBlockSize(i)
i = node.ReadUUID(i, 'uid')
i = node.ReadUInt32(i, 'u32_2')
i = node.ReadLen32Text16(i)
i = node.ReadUInt16A(i, 3, 'a4')
i = self.skipBlockSize(i)
return i
def Read_FEFA39AB(self, node): # AmDeselTable
i = self.ReadHeaderFolderItem(node)
i = node.ReadUInt16A(i, 3, 'a4')
i = node.ReadLen32Text16(i, 'txt_2')
return i
####################
# Joint items
def ReadHeaderJoint(self, node, typeName = None):
i = self.ReadHeaderFolderItem(node, typeName)
i = node.ReadFloat64(i, 'f64_0')
i = node.ReadUInt32A(i, 3, 'a2')
return i
def Read_3D5CABE0(self, node): # AmCylindricalJointEntry
i = self.ReadHeaderJoint(node, 'JointCylindrical')
return i
def Read_28BC24F0(self, node): # AmPlanarJointEntry
i = self.ReadHeaderJoint(node, 'JointPlanar')
return i
def Read_474E0249(self, node): # AmWeldJointEntry
i = self.ReadHeaderJoint(node, 'JointRigid')
return i
def Read_AA7B1426(self, node): # AmTranslationJointEntry
i = self.ReadHeaderJoint(node, 'JointSlider')
return i
def Read_CA52E762(self, node): # AmBallJointEntry
i = self.ReadHeaderJoint(node, 'JointBall')
return i
def Read_F9EDBED1(self, node): # AmRevoluteJointEntry
i = self.ReadHeaderJoint(node, 'JointRotation')
return i
####################
# Hospital items
def ReadHeaderHospitalItem(self, node, typeName = None):
if (typeName is not None):
node.typeName = typeName
i = node.ReadUInt32(0, 'u32_0')
i = self.skipBlockSize(i)
i = node.ReadUInt32(i, 'key') # the list index
i = self.skipBlockSize(i)
return i
def Read_037BF59B(self, node):
i = self.ReadHeaderHospitalItem(node)
i = node.ReadList2(i, importerSegNode._TYP_UINT32_, 'lst0')
i = node.ReadList2(i, importerSegNode._TYP_UINT32_A_, 'lst1', 2)
i = node.ReadUInt32(i, 'u32_2')
i = node.ReadUInt32(i, 'u32_3')
return i
def Read_09CB9718(self, node):
i = self.ReadHeaderHospitalItem(node)
i = node.ReadUInt32(i, 'u32_2')
i = self.skipBlockSize(i)
return i
def Read_2AFDB131(self, node):
i = self.ReadHeaderHospitalItem(node)
i = node.ReadUInt32(i, 'u32_2')
return i
def Read_44DBCB35(self, node):
i = self.ReadHeaderHospitalItem(node)
i = node.ReadUInt32(i, 'u32_2')
i = self.skipBlockSize(i)
i = self.skipBlockSize(i)
i = node.ReadUInt32(i, 'u32_3')
return i
def Read_52879851(self, node):
i = self.ReadHeaderHospitalItem(node)
i = node.ReadUInt32(i, 'u32_2')
i = self.skipBlockSize(i)
return i
def Read_58B90125(self, node):
i = self.ReadHeaderHospitalItem(node)
i = node.ReadList2(i, importerSegNode._TYP_UINT32_A_, 'lst1', 2)
i = node.ReadUInt32(i, 'u32_2')
return i
def Read_AC1898AD(self, node):
i = self.ReadHeaderHospitalItem(node)
i = node.ReadUInt32(i, 'u32_2')
return i
def Read_9B451345(self, node):
i = self.ReadHeaderHospitalItem(node)
i = node.ReadUInt32(i, 'u32_2')
i = node.ReadUInt32(i, 'u32_3')
return i
def Read_CCA058B3(self, node):
i = self.ReadHeaderHospitalItem(node)
i = node.ReadUInt32(i, 'u32_2')
i = node.ReadUInt32(i, 'u32_3')
return i
def Read_CF604E8B(self, node):
i = self.ReadHeaderHospitalItem(node)
i = node.ReadList2(i, importerSegNode._TYP_UINT32_A_, 'lst1', 2)
i = node.ReadUInt32(i, 'u32_2')
i = node.ReadUInt8(i, 'u8_2')
return i
def Read_D2B2DF09(self, node):
i = self.ReadHeaderHospitalItem(node)
i = node.ReadList2(i, importerSegNode._TYP_NODE_REF_, 'lst0')
i = node.ReadUInt32(i, 'u32_2')
return i
def Read_E7E4F967(self, node):
i = self.ReadHeaderHospitalItem(node)
i = node.ReadUInt32(i, 'u32_2')
i = node.ReadUInt32(i, 'u32_3')
i = node.ReadUInt16(i, 'u16_2')
return i
######
# Folder Entries
def ReadHeaderEntryFolder(self, node, typeName = None):
i = self.ReadHeaderFolderItem(node, typeName)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadLen32Text16(i, 'txt_2')
i = node.ReadLen32Text16(i, 'txt_3')
i = node.ReadSInt32A(i, 3, 'a1')
i = self.skipBlockSize(i)
return i
def Read_0E7F99A4(self, node):
i = self.ReadHeaderEntryFolder(node, 'SurfaceEntry')
return i
def Read_0F590179(self, node):
i = self.ReadHeaderEntryFolder(node, 'SolidEntry')
return i
def Read_67361CCF(self, node):
i = self.ReadHeaderEntryFolder(node, 'DiagEntry')
return i
def Read_69A4ED42(self, node):
i = self.ReadHeaderEntryFolder(node, 'WireEntry')
return i
#######
# Folder interfaces
def ReadHeaderEntry(self, node, typeName = None):
i = self.ReadHeaderStr53(node, typeName)
i = node.ReadList2(i, importerSegNode._TYP_NODE_X_REF_, 'items')
i = self.Read_664(i, node)
i = self.skipBlockSize(i)
node.Entry = True
return i
def Read_0C775998(self, node): # Annotations folder
i = self.ReadHeaderEntry(node, 'FolderAnnotations')
i = node.ReadUInt32(i, 'folderIdx')
return i
def Read_10B2DF6C(self, node): # ???.wire
i = self.ReadHeaderEntry(node)
return i
def Read_11D83D80(self, node): # EndOfPart
i = self.ReadHeaderEntry(node, 'EndOfPart')
return i
def Read_18BAA333(self, node): # ???
i = self.ReadHeaderEntry(node)
return i
def Read_1D8866A4(self, node): # 3D-Intersection
i = self.ReadHeaderEntry(node, 'Intersection3D')
return i
def Read_240BF169(self, node): # Bodies folder
i = self.ReadHeaderEntry(node, 'FolderBodies')
return i
def Read_2AC37C16(self, node): # Solid
i = self.ReadHeaderEntry(node, 'Solid')
return i
def Read_2B398DFB(self, node): # Project Cut Edge
i = self.ReadHeaderEntry(node, 'ProjectCutEdge')
return i
def Read_330C8EC7(self, node): # Blocks
i = self.ReadHeaderEntry(node, 'Blocks')
return i
def Read_33DDFC82(self, node): # Reference
i = self.ReadHeaderEntry(node, 'Reference')
if (self.version > 2016):
i = node.ReadLen32Text16(i, 'path')
return i
def Read_363E8E7D(self, node): # Mesh Feature
i = self.ReadHeaderEntry(node, 'MeshFeature')
i = node.ReadUInt32A(i, 2, 'a4')
return i
def Read_36F8D245(self, node): # Drawing
i = self.ReadHeaderEntry(node, 'Drawing')
return i
def Read_3E54E601(self, node): # Project to Surface
i = self.ReadHeaderEntry(node, 'Project2Surface')
i = node.ReadUInt32(i, 'u32_2')
i = self.skipBlockSize(i)
return i
def Read_420BDF59(self, node): # Flat Pattern
i = self.ReadHeaderEntry(node, 'PatternFlat')
return i
def Read_46DE5489(self, node): # Assembly reference
i = self.ReadHeaderEntry(node, 'ReferenceAssembly')
return i
def Read_4A156CBC(self, node): # 3D-Sketch
i = self.ReadHeaderEntry(node, 'Sketch3D')
return i
def Read_4D0B0CC5(self, node): # Text annotation
i = self.ReadHeaderEntry(node, 'AnnotationText')
i = node.ReadUInt32A(i, 3, 'a4')
cnt, i = getUInt32(node.data, i)
node.ReadUInt16A(i, cnt, 'a5')
return i
def Read_50C73580(self, node): # 3D-Object
i = self.ReadHeaderEntry(node, '3dObject')
i = node.ReadUInt8(i, 'u8_5')
if (self.version > 2016): i += 8 # skip ?? ?? ?? ?? ?? ?? ?? ??
if (self.version > 2020): i += 4 # skip ?? ?? ?? ??
return i
def Read_6531C640(self, node): # Flange
i = self.ReadHeaderEntry(node, 'Flange')
i = self.skipBlockSize(i)
return i
def Read_6CDD3AB0(self, node): # Browser folder
i = self.ReadHeaderEntry(node, 'FolderBrowser')
return i
def Read_74AD7D3C(self, node): # Wire
i = self.ReadHeaderEntry(node, 'Wire')
return i
def Read_74EEF6B7(self, node): # ???
i = self.ReadHeaderEntry(node)
return i
def Read_761C4FA0(self, node):
i = self.ReadHeaderEntry(node)
i = node.ReadUInt32(i, 'u32_1')
return i
def Read_7FC32FE5(self, node): # UCS Folder
i = self.ReadHeaderEntry(node, 'FolderUCS')
return i
def Read_82EBFBD9(self, node): # Direct Edit
i = self.ReadHeaderEntry(node, 'DirectEdit')
return i
def Read_84FA6B6C(self, node): # Table
i = self.ReadHeaderEntry(node, 'Table')
i = node.ReadUInt8A(i, 3, 'a4')
i = node.ReadLen32Text16(i, 'str0')
return i
def Read_87E10017(self, node): # Mesh folder
i = self.ReadHeaderEntry(node, 'MeshFolder')
i = node.ReadUInt32(i, 'u32_1')
if (node.get('u32_1') == 1):
i = node.ReadUInt32A(i, 5, 'a4')
return i
def Read_8BF242F4(self, node): # ???
i = self.ReadHeaderEntry(node)
i = node.ReadUInt16A(i, 2, 'a4')
return i
def Read_8C5986A1(self, node): # Edges
i = self.ReadHeaderEntry(node, 'Edges')
i = node.ReadUInt16A(i, 2, 'a4')
i = node.ReadUInt32(i, 'NtIdx')
return i
def Read_8D0F39C2(self, node): # Matches
i = self.ReadHeaderEntry(node, 'Matches')
return i
def Read_8E50B102(self, node): # Block
i = self.ReadHeaderEntry(node, 'Block')
return i
def Read_91D23C62(self, node): # Cropping
i = self.ReadHeaderEntry(node, 'Cropping')
return i
def Read_93C65F8A(self, node): # ???
i = self.ReadHeaderEntry(node)
return i
def Read_9632B3FA(self, node): # Face
i = self.ReadHeaderEntry(node, 'Face')
i = self.skipBlockSize(i)
return i
def Read_987C1C4E(self, node): # Matched Edge
i = self.ReadHeaderEntry(node, 'MatchedEdge')
return i
def Read_9C599498(self, node): # ???
i = self.ReadHeaderEntry(node)
return i
def Read_9C8323E5(self, node): # 2D Equation Curve
i = self.ReadHeaderEntry(node, 'EquationCurve2D')
return i
def Read_A1DF3B79(self, node): # Projected Loop
i = self.ReadHeaderEntry(node, 'ProjectedLoop')
return i
def Read_AF64BA30(self, node): # ???
i = self.ReadHeaderEntry(node)
cnt, i = getUInt32(node.data, i)
lst = []
for k in range(cnt):
a, i = getUInt32A(node.data, i, 3)
lst.append(a)
node.set('lst4', lst, VAL_UINT32)
return i
def Read_B4278FFF(self, node): # ???
i = self.ReadHeaderEntry(node)
return i
def Read_BAF2D1C6(self, node): # spiral curve
i = self.ReadHeaderEntry(node, 'SpiralCurve')
return i
def Read_BF03D5B6(self, node): # Contour Flange
i = self.ReadHeaderEntry(node, 'ContourFlange')
return i
def Read_C0465062(self, node): # Solid reference
i = self.ReadHeaderEntry(node, 'ReferenceSolid')
i = node.ReadUUID(i, 'ui')
return i
def Read_D6AB5953(self, node): # 3d Equation Curve
i = self.ReadHeaderEntry(node, 'EquationCurve3D')
return i
def Read_DCB9673A(self, node): # Refold
i = self.ReadHeaderEntry(node, 'Refold')
return i
def Read_DD1ADF96(self, node): # Body
i = self.ReadHeaderEntry(node, 'Body')
i = node.ReadUInt32(i, 'dcCreatorIdx')
i = node.ReadUInt32A(i, 2, 'a5')
return i
def Read_E079A121(self, node):
i = self.ReadHeaderEntry(node)
if (self.version > 2016):
i = node.ReadLen32Text16(i, 'txt_0')
return i
def Read_E14BDF12(self, node): # Pivot plate
i = self.ReadHeaderEntry(node, 'PivotPlate')
return i
def Read_E149D710(self, node):
i = self.ReadHeaderEntry(node)
return i
def Read_E4B915DD(self, node): # iFeature:N
i = self.ReadHeaderEntry(node, 'iFeature')
return i
def Read_E7A52E09(self, node): # Lofted Flange
i = self.ReadHeaderEntry(node, 'LoftedFlange')
return i
def Read_E84595D1(self, node): # Unfold
i = self.ReadHeaderEntry(node, 'Unfold')
return i
def Read_EAFCF33F(self, node): # Surface reference
i = self.ReadHeaderEntry(node, 'ReferenceSurface')
i = node.ReadUUID(i, 'ui')
return i
def Read_F1EDED3E(self, node):
i = self.ReadHeaderEntry(node)
return i
def Read_F7676AB0(self, node): # 2D-Sketch
i = self.ReadHeaderEntry(node, 'Sketch2D')
return i
def Read_F7676AB2(self, node): # Feature
i = self.ReadHeaderEntry(node, 'Feature')
i = node.ReadUUID(i, 'uid_0')
i = node.ReadUInt32(i, 'u32_2')
if (self.version > 2011):
i = node.ReadLen32Text16(i, 'txt_0')
i = node.ReadSInt32(i, 's32_0')
else:
node.set('txt_0', '', VAL_ENUM)
node.set('s32_0', -1)
return i
def Read_F8EEAD15(self, node): # Base
i = self.ReadHeaderEntry(node, 'Base')
return i
def Read_F99B4BFD(self, node): # Image
i = self.ReadHeaderEntry(node, 'Image')
return i
def Read_FCF044C3(self, node): # Part reference
i = self.ReadHeaderEntry(node, 'ReferencePart')
return i
####################
# Assembly Constraint sections
def ReadHeaderEntryConstraint(self, node, typeName = None):
i = self.ReadHeaderFolderItem(node, typeName)
i = node.ReadFloat64(i, 'offset')
i = node.ReadUInt32A(i, 2, 'a4')
i = node.ReadLen32Text16(i, 'participants') # the name of the objects
i = self.skipBlockSize(i)
return i
# Constraint items
def Read_48344B91(self, node): # Relate Rotation Constraint
i = self.ReadHeaderEntryConstraint(node, 'Rotation')
return i
def Read_98D79BB0(self, node): # AmMateEntry
i = self.ReadHeaderEntryConstraint(node, 'Mate')
i = node.ReadUInt32(i, 'u32_1')
return i
def Read_98D79BB1(self, node): # AmFlushEntry
i = self.ReadHeaderEntryConstraint(node, 'Flush')
return i
def Read_98D79BB2(self, node): # Tangent Constraint
i = self.ReadHeaderEntryConstraint(node, 'Tangent')
return i
def Read_B60617B3(self, node): # Insert Constraint
i = self.ReadHeaderEntryConstraint(node, 'Insert')
return i
def Read_D37599BD(self, node): # Angle Constraint
i = self.ReadHeaderEntryConstraint(node, 'Angle')
return i
####################