-
Notifications
You must be signed in to change notification settings - Fork 17
/
importerDC.py
9496 lines (8466 loc) · 309 KB
/
importerDC.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 -*-
'''
importerDC.py:
Importer for the Document's components
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 importerEeData import EeDataReader
from importerUtils import *
from importerClasses import Tolerances, Functions, VAL_UINT8, VAL_UINT16, VAL_UINT32, VAL_REF, VAL_STR16, VAL_ENUM
from xlrd import open_workbook
import importerSegNode, re
__author__ = "Jens M. Plonka"
__copyright__ = 'Copyright 2018, Germany'
__url__ = "https://www.github.com/jmplonka/InventorLoader"
def addEmptyLists(node, indexes):
for i in indexes:
node.set('lst%d' %(i), [])
class DCReader(EeDataReader):
DOC_ASSEMBLY = 1
DOC_DRAWING = 2
DOC_PART = 3
DOC_PRESENTATION = 4
def __init__(self, segment):
super(DCReader, self).__init__(segment)
segment.ntKeys = {}
########################################
# usability functions
def ReadClassInfo(self, node, offset, refName, idx = ''):
internal, i = getBoolean(node.data, offset) # internal reference ?
i = node.ReadUInt8(i, 'u8_0')
i = node.ReadCrossRef(i, refName)
if (not internal):
if (len(idx) == 0):
i = node.ReadLen32Text16(i)
else:
i = node.ReadLen32Text16(i, 'txt_0')
i = node.ReadLen32Text16(i, 'txt_1')
i = node.ReadUInt16(i, 'u16_0')
i = self.skipBlockSize(i)
return i
def Read2RefList(self, node, offset, name, type1 = importerSegNode.REF_CROSS, type2 = importerSegNode.REF_CROSS):
cnt, i = getUInt32(node.data, offset)
lst = []
for j in range(cnt):
ref1, i = self.ReadNodeRef(node, i, [j,0], type1, name)
ref2, i = self.ReadNodeRef(node, i, [j,1], type2, name)
lst.append([ref1, ref2])
node.set(name, lst)
return i
def ReadRefU32U8List(self, node, offset, name):
cnt, i = getUInt32(node.data, offset)
lst = []
for j in range(cnt):
ref, i = self.ReadNodeRef(node, i, [j, 0], importerSegNode.REF_CROSS, name)
val, i = getUInt32(node.data, i)
u8, i = getUInt8(node.data, i)
lst.append([ref, val, u8])
node.set(name, lst, VAL_UINT32)
return i
def ReadUInt32A(self, node, i, cnt, name, size):
lst = []
c = []
for j in range(cnt):
if (size > 1):
a, i = getUInt32A(node.data, i, size)
c.append('(%s)' %(IntArr2Str(a, 4)))
else:
a, i = getUInt32(node.data, i)
c.append('(%04X)' %(a))
lst.append(a)
node.set(name, lst, VAL_UINT32)
return i
def readTypedList(self, node, index, key, count, size, tolerance):
meta, i = getUInt32A(node.data, index, count)
lst = []
s = ''
sep = ''
for j in range(meta[0]):
if (size == 1):
f, i = getFloat64(node.data, i)
s += "%s%g" %(sep, f)
else:
f, i = getFloat64A(node.data, i, size)
s += "%s[%s]" %(sep, FloatArr2Str(f))
sep = ','
lst.append(f)
if (tolerance):
tol = 0
if (len(lst) > 0):
tol, i = getFloat64(node.data, i)
else:
tol = None
node.set(key, {'meta': meta, 'values': lst, 'tolerance': tol})
return i
'''
next: -> ReadHeaderLinkedElement
parameters: -> ReadHeaderParameter
H0 R s -> ReadHeaderParameter
H0 R s R s -> ReadOperatorUnary
H0 R s R s R s -> ReadOperator
H0 R L s P L -> ReadHeaderContent
H0 R L s P L s l s R (L6 L6)>2012 ss R -> ReadHeaderConstraint2D
H0 R L s P L s l s R s -> ReadHeaderCntSLRS
H0 R L s P L s l s R s L2 B R (L6 L6)>2012 s -> ReadHeaderConstraint3D
H0 R L s P L s l ss -> ReadHeadersS32ss
H0 R L s P L s l ss -> ReadHeaderFeature
H0 R L s P L s l ss L L2 s L s L2 R R R R R B -> ReadHeaderPattern
H0 R L s P L s l ss L R R R R R R R (R L)>2017 s -> ReadHeaderBendExtent
H0 R L s P L s l ss R R R R R R R R R R L2 (L)>2017 R -> ReadHeaderHemShape
H0 R L s P L s l ss L2 L s R H H T B L L L s -> ReadHeaderComponentDerived
H0 R L s P L s l ss CI L (L)>2017 s L s L8 L8 L8 s -> ReadHeaderEdgeId
H0 R L s P L s l sss L2 L2 L2 L L (R)>2011 s -> ReadHeaderFaceBound
H0 R L s P L s (l)>2018 R -> ReadCntHdr1SCross
H0 R L s P L ss (l)>2018 -> ReadCntHdr2S
H0 R L s P L ss (l)>2018 R -> ReadCntHdr2SCross/Child
H0 R L s P L sss (l)>2018 -> ReadCntHdr3S
H0 R L s P L sss (l)>2018 L2 (S32)? -> ReadHeaderIndexRefs
H0 R L s P L sss (l)>2018 h H s -> ReadHeaderEnum
H0 R L s P L sss (l)>2018 L s -> ReadHeadersss2S16s
H0 R L s P L sss (l)>2018 L s R R (L)>2017 s -> ReadHeaderSketch3DEntity
H0 R L s P L sss (l)>2018 L s s d d L2 L2 (L L2)>2012 (L2)>2019 -> ReadHeaderSketch2DEntity
H0 R L s P L sss (l)>2018 L s s d d L2 L2 (L L2)>2012 (L2)>2019 s L2 ((L L)>2019 L2 (L2)>2019)>2019 s -> ReadHeader2DEdge
H0 R L s UID T L2 L L L s R R s R R R R s -> ReadHeaderDocument
'''
#######################
# Parameter sections
def ReadHeaderParameter(self, node, typeName):
i = node.Read_Header0(typeName)
i = node.ReadChildRef(i, 'unit')
i = self.skipBlockSize(i)
return i
def Read_0AA8AF46(self, node): # ParameterConstant
i = self.ReadHeaderParameter(node, 'ParameterConstant')
i = node.ReadFloat64(i, 'value')
i = node.ReadSInt16(i, 's16_0')
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadLen32Text16(i)
if (node.name == 'PI') : node.name = 'pi'
elif (node.name == 'E'): node.name = 'e'
return i
def Read_F8A77A03(self, node): # ParameterFunction
i = self.ReadHeaderParameter(node, 'ParameterFunction')
i = node.ReadList2(i, importerSegNode._TYP_NODE_REF_, 'operands')
i = self.skipBlockSize(i)
i = node.ReadEnum16(i, 'name', None, Functions)
i = node.ReadUInt16(i, 'u16_0')
ref = node.get('operands')
if (len(ref) > 0):
node.set('operand', ref[0])
return i
def Read_F8A77A04(self, node): # ParameterValue
i = self.ReadHeaderParameter(node, 'ParameterValue')
i = node.ReadFloat64(i, 'value')
i = node.ReadUInt16(i, 'type')
if (self.version > 2010): i += 4
return i
def Read_F8A77A05(self, node): # ParameterRef
i = self.ReadHeaderParameter(node, 'ParameterRef')
i = node.ReadCrossRef(i, 'operand1')
return i
#######################
# unary Operator sections
def ReadOperatorUnary(self, node, typeName, name):
i = self.ReadHeaderParameter(node, typeName)
i = node.ReadChildRef(i, 'operand1')
i = self.skipBlockSize(i)
node.name = name
return i
def Read_F8A77A0C(self, node): return self.ReadOperatorUnary(node, 'ParameterOperatorUnaryMinus', '-')
def Read_F8A77A0D(self, node): return self.ReadOperatorUnary(node, 'ParameterOperatorPowerIdent', '^')
#######################
# Operator sections
def ReadOperator(self, node, typeName, name):
i = self.ReadOperatorUnary(node, typeName, name)
i = node.ReadChildRef(i, 'operand2')
i = self.skipBlockSize(i)
return i
def Read_F8A77A06(self, node): return self.ReadOperator(node, 'ParameterOperatorPlus' , '+')
def Read_F8A77A07(self, node): return self.ReadOperator(node, 'ParameterOperatorMinus' , '-')
def Read_F8A77A08(self, node): return self.ReadOperator(node, 'ParameterOperatorMul' , '*')
def Read_F8A77A09(self, node): return self.ReadOperator(node, 'ParameterOperatorDiv' , '/')
def Read_F8A77A0A(self, node): return self.ReadOperator(node, 'ParameterOperatorModulo', '%')
def Read_F8A77A0B(self, node): return self.ReadOperator(node, 'ParameterOperatorPower' , '^')
#######################
# content sections
def ReadHeaderContent(self, node, typeName = None, name = 'next'):
'''
Read the header for content objects like Sketch2D, Pads, ...
'''
i = node.Read_Header0(typeName)
if (name in ['next', 'creator']):
i = node.ReadChildRef(i, name)
else:
i = node.ReadCrossRef(i, name)
i = node.ReadUInt32(i, 'flags')
i = self.skipBlockSize(i)
i = node.ReadCrossRef(i)
i = node.ReadUInt32(i, 'index')
flags = node.get('flags')
node.visible = (flags & 0x00000400) > 0
node.dimensioningVisible = (flags & 0x00800000) > 0
self.segment.indexNodes[node.get('index')] = node
node.Item = True
return i
def Read_033E027B(self, node):
i = self.ReadHeaderContent(node)
return i
def Read_07910C0A(self, node):
i = self.ReadHeaderContent(node)
i = self.skipBlockSize(i)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadCrossRef(i, 'ref_2')
i = node.ReadCrossRef(i, 'ref_3')
return i
def Read_B4F8F817(self, node):
i = self.ReadHeaderContent(node)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadChildRef(i, 'ref_0')
i = node.ReadCrossRef(i, 'ref_1')
return i
def Read_0A576361(self, node):
i = self.ReadHeaderContent(node)
if (self.version > 2018): i += 4 # skip FF FF FF FF
return i
def Read_0AD21008(self, node):
i = self.ReadHeaderContent(node)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadList2(i, importerSegNode._TYP_NODE_X_REF_, 'lst0')
i = node.ReadCrossRef(i, 'ref_1')
return i
def Read_4B2376C4(self, node):
i = self.ReadHeaderContent(node)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadList2(i, importerSegNode._TYP_NODE_X_REF_, 'lst0')
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadCrossRef(i, 'ref_2')
return i
def Read_9C9E3CB3(self, node):
i = self.ReadHeaderContent(node)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadList2(i, importerSegNode._TYP_NODE_X_REF_, 'lst0')
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadCrossRef(i, 'ref_2')
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadLen32Text16(i, 'container') # CAT-Container path
return i
def Read_DD80AC37(self, node): # something to do with text-alignment
i = self.ReadHeaderContent(node)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadList2(i, importerSegNode._TYP_NODE_X_REF_, 'faces')
i = node.ReadCrossRef(i, 'refEdge')
i = node.ReadCrossRef(i, 'refString')
return i
def Read_DE172BCF(self, node): # ModelToleranceFeature {CEBC9A45-2058-4537-9D52-5E11419267DE}
i = self.ReadHeaderContent(node, 'ModelToleranceFeature')
i = node.ReadSInt32(i, 's32_0')
i = node.ReadList2(i, importerSegNode._TYP_NODE_X_REF_, 'faces')
i = node.ReadUInt32A(i, 2, 'a0')
i = node.ReadLen32Text16(i, 'clientId')
i = node.ReadCrossRef(i, 'parentToleranceFeature')
i = node.ReadCrossRef(i, 'ref_2')
i = node.ReadUInt32(i, 'u32_0')
if (self.version > 2018): i += 4 # skip 02 00 00 00
return i
def Read_0BA398EA(self, node):
i = self.ReadHeaderContent(node)
i = self.skipBlockSize(i)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadCrossRef(i, 'surface')
i = node.ReadCrossRef(i, 'bendType') # Relief
i = node.ReadCrossRef(i, 'useDefault')
return i
def Read_0CA07988(self, node):
i = self.ReadHeaderContent(node)
i = self.skipBlockSize(i)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadCrossRef(i, 'ref_2')
i = node.ReadCrossRef(i, 'ref_3')
i = node.ReadCrossRef(i, 'ref_4')
i = node.ReadCrossRef(i, 'ref_5')
i = node.ReadCrossRef(i, 'ref_6')
return i
def Read_0E64A759(self, node): # ModelGeneralNote {88C68B3A-B9B0-45DD-873C-FA0187B80E62}
i = self.ReadHeaderContent(node, 'ModelGeneralNote')
return i
def Read_1128AE62(self, node):
i = self.ReadHeaderContent(node)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadUInt32A(i, 2, 'a0')
i = node.ReadList6(i, importerSegNode._TYP_MAP_TEXT16_UINT32_, 'lst0')
i = node.ReadList6(i, importerSegNode._TYP_MAP_TEXT16_UINT32_, 'lst1')
i = node.ReadList6(i, importerSegNode._TYP_MAP_TEXT16_UINT32_, 'lst2')
i = node.ReadUInt32(i, 'u32_0')
return i
def Read_15A5FF92(self, node):
i = self.ReadHeaderContent(node)
return i
def Read_15E7211A(self, node):
i = self.ReadHeaderContent(node)
i = node.ReadUInt32A(i, 2, 'a0')
return i
def Read_16DE1A75(self, node): # DimensionAnnotation
i = self.ReadHeaderContent(node, 'AnnonatationDimension')
if (self.version > 2017): i += 4 # skip FF FF FF FF
if not((self.version == 2018) and (getFileBeta() > 0)):
i = node.ReadCrossRef(i, 'ref0')
i = node.ReadCrossRef(i, 'ref1')
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadCrossRef(i, 'ref2')
i = node.ReadCrossRef(i, 'ref4')
i = node.ReadCrossRef(i, 'ref5')
i = node.ReadCrossRef(i, 'ref6')
i = node.ReadCrossRef(i, 'ref7')
return i
def Read_19573122(self, node): # new in 2019
i = self.ReadHeaderContent(node)
if (self.version > 2017): i += 4 # skip FF,FF,FF,FF
i = node.ReadCrossRef(i, 'point')
i = node.ReadCrossRef(i, 'ref_1') # -> E70647C4
return i
def Read_1A1C8265(self, node):
i = self.ReadHeaderContent(node)
if (self.version > 2018): i += 4 # skip FF FF FF FF
i = node.ReadUInt32A(i, 2, 'a0') # (0002, 0000)
return i
def Read_220226D5(self, node): # Blocks
i = self.ReadHeaderContent(node, 'Blocks')
return i
def Read_223360AD(self, node):
i = self.ReadHeaderContent(node)
if (self.version > 2018): i += 4 # skip FF FF FF FF
return i
def Read_23BA0568(self, node):
i = self.ReadHeaderContent(node)
return i
def Read_26287E96(self, node): # iPart
i = self.ReadHeaderContent(node, 'iPart')
i = self.skipBlockSize(i)
i = node.ReadCrossRef(i, 'excelWorkbook')
i = node.ReadSInt32(i, 'rowIndex')
i = node.ReadUUID(i, 'uid')
i = node.ReadLen32Text16(i)
i = node.ReadCrossRef(i, 'refParent')
i = node.ReadList2(i, importerSegNode._TYP_NODE_X_REF_, 'iParts')
i = node.ReadBoolean(i, 'selected')
return i
def Read_274E16CD(self, node):
i = self.ReadHeaderContent(node)
i = self.skipBlockSize(i, 2)
i = node.ReadUUID(i, 'uid')
return i
def Read_288D7986(self, node):
i = self.ReadHeaderContent(node)
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadCrossRef(i, 'ref_2')
return i
def Read_28BE2D5B(self, node):
i = self.ReadHeaderContent(node)
i = self.skipBlockSize(i)
i = node.ReadFloat64_3D(i, 'a1')
i = node.ReadCrossRef(i, 'ref_0')
i = node.ReadUInt32(i, 'u32_0')
i = self.skipBlockSize(i)
i = node.ReadList2(i, importerSegNode._TYP_NODE_X_REF_, 'lst0')
return i
def Read_28E17530(self, node):
i = self.ReadHeaderContent(node)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadLen32Text16(i)
i = node.ReadCrossRef(i, 'ref_0')
i = node.ReadCrossRef(i, 'transformation')
i = node.ReadList2(i, importerSegNode._TYP_NODE_X_REF_, 'lst0')
return i
def Read_2AF9B62B(self, node):
i = self.ReadHeaderContent(node)
i = self.skipBlockSize(i)
i = node.ReadFloat64_3D(i, 'a1')
i = node.ReadCrossRef(i, 'ref_0')
i = node.ReadUInt32(i, 'u32_0')
i = self.skipBlockSize(i)
i = node.ReadUInt32(i, 'u32_1')
i = node.ReadFloat64(i, 'f0')
i = self.skipBlockSize(i)
i = node.ReadCrossRef(i, 'ref_1')
return i
def Read_2B241309(self, node): # BrowserFolder {9D063FDB-B597-49B0-8DBC-7EB3D5F715B8}
i = self.ReadHeaderContent(node, 'BrowserFolder')
i = self.skipBlockSize(i)
return i
def Read_2B60D993(self, node):
i = self.ReadHeaderContent(node)
return i
def Read_2D06CAD3(self, node): # ProjectCutEdges
i = self.ReadHeaderContent(node, 'ProjectCutEdges')
i = self.skipBlockSize(i)
i = node.ReadUInt32(i, 'u32_0')
i = self.skipBlockSize(i, 2)
i = node.ReadCrossRef(i, 'sketch')
i = self.Read2RefList(node, i, 'lst0', importerSegNode.REF_CHILD, importerSegNode.REF_CROSS)
i = node.ReadList2(i, importerSegNode._TYP_NODE_X_REF_, 'lst1')
i = node.ReadList2(i, importerSegNode._TYP_NODE_X_REF_, 'lst2')
return i
def Read_2D86FC26(self, node): # ReferenceEdgeLoopId
i = self.ReadHeaderContent(node, 'ReferenceEdgeLoopId')
i = self.skipBlockSize(i)
i = node.ReadUInt32(i, 'u32_0')
i = self.skipBlockSize(i, 2)
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadChildRef(i, 'ref_2')
i = node.ReadList6(i, importerSegNode._TYP_MAP_KEY_X_REF_, 'lst0')
i = node.ReadList6(i, importerSegNode._TYP_MAP_KEY_X_REF_, 'lst1')
return i
def Read_30F71B26(self, node):
i = self.ReadHeaderContent(node)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadUInt16A(i, 3, 'a0')
i = node.ReadLen32Text16(i)
return i
def Read_0334499C(self, node):
i = self.ReadHeaderContent(node)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadCrossRef(i, 'ref_2')
i = node.ReadCrossRef(i, 'transformation')
i = node.ReadCrossRef(i, 'part')
i = node.ReadList4(i, importerSegNode._TYP_NODE_X_REF_, 'lst0')
i = node.ReadChildRef(i, 'ref_3')
if (self.version > 2016): i += 4
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadList2(i, importerSegNode._TYP_UINT32_, 'lst0')
i = node.ReadLen32Text8(i, 'txt_0')
i = node.ReadList2(i, importerSegNode._TYP_UINT32_, 'lst1')
i = node.ReadUUID(i, 'uid')
i = node.ReadChildRef(i, 'ref_4')
i = node.ReadList6(i, importerSegNode._TYP_MAP_TEXT8_3D_F32_, 'lst2')
i = node.ReadFloat32A(i, 14, 'a1')
i = node.ReadLen32Text16(i)
return i
def Read_338634AC(self, node):
i = self.ReadHeaderContent(node)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadCrossRef(i, 'ref_2')
i = node.ReadCrossRef(i, 'transformation')
i = node.ReadCrossRef(i, 'part')
i = node.ReadList4(i, importerSegNode._TYP_NODE_X_REF_, 'lst0')
i = node.ReadChildRef(i, 'ref_3')
if (self.version > 2016): i += 4
i = node.ReadChildRef(i, 'ref_4')
return i
def Read_33B05D59(self, node):
i = self.ReadHeaderContent(node)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadCrossRef(i, 'bend')
i = node.ReadCrossRef(i, 'surface')
return i
def Read_346F5947(self, node):
i = self.ReadHeaderContent(node)
return i
def Read_381AF8C4(self, node):
i = self.ReadHeaderContent(node)
i = self.skipBlockSize(i)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadCrossRef(i, 'ref_2')
i = node.ReadCrossRef(i, 'ref_3')
return i
def Read_3AB895E9(self, node):
i = self.ReadHeaderContent(node)
i = self.skipBlockSize(i)
i = node.ReadChildRef(i, 'document')
return i
def Read_3B13313C(self, node):
i = self.ReadHeaderContent(node)
i = self.skipBlockSize(i)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadCrossRef(i, 'ref_2')
i = node.ReadCrossRef(i, 'ref_3')
i = node.ReadCrossRef(i, 'ref_4')
i = node.ReadCrossRef(i, 'ref_5')
return i
def Read_3BD61A2C(self, node):
i = self.ReadHeaderContent(node)
i = node.ReadLen32Text16(i)
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadCrossRef(i, 'ref_2')
i = node.ReadCrossRef(i, 'ref_3')
i = node.ReadLen32Text16(i, 'equation')
return i
def Read_3C7F67AA(self, node): # Bodies folder
i = self.ReadHeaderContent(node, 'BodiesFolder')
i = self.skipBlockSize(i, 2)
i = node.ReadUInt16(i, 'u16_0')
return i
def Read_3F4FA55F(self, node): # OffsetSplineDimConstraint {BBCEA345-055B-4625-ABCA-582C6BF7E440}
i = self.ReadHeaderContent(node, 'Dimension_OffsetSpline2D')
i = self.skipBlockSize(i)
i = node.ReadSInt32(i, 'flags2')
i = self.skipBlockSize(i)
i = node.ReadCrossRef(i, 'group')
i = self.skipBlockSize(i, 2)
if (self.version > 2012):
i = node.ReadList6(i, importerSegNode._TYP_MAP_X_REF_REF_, 'lst0')
i = node.ReadList6(i, importerSegNode._TYP_MAP_X_REF_REF_, 'lst1')
else:
node.set('lst0', {}, VAL_REF)
node.set('lst1', {}, VAL_REF)
i = node.ReadCrossRef(i, 'parameter')
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadCrossRef(i, 'ref_4')
return i
def Read_402A8F9F(self, node):
i = self.ReadHeaderContent(node, 'RotateClockwise')
if (self.version > 2010):
i += 8
else:
i += 12
i = node.ReadBoolean(i, 'value')
i = self.skipBlockSize(i)
if (self.version > 2018): i += 4 # skip 00 00 00 00
if (self.version > 2020): i += 4 # skip 00 00 00 00
return i
def Read_405AB2C6(self, node):
i = self.ReadHeaderContent(node)
return i
def Read_440C98C9(self, node):
i = self.ReadHeaderContent(node)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadCrossRef(i, 'ref_0')
i = node.ReadList2(i, importerSegNode._TYP_NODE_X_REF_, 'lst0')
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadUUID(i, 'id')
return i
def Read_4580CAF0(self, node):
i = self.ReadHeaderContent(node)
if (self.version > 2017): i += 4 # skip FF FF FF FF
i = node.ReadCrossRef(i, 'point')
i = node.ReadCrossRef(i, 'ref1')
i = node.ReadCrossRef(i, 'param1')
i = node.ReadCrossRef(i, 'param2')
return i
def Read_45825754(self, node):
i = self.ReadHeaderContent(node)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadUInt32(i, 'u32_1')
i = node.ReadCrossRef(i, 'transformation')
i = node.ReadCrossRef(i, 'parameter')
i = node.ReadCrossRef(i, 'entity3D')
i = node.ReadUInt8(i, 'u8_0')
return i
def Read_48C52258(self, node): # BSpline3D
i = self.ReadHeaderContent(node, 'BSpline3D')
i = self.skipBlockSize(i)
i = node.ReadSInt32(i, 'flags2')
i = self.skipBlockSize(i)
i = node.ReadCrossRef(i, 'group')
i = self.skipBlockSize(i)
i = node.ReadList2(i, importerSegNode._TYP_NODE_X_REF_, 'lst0')
i = node.ReadUInt8(i, 'u8_0')
i = node.ReadCrossRef(i, 'sketch')
if (self.version > 2012):
i = node.ReadList6(i, importerSegNode._TYP_MAP_KEY_X_REF_, 'lst1')
i = node.ReadList6(i, importerSegNode._TYP_MAP_KEY_X_REF_, 'lst2')
else:
i = self.skipBlockSize(i)
node.set('lst1', {}, VAL_REF)
node.set('lst2', {}, VAL_REF)
i = node.ReadUInt16(i, 'u16_0')
i = node.ReadList2(i, importerSegNode._TYP_NODE_X_REF_, 'points')
i = node.ReadUInt8(i, 'u8_1')
i = node.ReadCrossRef(i, 'bezier')
return i
def Read_4B050ACA(self, node):
i = self.ReadHeaderContent(node)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadCrossRef(i, 'plane')
i = node.ReadCrossRef(i, 'source')
i = node.ReadCrossRef(i, 'target')
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadCrossRef(i, 'ref_2')
i = node.ReadCrossRef(i, 'parameter')
i = node.ReadCrossRef(i, 'transformation')
return i
def Read_4E86F047(self, node): # Assembly: Placement-Constaint
i = self.ReadHeaderContent(node, 'Constraint')
i = self.skipBlockSize(i)
i = node.ReadSInt32(i, 's32_0')
i = self.skipBlockSize(i)
i = node.ReadCrossRef(i, 'ref_1') # participants
i = self.skipBlockSize(i)
i = node.ReadUInt8(i, 'style') # 1: mate, 2: flush, 3: angle, 14: symmetry
i = node.ReadList2(i, importerSegNode._TYP_NODE_REF_, 'selection')
i = node.ReadList2(i, importerSegNode._TYP_NODE_REF_, 'values') # 0=offset, 1=min, 2=max
i = node.ReadUInt8(i, 'u8_1')
i = node.ReadUInt32(i, 'u32_0')
if (self.version > 2010): i += 4 # skip 00 00 00 00
if (self.version > 2012): i += 1 # skip 03
return i
def Read_4E8F7EE5(self, node): # ModelFeatureControlFrame
i = self.ReadHeaderContent(node, 'ModelFeatureControlFrame')
return i
def Read_54846913(self, node):
i = self.ReadHeaderContent(node, 'Drawing')
i = node.ReadSInt32(i, 's32_0')
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadCrossRef(i, 'ref_2')
i = node.ReadFloat64(i, 'f64_1')
i = node.ReadUInt32(i, 'u32_0')
return i
def Read_5499A4B9(self, node):
i = self.ReadHeaderContent(node)
return i
def Read_55CE9B23(self, node):
i = self.ReadHeadersS32ss(node)
if (self.version > 2017): i += 4 # skip 00 00 00 00
i = node.ReadCrossRef(i, 'ref_0')
i = node.ReadUInt32(i, 'u32_1')
dummy, k = getUInt32(node.data, i)
if (dummy == 0):
i = k
i = self.ReadTransformation3D(node, i)
return i
def Read_5844C14D(self, node): # Folder for Point Clouds
i = self.ReadHeaderContent(node, 'PointCloudFolder')
return i
def Read_598AACFE(self, node):
i = self.ReadHeaderContent(node)
return i
def Read_5A6B6124(self, node):
i = self.ReadHeaderContent(node)
i = node.ReadUInt32(i, 'u32_0')
return i
def Read_5B708411(self, node):
i = self.ReadHeaderContent(node)
i = self.skipBlockSize(i)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadLen32Text16(i, 'txt0')
i = node.ReadChildRef(i, 'ref_1')
i = node.ReadChildRef(i, 'ref_2')
i = node.ReadChildRef(i, 'ref_3')
i = self.ReadTransformation3D(node, i)
i = node.ReadUInt32(i, 'u32_1')
return i
def Read_5D8C859D(self, node):
i = self.ReadHeaderContent(node)
i = self.skipBlockSize(i)
i = node.ReadSInt32(i, 'flags2')
i = self.skipBlockSize(i)
i = node.ReadCrossRef(i, 'group')
if (self.version > 2012):
i = node.ReadList6(i, importerSegNode._TYP_MAP_X_REF_FLOAT64_, 'lst0')
i = node.ReadList6(i, importerSegNode._TYP_MAP_X_REF_REF_, 'lst1')
else:
node.set('lst0', {}, VAL_REF)
node.set('lst1', {}, VAL_REF)
i = node.ReadList2(i, importerSegNode._TYP_NODE_X_REF_, 'lst2')
return i
def Read_5E464B13(self, node): # ModelSurfaceTextureSymbol
i = self.ReadHeaderContent(node, 'ModelSurfaceTextureSymbol')
if (self.version > 2017): i += 4 # skip FF FF FF FF
return i
def Read_63D9BDC4(self, node):
i = self.ReadHeaderContent(node)
return i
def Read_6489E49C(self, node):
i = self.ReadHeaderContent(node)
if (self.version > 2018): i += 4
i = node.ReadUInt32(i, 'u32_0')
return i
def Read_6514096C(self, node):
i = self.ReadHeaderContent(node)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadLen32Text16(i)
i = self.ReadClassInfo(node, i, 'ref_1')
i = node.ReadUInt32(i, 'u32_1')
i = node.ReadCrossRef(i, 'ref_2')
i = node.ReadCrossRef(i, 'ref_3')
i = node.ReadCrossRef(i, 'ref_4')
return i
def Read_6566C3E1(self, node): # LinearModelDimension
i = self.ReadHeaderContent(node, 'ModelDimensionLinear')
return i
def Read_65897E4A(self, node):
i = self.ReadHeaderContent(node)
return i
def Read_66B388ED(self, node):
i = self.ReadHeaderContent(node)
i = node.ReadUInt32A(i, 2, 'a0')
return i
def Read_671CE131(self, node):
i = self.ReadHeaderContent(node)
if (self.version > 2017): i += 4 # skip FF FF FF FF
i = node.ReadList2(i, importerSegNode._TYP_NODE_X_REF_, 'lst0')
return i
def Read_6C5CD68F(self, node):
i = self.ReadHeaderContent(node)
return i
def Read_6C5CD690(self, node):
i = self.ReadHeaderContent(node)
return i
def Read_6BE30AF0(self, node):
i = self.ReadHeaderContent(node)
if (self.version > 2017): i += 4 # skip FF FF FF FF
i = node.ReadList2(i, importerSegNode._TYP_NODE_X_REF_, 'faces')
i = node.ReadList2(i, importerSegNode._TYP_NODE_X_REF_, 'edges')
return i
def Read_6F7A6F97(self, node):
i = self.ReadHeaderContent(node)
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadCrossRef(i, 'ref_2')
i = node.ReadCrossRef(i, 'ref_3')
i = node.ReadUInt16(i, 'u16_0')
return i
def Read_6FB0D4A7(self, node): # ModelLeaderNote {5194100D-435F-4C85-A922-6BD3E4CC9C36}
i = self.ReadHeaderContent(node, 'ModelLeaderNote')
return i
def Read_6FD9928E(self, node):
i = self.ReadHeaderContent(node)
return i
def Read_71C0D0C6(self, node):
i = self.ReadHeaderContent(node)
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadCrossRef(i, 'ref_2')
i = node.ReadCrossRef(i, 'ref_3')
i = node.ReadCrossRef(i, 'ref_4')
return i
def Read_72E450AC(self, node):
i = self.ReadHeaderContent(node)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadList6(i, importerSegNode._TYP_MAP_U32_U32_, 'lst0')
i = node.ReadList6(i, importerSegNode._TYP_MAP_U32_U32_, 'lst1')
i = node.ReadCrossRef(i, 'ref_2')
i = node.ReadCrossRef(i, 'ref_3')
i = node.ReadCrossRef(i, 'ref_4')
return i
def Read_76BDB118(self, node): # new in 2015
i = self.ReadHeaderContent(node, 'Freeform')
if (self.version > 2017): i += 4 # skip FF FF FF FF
if (self.version > 2020): i += 4 # skip FF FF FF FF
i = node.ReadChildRef(i, 'wrapper')
i = node.ReadList2(i, importerSegNode._TYP_NODE_REF_, 'wrappers')
i = node.ReadUInt32(i, 'u32_1')
return i
def Read_7C321197(self, node):
i = self.ReadHeaderContent(node)
return i
def Read_7DA7F733(self, node):
i = self.ReadHeaderContent(node)
i = self.skipBlockSize(i)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadCrossRef(i, 'ref_2')
i = node.ReadCrossRef(i, 'ref_3')
i = node.ReadCrossRef(i, 'ref_4')
i = node.ReadCrossRef(i, 'ref_5')
i = node.ReadCrossRef(i, 'ref_6')
i = node.ReadUInt16A(i, 9, 'a0')
i = node.ReadCrossRef(i, 'ref_7')
return i
def Read_7E15AA39(self, node):
i = self.ReadHeaderContent(node)
if (self.version > 2018): i += 4 # skip FF FF FF FF
if (self.version > 2020):
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadList2(i, importerSegNode._TYP_UINT32_, 'lst0') # really UINT32???
return i
def Read_7F7F05AC(self, node):
i = self.ReadHeaderContent(node)
if (self.version > 2017): i += 4 # skip FF FF FF FF
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadFloat64_3D(i, 'p1')
i = node.ReadFloat64_3D(i, 'p2')
i = node.ReadUInt32(i, 'u32_1')
i = node.ReadFloat64(i, 'f64_0')
i = node.ReadCrossRef(i, 'point')
i = node.ReadUInt32(i, 'u32')
return i
def Read_81E94AB7(self, node):
i = self.ReadHeaderContent(node, 'SurfaceDetails')
if (self.version > 2018): i += 4 # skip FF FF FF FF
i = node.ReadFloat64A(i, 4, 'a0')
i = node.ReadUInt8A(i, 11, 'a1')
i = node.ReadFloat64A(i, 6, 'a2')
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadChildRef(i, 'ref0')
i = node.ReadChildRef(i, 'ref1')
i = node.ReadChildRef(i, 'ref2')
i = node.ReadChildRef(i, 'ref3')
i = node.ReadChildRef(i, 'ref4')
i = node.ReadChildRef(i, 'ref5')
i = node.ReadChildRef(i, 'ref6')
i = node.ReadChildRef(i, 'ref7')
i = node.ReadChildRef(i, 'ref8')
i = node.ReadChildRef(i, 'ref9')
i = node.ReadChildRef(i, 'refA')
i = node.ReadChildRef(i, 'refB')
i = node.ReadChildRef(i, 'refC')
i = node.ReadChildRef(i, 'refD')
return i
def Read_86A4AAC4(self, node): # SketchBlock
i = self.ReadHeaderContent(node, 'SketchBlock')
i = node.ReadSInt32(i, 's32_0')
i = node.ReadUInt32(i, 'numEntities')
i = node.ReadList8(i, importerSegNode._TYP_NODE_X_REF_, 'entities')
i = node.ReadCrossRef(i, 'transformation')
i = node.ReadCrossRef(i, 'direction')
i = node.ReadUInt32A(i, 2, 'a0')
i = node.ReadList2(i, importerSegNode._TYP_NODE_X_REF_, 'blocks')
if (self.version > 2012):
i = node.ReadList2(i, importerSegNode._TYP_NODE_X_REF_, 'lst1')
else:
node.set('lst1', [], VAL_REF)
i = node.ReadCrossRef(i, 'anchor')
i = node.ReadUUID(i, 'id')
i = node.ReadUInt32(i, 'u32_0')
return i
def Read_86CF7D57(self, node):
i = self.ReadHeaderContent(node)
return i
def Read_8740B863(self, node):
i = self.ReadHeaderContent(node, 'EquationCurve2D')
i = node.ReadSInt32(i, 's32_0')
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadCrossRef(i, 'ref_2')
i = node.ReadCrossRef(i, 'ref_3')
i = node.ReadCrossRef(i, 'ref_4')
i = node.ReadCrossRef(i, 'ref_5')
i = node.ReadCrossRef(i, 'ref_6')
return i
def Read_8946E9E8(self, node): # MeshPart
i = self.ReadHeaderContent(node, 'MeshPart')
if (self.version > 2018):i += 4 # 0xFFFFFF
i = node.ReadUInt32(i, 'u32_0')
return i
def Read_8B1E9A97(self, node):
i = self.ReadHeaderContent(node)
i = self.skipBlockSize(i)
i = node.ReadSInt32(i, 's32_0')
i = node.ReadCrossRef(i, 'ref_1')
i = node.ReadList2(i, importerSegNode._TYP_UINT32_, 'lst0')
if (self.version < 2012):
i = node.ReadList8(i, importerSegNode._TYP_NODE_X_REF_, 'lst1')
return i
def Read_8EE901B9(self, node):
i = self.ReadHeaderContent(node)
return i
def Read_8EC6B314(self, node):
i = self.ReadHeaderContent(node)
i = self.skipBlockSize(i)
i = node.ReadSInt32(i, 's32_0')
i = self.skipBlockSize(i)
i = node.ReadCrossRef(i, 'group')
if (self.version > 2012):
i = node.ReadList6(i, importerSegNode._TYP_MAP_X_REF_FLOAT64_, 'lst1')
i = node.ReadList6(i, importerSegNode._TYP_MAP_X_REF_REF_, 'lst2')
else:
i = self.skipBlockSize(i, 2)
node.set('lst1', {}, VAL_REF)
node.set('lst2', {}, VAL_REF)
i = node.ReadUInt32(i, 'u32_0')
i = node.ReadCrossRef(i, 'spline')
i = node.ReadCrossRef(i, 'line')
return i
def Read_90874D40(self, node): # Mapping of parameters
i = self.ReadHeaderContent(node, 'ParameterMappings')
i = self.skipBlockSize(i)
i = node.ReadSInt32(i, 's32_0')
i = self.skipBlockSize(i)
i = node.ReadCrossRef(i, 'ref_1')
i = self.skipBlockSize(i)
i = node.ReadCrossRef(i, 'target')
i = node.ReadList3(i, importerSegNode._TYP_NODE_REF_, 'mapping')
i = node.ReadFloat64(i, 'f')
i = node.ReadCrossRef(i, 'paramRef')
i = node.ReadUInt16(i, 'u16_0')
i = node.ReadUInt8(i, 'u8_0')
return i
def Read_90874D48(self, node): # BodySet
i = self.ReadHeaderContent(node, 'BodySet')