-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathimporterApp.py
911 lines (811 loc) · 28.4 KB
/
importerApp.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
# -*- coding: utf-8 -*-
'''
importerApp.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
from importerUtils import *
from importerConstants import VAL_UINT8, VAL_UINT16, VAL_UINT32
import importerSegNode
__author__ = "Jens M. Plonka"
__copyright__ = 'Copyright 2018, Germany'
__url__ = "https://www.github.com/jmplonka/InventorLoader"
class AppReader(SegmentReader):
def __init__(self, segment):
super(AppReader, self).__init__(segment)
self.defStyle = None
def readHeaderStyle(self, node, typeName = None, ref1Name = 'collection'):
i = node.Read_Header0(typeName)
i = node.ReadUInt8(i, 'u8_0')
i = node.ReadUInt16(i, 'u16_0')
if (self.version > 2019): i += 2 # skip 00 00
i = node.ReadUInt16A(i, 2, 'a0')
i = node.ReadUInt32(i, 'default')
i = node.ReadUInt32(i, 'u32')
i = node.ReadCrossRef(i, ref1Name)
i = node.ReadLen32Text16(i)
i = node.ReadLen32Text16(i, 'comment')
i = node.ReadUInt16(i, 'u16_1')
i = node.ReadLen32Text16(i, 'longName')
i = self.skipBlockSize(i)
return i
def Read_10389219(self, node):
i = node.Read_Header0()
i = node.ReadFloat64(i, 'f64_0')
i = node.ReadList2(i, importerSegNode._TYP_FLOAT64_, 'lst0')
return i
def Read_10D6C06B(self, node): # SheetMetalRule
i = self.readHeaderStyle(node, 'SheetMetalRule', )
i = node.ReadLen32Text16(i, 'txt_1')
i = node.ReadLen32Text16(i, 'txt_2')
i = node.ReadLen32Text16(i, 'txt_3')
i = node.ReadLen32Text16(i, 'txt_4')
i = node.ReadLen32Text16(i, 'txt_5')
i = node.ReadUInt32A(i, 3, 'a1')
i = node.ReadLen32Text16(i, 'txt_6')
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadLen32Text16(i, 'txt_7')
return i
def Read_11FBECCD(self, node):
i = node.Read_Header0()
i = node.ReadChildRef(i, 'material')
i = node.ReadChildRef(i, 'renderingStyle')
i = node.ReadChildRef(i, 'cld_2')
i = node.ReadChildRef(i, 'cld_3')
i = node.ReadChildRef(i, 'cld_4')
i = node.ReadChildRef(i, 'cld_5')
i = node.ReadChildRef(i, 'cld_6')
i = node.ReadChildRef(i, 'cld_7')
i = node.ReadChildRef(i, 'cld_8')
i = node.ReadUInt8(i, 'u8_0')
i = self.skipBlockSize(i)
if (self.version == 2011): i += 4
i = node.ReadChildRef(i, 'cld_9')
self.defStyle = node.get('renderingStyle')
if (self.version > 2015): i += 8 # skip 00 00 00 00 00 00 00 00
return i
def Read_1C4CFF13(self, node): # TextStyleCollection
i = self.readHeaderStyle(node, 'TextStyleCollection')
i = node.ReadList2(i, importerSegNode._TYP_NODE_REF_, 'lst0')
return i
def Read_1DA4647D(self, node):
i = node.Read_Header0()
return i
def Read_1E5CBB86(self, node): # Lighting
i = self.readHeaderStyle(node, 'Lighting')
i = node.ReadColorRGBA(i, 'color')
i = node.ReadList2(i, importerSegNode._TYP_LIGHTNING_, 'lst0')
return i
def Read_2AE52C91(self, node):
i = node.Read_Header0()
i = node.ReadUInt16A(i, 2, 'u16_0')
i = node.ReadLen32Text16(i, 'txt_0')
i = node.ReadLen32Text16(i, 'txt_1')
i = node.ReadLen32Text16(i, 'txt_2')
i = node.ReadParentRef(i)
return i
def Read_3235A9B8(self, node):
i = node.Read_Header0()
i = node.ReadUUID(i, 'uid_0')
i = node.ReadList2(i, importerSegNode._TYP_NODE_REF_, 'lst0')
i = node.ReadList6(i, importerSegNode._TYP_MAP_KEY_REF_, 'lst1')
i = node.ReadChildRef(i, 'cld_0')
if (self.version > 2010): i += 4 # skip 01 00 00 00
if (self.version > 2017): i += 8
return i
def Read_345EB9B1(self, node):
i = node.Read_Header0()
i = node.ReadList2(i, importerSegNode._TYP_NODE_REF_, 'lst0')
i = node.ReadUUID(i, 'uid_0')
i = node.ReadUUID(i, 'uid_1')
return i
def Read_36BC43F4(self, node):
i = self.readHeaderStyle(node)
i = node.ReadCrossRef(i, 'ref_0')
i = self.skipBlockSize(i)
i = node.ReadFloat64(i, 'f64_0')
i = node.ReadUInt32A(i, 4, 'a1')
i = node.ReadList2(i, importerSegNode._TYP_FLOAT64_, 'lst0')
i = node.ReadList2(i, importerSegNode._TYP_FLOAT64_, 'lst1')
i = self.ReadNodeRefs(node, i, 'leaders', importerSegNode.REF_CROSS)
i = self.ReadNodeRefs(node, i, 'a2', importerSegNode.REF_CROSS)
i = self.ReadNodeRefs(node, i, 'textures', importerSegNode.REF_CROSS)
i = self.ReadNodeRefs(node, i, 'a3', importerSegNode.REF_CROSS)
i = self.ReadNodeRefs(node, i, 'a4', importerSegNode.REF_CROSS)
i = self.ReadNodeRefs(node, i, 'frames', importerSegNode.REF_CROSS)
i = self.ReadNodeRefs(node, i, 'a5', importerSegNode.REF_CROSS)
i = self.ReadNodeRefs(node, i, 'a6', importerSegNode.REF_CROSS)
i = self.ReadNodeRefs(node, i, 'a7', importerSegNode.REF_CROSS)
i = self.ReadNodeRefs(node, i, 'a8', importerSegNode.REF_CROSS)
i = self.ReadNodeRefs(node, i, 'a9', importerSegNode.REF_CROSS)
i = self.ReadNodeRefs(node, i, 'texts', importerSegNode.REF_CROSS)
i = self.ReadNodeRefs(node, i, 'a10', importerSegNode.REF_CROSS)
i = self.ReadNodeRefs(node, i, 'a11', importerSegNode.REF_CROSS)
i = self.ReadNodeRefs(node, i, 'a12', importerSegNode.REF_CROSS)
i = self.ReadNodeRefs(node, i, 'a13', importerSegNode.REF_CROSS)
i = node.ReadList2(i, importerSegNode._TYP_STRING16_, 'lst2')
i = node.ReadUInt32A(i, 2, 'a14')
i = node.ReadList6(i, importerSegNode._TYP_MAP_TEXT8_REF_, 'lst3')
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadLen32Text16(i, 'txt1')
i = node.ReadUInt16(i, 'u16_2')
i = node.ReadLen32Text16(i, 'txt2')
i = node.ReadList2(i, importerSegNode._TYP_STRING16_, 'lst2')
return i
def Read_37186901(self, node):
i = node.Read_Header0()
i = node.ReadList2(i, importerSegNode._TYP_APP_1_, 'lst0')
i = self.skipBlockSize(i)
i = node.ReadUInt32(i, 'u32_0')
return i
def Read_3A645317(self, node):
i = node.Read_Header0()
i = node.ReadChildRef(i, 'layers')
return i
def Read_3F89DC90(self, node):
i = self.skipBlockSize(0)
i = node.ReadUInt32(i, 'u32_0')
i = self.skipBlockSize(i)
i = node.ReadUInt32(i, 'u32_1')
return i
def Read_4028969E(self, node):
i = node.Read_Header0()
i = node.ReadLen32Text16(i)
i = node.ReadLen32Text16(i, 'txt_0')
if (self.version < 2011):
i = node.ReadLen32Text16(i, 'length')
else:
i = node.ReadFloat64(i, 'length')
i = node.ReadUInt16(i, 'u16_0')
return i
def Read_42A65DAA(self, node):
i = node.Read_Header0()
i = node.ReadUInt32(i, 'u32_0')
return i
def Read_440F63D1(self, node):
i = self.readHeaderStyle(node)
i = node.ReadUInt32(i, 'u32_0')
if (self.version > 2024): i += 1 # skip 01
i = node.ReadUInt32A(i, 2, 'a3')
if (self.version > 2023): i += 4 # skip 0F 00 00 00
i = node.ReadUInt32(i, 'u32_1')
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadCrossRef(i, 'ref_2')
return i
def Read_461E402F(self, node):
i = self.skipBlockSize(0)
i = node.ReadChildRef(i, 'ref_0')
i = self.skipBlockSize(i)
return i
def Read_473180FD(self, node): # bound equation for bend compensation
i = node.Read_Header0('BoundEquation')
i = node.ReadLen32Text16(i, 'lBound')
i = node.ReadLen32Text16(i, 'uBound')
i = node.ReadUInt16A(i, 7, 'a0')
i = node.ReadLen32Text16(i, 'equation')
return i
def Read_55231213(self, node): # MateInterfaceDef
i = node.Read_Header0('iMate')
i = node.ReadUUID(i, 'uid_0')
i = self.skipBlockSize(i)
i = node.ReadUInt32A(i, 2, 'a0')
i = node.ReadLen32Text16(i)
i = node.ReadUInt32A(i, 2, 'a1')
i = self.skipBlockSize(i)
i = node.ReadUInt32A(i, 4, 'a2')
return i
def Read_553C5021(self, node):
i = node.Read_Header0()
i = node.ReadUInt16A(i, 4, 'a1')
i = self.skipBlockSize(i)
i = node.ReadLen32Text16(i)
i = node.ReadUUID(i, 'uid_0')
i = node.ReadList2(i, importerSegNode._TYP_NODE_REF_, 'lst0')
return i
def Read_61B5E2D1(self, node):
node.typeName = 'iMates'
i = self.skipBlockSize(0)
i = node.ReadList2(i, importerSegNode._TYP_NODE_REF_, 'imates')
i = node.ReadUInt32(i, 'u32_0')
return i
def Read_66DD88F6(self, node):
i = node.Read_Header0()
i = node.ReadList2(i, importerSegNode._TYP_UINT32_, 'lst0')
i = node.ReadList2(i, importerSegNode._TYP_UINT32_, 'lst1')
i = node.ReadList2(i, importerSegNode._TYP_UINT32_, 'lst2')
i = node.ReadUInt8(i, 'u8_0')
i = node.ReadList2(i, importerSegNode._TYP_UINT32_, 'lst3')
i = node.ReadList2(i, importerSegNode._TYP_FLOAT64_, 'lst4')
i = node.ReadList2(i, importerSegNode._TYP_UINT32_, 'lst5')
i = node.ReadList2(i, importerSegNode._TYP_UINT32_, 'lst6')
i = node.ReadList2(i, importerSegNode._TYP_UINT32_, 'lst7')
return i
def Read_6759D86E(self, node): # MaterialName
i = self.readHeaderStyle(node, 'MaterialName', 'materials')
if (self.version > 2012):
i = node.ReadLen32Text16(i, 'txt_1') # UUID's
i = node.ReadLen32Text16(i, 'txt_2') #
i = node.ReadLen32Text16(i, 'txt_3') # UUID's
i = node.ReadUInt16A(i, 2, 'a2')
i = node.ReadUUID(i, 'uid_0')
else:
node.set('txt_1', '')
node.set('txt_2', '')
node.set('txt_3', '')
node.set('a2', (0,0), VAL_UINT16)
node.set('uid_0', None)
i = node.ReadFloat64A(i, 8, 'a3')
i = node.ReadUInt8(i, 'u8_1')
i = node.ReadCrossRef(i, 'ref_0')
if (self.version > 2011):
i = node.ReadLen32Text16(i, 'txt_4')
a0, j = getUInt8A(node.data, i, len(node.data) - i)
if (len(a0) > 0):
logError(u"%s\t%s\t%s", getInventorFile()[0:getInventorFile().rindex('/')], node.typeName, ' '.join(['%0{0}X'.format(2) %(h) for h in a0]))
return i
def Read_6759D86F(self, node): # RenderingStyle
i = node.Read_Header0('RenderingStyle')
i = node.ReadUInt8(i, 'u8_0')
i = node.ReadUInt16(i, 'u16_0')
if (self.version > 2019): i += 2 # skip 00 00
i = node.ReadUInt16A(i, 2, 'a0')
i = node.ReadUInt32(i, 'default')
i = node.ReadUInt32(i, 'u32')
i = node.ReadCrossRef(i, 'ref1Name')
i = node.ReadLen32Text16(i)
if (self.version < 2013):
i = node.ReadLen32Text16(i, 'comment')
i = node.ReadUInt16(i, 'u16_1')
else:
node.set('comment', '')
node.set('u16_1', 0, VAL_UINT16)
i = node.ReadLen32Text16(i, 'longName')
i = self.skipBlockSize(i)
if (self.version > 2012):
i = node.ReadUInt16(i, 'u16_2')
i = node.ReadLen32Text16(i, 'txt_1')
i = node.ReadLen32Text16(i, 'txt_2')
i = node.ReadLen32Text16(i, 'txt_3')
i = node.ReadLen32Text16(i, 'txt_4')
i = node.ReadUInt16A(i, 2, 'a2')
i = node.ReadUUID(i, 'uid_0')
else:
node.set('u16_2', 0, VAL_UINT16)
node.set('txt_1', '')
node.set('txt_2', '')
node.set('txt_3', '')
node.set('txt_4', '')
node.set('a2', (0, 0), VAL_UINT16)
node.set('uid_0', None)
i = node.ReadMaterial(i, 2)
i = node.ReadLen32Text16(i, 'FileMapTexture')
i = node.ReadUInt8(i, 'u8_1')
i = node.ReadFloat32A(i, 4, 'vec4d_0')
i = self.skipBlockSize(i)
i = node.ReadFloat32_2D(i, 'vec2d_0') # 100.0, Texture scaling
i = node.ReadSInt32A(i, 2, 'a3')
i = node.ReadUInt8A(i, 5, 'a4')
i = node.ReadSInt32(i, 's32_0')
i = node.ReadFloat64(i, 'f32_1')
i = node.ReadLen32Text16(i, 'FileMapBump')
i = node.ReadSInt32(i, 's32_1')
i = node.ReadFloat64_3D(i, 'vec2d_1')
i = node.ReadLen32Text16(i, 'txt_7')
if (self.version > 2010 and self.version < 2013):
i = node.ReadLen32Text16(i, 'txt_8')
if (self.version > 2010 and self.version < 2013):
i = node.ReadFloat32_2D(i, 'a5')
if (self.version > 2012):
i = node.ReadFloat32_2D(i, 'a6')
if (self.version > 2014):
i = node.ReadLen32Text16(i, 'txt_9')
i = node.ReadUInt8(i, 'u8_2')
if (self.version > 2016):
i = node.ReadFloat32(i, 'f32_2')
i = node.ReadUInt8A(i, 3, 'a7')
i = node.ReadFloat32_3D(i, 'a8')
i = node.ReadUInt8(i, 'u8_3')
i = node.ReadFloat32A(i, 10, 'a9')
i = node.ReadUInt8(i, 'u8_4')
i = node.ReadFloat32A(i, 7, 'a10')
color = node.get('Color.diffuse')
setColor(node.name, color.red, color.green, color.blue)
if (self.version > 2018): i+= 8 # skip 00 00 00 00 00 00 00 00
return i
def Read_6759D870(self, node): # Settings
i = node.Read_Header0('Settings')
node.name = 'GreyRoom'
if (self.version < 2013):
i = self.skipBlockSize(i)
i = node.ReadList6(i, importerSegNode._TYP_MAP_TEXT8_REF_, 'lst0')
else:
i = node.ReadList7(i, importerSegNode._TYP_MAP_TEXT8_REF_, 'lst0')
i = node.ReadList6(i, importerSegNode._TYP_MAP_TEXT8_REF_, 'lst1')
i = node.ReadFloat64A(i, 24, 'a0')
i = node.ReadUInt32A(i, 2, 'a1')
i = self.skipBlockSize(i)
i = node.ReadUInt8(i, 'u8_0')
if (self.version > 2010):
i = node.ReadFloat64A(i, 10, 'a2')
i = node.ReadUInt8(i, 'u8_1')
i = node.ReadColorRGBA(i, 'c_0')
i = node.ReadFloat32(i, 'f_0')
i = node.ReadUInt16(i, 'u16_0')
if (self.version > 2019): i += 3 # skip 00 00 00
i = node.ReadFloat64(i, 'f_1')
i = node.ReadUInt32(i, 'u32_1')
i = node.ReadFloat64(i, 'f_2')
i = node.ReadUInt32(i, 'u32_2')
i = node.ReadFloat64(i, 'f_3')
if (self.version > 2019): i += 1 # skip 00
i = node.ReadFloat64_2D(i, 'a3')
i = node.ReadUInt32A(i, 2, 'a4')
if (self.version > 2011):
i = node.ReadUInt32(i, 'u32_4')
else:
node.set('u8_4', 0, VAL_UINT8)
i = node.ReadUInt32A(i, 3, 'a5')
i = node.ReadUInt8(i, 'u8_2')
if (self.version > 2023): i += 3 # skip 00 00 00 00
i = node.ReadUInt32(i, 'u32_3')
if (self.version > 2012):
i = node.ReadUInt8(i, 'u8_5')
if (self.version > 2015):
i = node.ReadUInt8(i, 'u8_6')
i = node.ReadUInt32(i, 'u32_5')
i = node.ReadColorRGBA(i, 'c_1')
i = node.ReadUInt32(i, 'u32_6')
i = node.ReadFloat32A(i, 5, 'f_4')
i = node.ReadUInt8(i, 'u8_7')
i = node.ReadLen32Text16(i)
i = len(node.data)
else:
node.set('u8_6', 0, VAL_UINT8)
node.set('u32_5', 1, VAL_UINT32)
node.set('c_1', Color(0x50, 0xA5, 0xD2, 0xFF))
node.set('u32_6', 0x11, VAL_UINT32)
node.set('f_4', (0., 0., 0., 1., 1.))
node.set('u8_7', 1, VAL_UINT8)
node.set('txt_1', node.name)
else:
node.set('u8_5', 1, VAL_UINT8)
node.set('u8_6', 0, VAL_UINT8)
node.set('u32_5', 1, VAL_UINT32)
node.set('c_1', Color(0x50, 0xA5, 0xD2, 0xFF))
node.set('u32_6', 0x11, VAL_UINT32)
node.set('f_4', (0., 0., 0., 1., 1.))
node.set('u8_7', 1, VAL_UINT8)
node.set('txt_1', node.name)
else:
i = node.ReadUInt32(i, 'u32_3')
return i
def Read_6B4C0C42(self, node):
i = node.Read_Header0()
i = node.ReadLen32Text16(i)
i = node.ReadParentRef(i)
return i
def Read_6D8A4AC7(self, node): # AngleInterfaceDef
i = node.Read_Header0('AngleInterfaceDef')
i = node.ReadUUID(i, 'uid_0')
i = self.skipBlockSize(i)
i = node.ReadUInt32A(i, 2, 'a0')
i = node.ReadLen32Text16(i, 'txt_0')
i = node.ReadUInt32A(i, 2, 'a1')
i = self.skipBlockSize(i)
return i
def Read_6D8A4AC8(self, node):
i = node.Read_Header0()
i = node.ReadUUID(i, 'uid_0')
i = self.skipBlockSize(i)
i = node.ReadUInt32A(i, 2, 'a0')
i = node.ReadLen32Text16(i, 'txt_0')
return i
def Read_6D8A4AC9(self, node): # InsertInterfaceDef
i = node.Read_Header0('InsertInterfaceDef')
i = node.ReadUUID(i, 'uid_0')
i = self.skipBlockSize(i)
i = node.ReadUInt32A(i, 2, 'a0')
i = node.ReadLen32Text16(i, 'txt_0')
i = node.ReadUInt32A(i, 2, 'a1')
return i
def Read_6DD8F4A0(self, node):
i = node.Read_Header0()
i = node.ReadLen32Text8(i)
i = node.ReadCrossRef(i, 'cld_0')
i = node.ReadParentRef(i)
i = node.ReadList6(i, importerSegNode._TYP_MAP_TEXT16_REF_, 'lst0')
i = node.ReadUInt32(i, 'codpage')
i = self.skipBlockSize(i)
if (self.version > 2012): i += 4 # skip 00 00 00 00
return i
def Read_6EAE8DFD(self, node):
i = self.readHeaderStyle(node)
i = node.ReadChildRef(i, 'ref_1')
i = node.ReadChildRef(i, 'ref_2')
i = node.ReadChildRef(i, 'ref_3')
i = node.ReadChildRef(i, 'ref_4')
i = node.ReadChildRef(i, 'ref_5')
i = node.ReadChildRef(i, 'ref_6')
i = node.ReadChildRef(i, 'ref_7')
i = node.ReadChildRef(i, 'ref_8')
i = node.ReadChildRef(i, 'ref_9')
i = node.ReadChildRef(i, 'ref_A')
i = node.ReadChildRef(i, 'ref_B')
i = node.ReadUInt8(i, 'u8_1')
i = node.ReadChildRef(i, 'ref_C')
return i
def Read_7313FAC3(self, node):
i = node.Read_Header0()
i = node.ReadList2(i, importerSegNode._TYP_NODE_REF_, 'lst0')
i = node.ReadUInt16A(i, 9, 'a0')
i = node.ReadList4(i, importerSegNode._TYP_STRING8_, 'lst1')
i = node.ReadUInt16A(i, 4, 'a1')
i = self.skipBlockSize(i)
i = node.ReadList2(i, importerSegNode._TYP_LIST_UINT32_A_, 'lst2')
i = self.skipBlockSize(i)
return i
def Read_7F644248(self, node): # Text
i = self.readHeaderStyle(node, 'Text')
i = node.ReadSInt32A(i, 3, 'a2')
i = node.ReadLen32Text16(i, 'FontName')
return i
def Read_81A9D693(self, node):
i = node.Read_Header0()
i = node.ReadUInt32(i, 'l0')
i = node.ReadUUID(i, 'uid_0')
return i
def Read_81AFC10F(self, node): # CompositeInterfaceDef
i = node.Read_Header0('CompositeInterfaceDef')
i = node.ReadUUID(i, 'uid_0')
i = self.skipBlockSize(i)
i = node.ReadUInt32A(i, 2, 'a0')
i = node.ReadLen32Text16(i)
return i
def Read_8C8E316C(self, node):
i = self.readHeaderStyle(node)
return i
def Read_49F5CA9B(self, node):
i = node.Read_Header0()
i = node.ReadUUID(i, 'uid_0')
i = node.ReadUInt32A(i, 6, 'a0')
i = node.ReadUUID(i, 'brepUID')
i = node.ReadUUID(i, 'graphicsUID')
i = node.ReadParentRef(i)
i = node.ReadList6(i, importerSegNode._TYP_MAP_KEY_REF_)
if (self.version < 2012):
node.set('u32_0', 5, VAL_UINT32)
else:
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadUInt16(i, 'u16_0')
i = self.skipBlockSize(i)
return i
def Read_9E11F9F6(self, node):
i = node.Read_Header0()
i = node.ReadUUID(i, 'uid_0')
i = node.ReadUInt32A(i, 6, 'a0')
i = node.ReadUUID(i, 'brepUID')
i = node.ReadUUID(i, 'graphicsUID')
i = node.ReadParentRef(i)
i = node.ReadList6(i, importerSegNode._TYP_MAP_KEY_REF_)
if (self.version < 2012):
node.set('u32_0', 5, VAL_UINT32)
else:
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadUInt16(i, 'u16_0')
i = self.skipBlockSize(i)
return i
def Read_9F81E4C8(self, node): # FeatureControlFrame
i = self.readHeaderStyle(node, 'FeatureControlFrame')
i = node.ReadFloat64_2D(i, 'a2')
i = node.ReadUInt32A(i, 6, 'a3')
i = node.ReadCrossRef(i, 'ref_0')
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadCrossRef(i, 'ref_1')
return i
def Read_A7A4FD41(self, node):
i = node.Read_Header0()
i = node.ReadLen32Text8(i)
i = node.ReadCrossRef(i, 'default')
i = node.ReadParentRef(i)
i = node.ReadList6(i, importerSegNode._TYP_MAP_TEXT16_REF_, 'lst0')
i = node.ReadUInt16(i, 'localeId') # Locale-ID / Language-ID
i = node.ReadUInt8A(i, 2, 'a0')
i = self.skipBlockSize(i)
return i
def Read_A3C6F29E(self, node):
i = node.Read_Header0()
return i
def Read_ADAF9728(self, node):
i = node.Read_Header0()
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadChildRef(i, 'ref_0')
return i
def ReadDimHeader(self, node, typeName=None):
tn = typeName
if (tn is None): tn = "Dim_" + node.typeName
i = node.Read_Header0(tn)
i = node.ReadUInt32A(i, 2, 'a0')
i = self.skipBlockSize(i)
if (self.version > 2023): i += 4 # skip 00 00 00 00
return i
def Read_2433ABAD(self, node):
i = self.ReadDimHeader(node)
return i
def Read_3214005D(self, node):
i = self.ReadDimHeader(node)
return i
def Read_422ECBCE(self, node):
i = self.ReadDimHeader(node)
i = node.ReadLen32Text16(i, 'txt_0')
return i
def Read_7E23DD2F(self, node):
i = self.ReadDimHeader(node)
return i
def Read_AEB2BD47(self, node):
i = self.ReadDimHeader(node)
return i
def Read_BF2030AB(self, node):
i = self.ReadDimHeader(node)
i = node.ReadLen32Text16(i, 'txt_0')
return i
def Read_CCA8D815(self, node):
i = self.ReadDimHeader(node)
return i
def Read_D0A64ABB(self, node):
i = self.ReadDimHeader(node)
i = node.ReadUInt32A(i, 2, 'a1')
if (self.version > 2010):
i = node.ReadUInt32(i, 'u32_0')
if (self.version > 2011):
i = node.ReadUInt32(i, 'u32_1')
else:
node.set('u32_1', 0x0E, VAL_UINT32)
i = node.ReadFloat64_2D(i, 'a2')
else:
node.set('u32_0', 0x13, VAL_UINT32)
node.set('u32_1', 0x0E, VAL_UINT32)
node.set('a2', (0.25, 0.1))
i = node.ReadFloat64_2D(i, 'a3')
return i
def Read_D0A64ABC(self, node):
i = self.ReadDimHeader(node)
return i
def Read_D0A64ABD(self, node):
i = self.ReadDimHeader(node)
return i
def Read_EFB5BE1A(self, node):
i = self.ReadDimHeader(node)
i = node.ReadLen32Text16(i, 'txt_0')
return i
def Read_F4DD03EC(self, node):
i = self.ReadDimHeader(node)
i = node.ReadLen32Text16(i)
return i
def Read_B5731134(self, node):
i = node.Read_Header0()
return i
def Read_B8610156(self, node):
i = node.Read_Header0()
return i
def Read_BA93BB36(self, node):
i = node.Read_Header0()
i = node.ReadLen32Text16(i)
i = node.ReadParentRef(i)
i = node.ReadUInt16(i, 'u16_0')
i = node.ReadLen32Text16(i, 'txt_0')
i = node.ReadUInt8(i, 'u8_0')
i = node.ReadUInt16A(i, 12, 'u16_1')
i = node.ReadLen32Text16(i, 'txt_1')
i = node.ReadLen32Text16(i, 'txt_2')
return i
def Read_C1AB98DD(self, node):
i = self.readHeaderStyle(node, 'Layer')
i = node.ReadFloat64(i, 'd0')
i = node.ReadUInt32(i, 'l1')
i = node.ReadFloat32A(i, 4, 'a1')
i = self.skipBlockSize(i)
i = node.ReadBoolean(i, 'b1')
i = node.ReadFloat64(i, 'd1')
i = node.ReadUInt8A(i, 3, 'a2')
return i
def Read_C5966B59(self, node):
i = node.Read_Header0()
i = node.ReadUInt32(i, 'u32_0')
return i
def Read_D4227E2D(self, node):
i = node.Read_Header0()
n, i = getUInt32(node.data, i)
i = node.ReadFloat64A(i, n, 'a0')
i = node.ReadUInt16(i, 'u16_0')
return i
def Read_D72E4F21(self, node): # Leader
i = self.readHeaderStyle(node, 'Leader')
i = node.ReadFloat64A(i, 4, 'a1')
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadUInt8(i, 'u8_1')
i = node.ReadUInt32(i, 'u32_1')
i = node.ReadUInt8(i, 'u8_2')
i = node.ReadUInt32(i, 'u32_2')
i = node.ReadFloat32(i, 'f0')
i = node.ReadUInt8(i, 'u8_3')
i = node.ReadFloat32_3D(i, 'a2')
i = node.ReadUInt8(i, 'u8_4')
i = node.ReadFloat32_3D(i, 'a3')
return i
def Read_DA6B0B3E(self, node): # SheetMetalUnfold
i = self.readHeaderStyle(node, 'SheetMetalUnfold')
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadLen32Text16(i, 'txt_1')
i = node.ReadLen32Text16(i, 'facK')
i = node.ReadList2(i, importerSegNode._TYP_NODE_REF_, 'lst0')
i = node.ReadUInt32(i, 'bendAngleType') # 3 = 'Open Angle', 2 = 'Bend Angle'
i = node.ReadFloat64_3D(i, 'a1')
i = node.ReadUInt16A(i, 3, 'a2')
i = node.ReadList2(i, importerSegNode._TYP_NODE_REF_, 'equations')
i = node.ReadLen32Text16(i, 'facSpline')
return i
def Read_DD4C4D3A(self, node): # ASMFlatPatternPartRepresentation
i = node.Read_Header0('ASMFlatPatternPartRepresentation')
i = node.ReadUUID(i, 'uid_0')
return i
def Read_E454FA4D(self, node):
i = node.Read_Header0()
i = node.ReadList2(i, importerSegNode._TYP_U32_TXT_TXT_DATA_, 'lst0')
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadList2(i, importerSegNode._TYP_U32_TXT_U32_LST2_, 'lst1')
i = node.ReadUInt32(i, 'u32_1')
i = node.ReadList2(i, importerSegNode._TYP_UINT16_A_, 'lst2', 2)
return i
def Read_E5DDE747(self, node):
i = node.Read_Header0()
i = node.ReadFloat64A(i, 16, 'a0')
if (self.version > 2023): i += 1 # skip 00
return i
def Read_E9874A94(self, node):
i = self.readHeaderStyle(node)
i = node.ReadUInt8A(i, 4, 'a2')
i = node.ReadFloat64(i, 'f_0')
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadCrossRef(i, 'ref_0')
i = node.ReadCrossRef(i, 'ref_1')
return i
def Read_ED6CD739(self, node):
i = node.Read_Header0()
i = node.ReadLen32Text16(i)
i = node.ReadLen32Text16(i, 'txt_0')
return i
def Read_F447C040(self, node):
i = node.Read_Header0()
return i
def Read_F6830E86(self, node):
i = node.Read_Header0()
i = node.ReadChildRef(i, 'ref_0')
i = node.ReadChildRef(i, 'ref_1')
i = node.ReadChildRef(i, 'ref_2')
i = node.ReadChildRef(i, 'ref_3')
i = self.skipBlockSize(i)
i = node.ReadChildRef(i, 'ref_4')
i = node.ReadChildRef(i, 'ref_5')
i = node.ReadChildRef(i, 'ref_6')
i = node.ReadChildRef(i, 'ref_7')
i = node.ReadChildRef(i, 'ref_8')
if (self.version < 2012):
i = node.ReadChildRef(i, 'ref_9')
i = node.ReadList6(i, importerSegNode._TYP_MAP_TEXT16_REF_, 'lst0')
i = node.ReadChildRef(i, 'ref_10')
return i
def Read_8B82CF25(self, node):
i = node.Read_Header0()
i = node.ReadUInt32(i, 'u32_0')
return i
def Read_F80032B8(self, node):
i = node.Read_Header0()
i = node.ReadList2(i, importerSegNode._TYP_APP_1_, 'lst0') #[<LHHHff""dBBB]
i = self.skipBlockSize(i)
i = node.ReadUInt32(i, 'u32_0')
return i
def Read_F8A779F9(self, node):
i = node.Read_Header0()
i = node.ReadChildRef(i, 'ref_1')
i = node.ReadChildRef(i, 'ref_2')
return i
def Read_F8D07626(self, node):
i = node.Read_Header0()
cnt, i = getUInt32(node.data, i)
lst = []
for j in range(cnt):
uid, i = getUUID(node.data, i)
txt, i = getLen32Text16(node.data, i)
lst.append((uid, txt))
i = node.ReadUUID(i, 'uid')
return i
def Read_FC1A2F4B(self, node):
i = node.Read_Header0()
i = node.ReadCrossRef(i, 'material')
return i
def Read_958DB976(self, node):
i = self.skipBlockSize(0, 2)
return i
def Read_C435E97C(self, node):
i = self.skipBlockSize(0, 2)
i = node.ReadLen32Text16(i)
return i
def Read_D8577FC4(self, node):
node.typeName = 'TextStyle'
i = self.skipBlockSize(0, 2)
i = node.ReadLen32Text16(i)
i = node.ReadUInt8A(i, 9, 'a0')
i = node.ReadLen32Text8(i, 'txt_0')
i = node.ReadUInt8(i, 'u8_0')
i = self.skipBlockSize(i)
i = node.ReadLen32Text8(i, 'txt_1')
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadUInt32(i, 'u32_1')
return i
def Read_FD1E8992(self, node):
i = self.skipBlockSize(0, 2)
i = node.ReadColorRGBA(i, 'color')
i = node.ReadUInt32(i, 'u32_0')
return i
def Read_FD1E8995(self, node):
i = self.skipBlockSize(0, 2)
return i
def Read_FD1E8997(self, node):
i = self.skipBlockSize(0, 2)
i = node.ReadUInt32(i, 'u32_0')
return i
def Read_276E3074(self, node): # Analysis Style
i = self.readHeaderStyle(node, 'AnalysisStyle')
return i
def Read_FD1E899A(self, node): # Analysis Style Draft
i = self.readHeaderStyle(node, 'AnalysisStyleDraft')
return i
def Read_FD1E899B(self, node): # Analysis Style Zebra
i = self.readHeaderStyle(node, 'AnalysisStyleZebra')
return i
def Read_FD1E899D(self, node): # Analysis Setup
i = self.readHeaderStyle(node, 'AnalysisSetup')
return i
def Read_FD1F3F21(self, node): # FlushInterfaceDef
i = node.Read_Header0('FlushInterfaceDef')
i = node.ReadUUID(i, 'uid_0')
i = node.ReadUInt32A(i, 2, 'a0')
i = node.ReadLen32Text16(i, 'txt_0')
return i
def Read_8DF3E25A(self, node): # Surface mark
i = self.readHeaderStyle(node)
i = node.ReadFloat32_2D(i, 'vec2d_0')
i = node.ReadFloat32_2D(i, 'vec2d_1')
i = node.ReadUInt32(i, 'i_1') # REF?
i = node.ReadFloat64(i, 'd_0')
i = node.ReadLen32Text16(i, 'txt_2')
i = node.ReadFloat32_2D(i, 'vec2d_2')
i = node.ReadFloat32_2D(i, 'vec2d_3')
i = node.ReadUInt32(i, 'i_2')
i = node.ReadFloat64(i, 'd_1')
i = node.ReadLen32Text16(i, 'txt_3')
i = node.ReadUInt8(i, 'i_3')
i = node.ReadLen32Text16(i, 'txt_4')
i = node.ReadUInt16(i, 'i_4')
return i
def Read_FD8DAA16(self, node): # Datum target
i = self.readHeaderStyle(node)
return i
def Read_FDA6D020(self, node): # LeaderCollection
i = node.Read_Header0('LeaderCollection')
i = node.ReadLen32Text8(i)
i = node.ReadCrossRef(i, 'default')
i = node.ReadParentRef(i)
i = node.ReadList6(i, importerSegNode._TYP_MAP_TEXT16_REF_, 'lst0')
i = node.ReadUInt16(i, 'localeId') # Locale-ID / Language-ID
return i
def postRead(self):
if (self.defStyle is not None):
color = self.defStyle.get('Color.diffuse')
if (color is not None):
setColorDefault(color.red, color.green, color.blue)
else:
logError(u"ERROR: %s has no 'Color.diffuse' property!", self.defStyle)
return super(AppReader, self).postRead()