forked from oddtopus/dodo
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCPipe.py
More file actions
880 lines (675 loc) · 23.8 KB
/
CPipe.py
File metadata and controls
880 lines (675 loc) · 23.8 KB
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
# SPDX-License-Identifier: LGPL-3.0-or-later
__title__ = "pypeTools toolbar"
__author__ = "oddtopus"
__url__ = "github.com/oddtopus/dodo"
__license__ = "LGPL 3"
# import FreeCAD modules
import FreeCAD
import FreeCADGui
import Quetzal_tooltips
from quetzal_config import addCommand
QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP
# translate = FreeCAD.Qt.translate
def updatesPL(dialogqm):
if FreeCAD.activeDocument():
pypelines = [
o.Label
for o in FreeCAD.activeDocument().Objects
if hasattr(o, "PType") and o.PType == "PypeLine"
]
else:
pypelines = []
if pypelines: # updates pypelines in combo
dialogqm.QM.comboPL.clear()
dialogqm.QM.comboPL.addItems(pypelines)
# ---------------------------------------------------------------------------
# The command classes
# ---------------------------------------------------------------------------
class insertPipe:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import pForms
pipForm = pForms.insertPipeForm()
def GetResources(self):
return {
"Pixmap": "Quetzal_InsertPipe",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_InsertPipe", "Insert a tube"),
"ToolTip": QT_TRANSLATE_NOOP("Quetzal_InsertPipe", Quetzal_tooltips.insert_tube_tooltip),
}
class insertElbow:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import pForms
elbForm = pForms.insertElbowForm()
def GetResources(self):
return {
"Pixmap": "Quetzal_InsertElbow",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_InsertElbow", "Insert a elbow"),
"ToolTip": QT_TRANSLATE_NOOP("Quetzal_InsertElbow", Quetzal_tooltips.elbow_tooltip),
}
class insertTerminalAdapter:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
# import pCmd
# pCmd.makeTerminalAdapter()
import pForms
TerminalA=pForms.insertTerminalAdapterForm()
TerminalA.show()
# FreeCAD.activeDocument().recompute()
def GetResources(self):
return {
"Pixmap": "Quetzal_TerminalAdapter",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_InsertTerminalAdapter", "Insert Terminal adapter"),
"ToolTip": QT_TRANSLATE_NOOP("Quetzal_InsertTerminalAdapter", "Insert Terminal adapter"),
}
class insertReduct:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import pForms
pipeFormObj = pForms.insertReductForm()
def GetResources(self):
return {
"Pixmap": "Quetzal_InsertReduct",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_InsertReduct", "Insert a reduction"),
"ToolTip": QT_TRANSLATE_NOOP("Quetzal_InsertReduct", "Insert a reduction"),
}
class insertCap:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import pForms
pipeFormObj = pForms.insertCapForm()
def GetResources(self):
return {
"Pixmap": "Quetzal_InsertCap",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_InsertCap", "Insert a cap"),
"ToolTip": QT_TRANSLATE_NOOP("Quetzal_InsertCap", "Insert a cap"),
}
class insertTee:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import pForms
pipeFormObj = pForms.insertTeeForm()
def GetResources(self):
return {
"Pixmap": "Quetzal_InsertTee",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_InsertTee", "Insert a tee"),
"ToolTip": QT_TRANSLATE_NOOP("Quetzal_InsertTee", "Insert a tee"),
}
class insertGasket:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import pForms
pipeFormObj = pForms.insertGasketForm()
def GetResources(self):
return {
"Pixmap": "Quetzal_InsertGasket",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_InsertGasket", "Insert a gasket"),
"ToolTip": QT_TRANSLATE_NOOP("Quetzal_InsertGasket", "Insert a gasket"),
}
class insertFlange:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import pForms
pipeFormObj = pForms.insertFlangeForm()
def GetResources(self):
return {
"Pixmap": "Quetzal_InsertFlange",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_InsertFlange", "Insert a flange"),
"ToolTip": QT_TRANSLATE_NOOP("Quetzal_InsertFlange", "Insert a flange"),
}
class insertUbolt:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import pForms
pipeFormObj = pForms.insertUboltForm()
def GetResources(self):
return {
"Pixmap": "Quetzal_InsertUBolt",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_InsertUbolt", "Insert a U-bolt"),
"ToolTip": QT_TRANSLATE_NOOP("Quetzal_InsertUbolt", "Insert a U-bolt"),
}
class insertPypeLine:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import pForms
pipeFormObj = pForms.insertPypeLineForm()
def GetResources(self):
return {
"Pixmap": "Quetzal_InsertPypeLine",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_InsertPypeLine", "PypeLine Manager"),
"ToolTip": QT_TRANSLATE_NOOP("Quetzal_InsertPypeLine", "Open PypeLine Manager"),
}
class insertBranch:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import pForms
# pCmd.makeBranch()
pipeFormObj = pForms.insertBranchForm()
def GetResources(self):
return {
"Pixmap": "Quetzal_InsertBranch",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_InsertBranch", "Insert a branch"),
"ToolTip": QT_TRANSLATE_NOOP("Quetzal_InsertBranch", "Insert a PypeBranch"),
}
class _InsertCouplingUnionCmd:
"""FreeCAD Gui command — opens the coupling/union insertion dialog."""
def GetResources(self):
# Re-use the generic fitting icon; replace with a dedicated one if available.
from quetzal_config import ICONPATH
return {
"Pixmap": "Quetzal_CouplingUnion.svg",
"MenuText": QT_TRANSLATE_NOOP("Quetzal", "Insert Coupling / Union"),
"ToolTip": QT_TRANSLATE_NOOP(
"Quetzal",
"Insert a socket-weld or threaded coupling or union fitting"),
"Accel": "",
}
def IsActive(self):
return FreeCAD.activeDocument() is not None
def Activated(self):
import pForms
pForms.insertCouplingUnionForm()
class breakPipe:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import pForms
pipeFormObj = pForms.breakForm()
def GetResources(self):
return {
"Pixmap": "Quetzal_BreakPipe",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_BreakPipe", "Break the pipe"),
"ToolTip": QT_TRANSLATE_NOOP(
"Quetzal_BreakPipe", "Break one pipe at point and insert gap"
),
}
class mateEdges:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import pCmd
result=pCmd.translate("Transaction", "Mate")
FreeCAD.activeDocument().openTransaction(result)
pCmd.alignTheTube()
FreeCAD.activeDocument().commitTransaction()
FreeCAD.activeDocument().recompute()
def GetResources(self):
return {
"Accel": "M,E",
"Pixmap": "Quetzal_MateEdges",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_MateEdges", "Mate pipes edges"),
"ToolTip": QT_TRANSLATE_NOOP(
"Quetzal_MateEdges", "Mate two terminations through their edges"
),
}
class flat:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import pCmd
pCmd.flatten()
def GetResources(self):
return {
"Pixmap": "Quetzal_Flat",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_Flat", "Fit one elbow"),
"ToolTip": QT_TRANSLATE_NOOP(
"Quetzal_Flat", "Place a existing elbow between two pipes adjusting lenght pipes"
),
}
class extend2intersection:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import pCmd
result=pCmd.translate("Transaction", "Extend pipes to intersection")
FreeCAD.activeDocument().openTransaction(result)
pCmd.extendTheTubes2intersection()
FreeCAD.activeDocument().recompute()
FreeCAD.activeDocument().commitTransaction()
def GetResources(self):
return {
"Pixmap": "Quetzal_ExtendIntersection2",
"MenuText": QT_TRANSLATE_NOOP(
"Quetzal_ExtendIntersection2", "Extend pipes to intersection"
),
"ToolTip": QT_TRANSLATE_NOOP(
"Quetzal_ExtendIntersection2", "Extends pipes to intersection"
),
}
class extend1intersection:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import pCmd
result=pCmd.translate("Transaction", "Extend pipe to intersection")
FreeCAD.activeDocument().openTransaction(result)
pCmd.extendTheTubes2intersection(both=False)
FreeCAD.activeDocument().recompute()
FreeCAD.activeDocument().commitTransaction()
def GetResources(self):
return {
"Pixmap": "Quetzal_ExtendIntersection1",
"MenuText": QT_TRANSLATE_NOOP(
"Quetzal_ExtendIntersection1", "Extend pipe to intersection"
),
"ToolTip": QT_TRANSLATE_NOOP(
"Quetzal_ExtendIntersection1", "Extends pipe to intersection"
),
}
class laydown:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import pCmd
import fCmd
from Part import Plane
refFace = [f for f in fCmd.faces() if isinstance(f.Surface, Plane)][0]
result=pCmd.translate("Transaction", "Lay-down the pipe")
FreeCAD.activeDocument().openTransaction(result)
for b in fCmd.beams():
if pCmd.isPipe(b):
pCmd.laydownTheTube(b, refFace)
FreeCAD.activeDocument().recompute()
FreeCAD.activeDocument().commitTransaction()
def GetResources(self):
return {
"Pixmap": "Quetzal_Laydown",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_Laydown", "Lay-down the pipe"),
"ToolTip": QT_TRANSLATE_NOOP(
"Quetzal_Laydown", "Lay-down the pipe on the support plane"
),
}
class raiseup:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import pCmd
import fCmd
from Part import Plane
selex = FreeCADGui.Selection.getSelectionEx()
for sx in selex:
sxFaces = [f for f in fCmd.faces([sx]) if isinstance(f.Surface, Plane)]
if len(sxFaces) > 0:
refFace = sxFaces[0]
support = sx.Object
result=pCmd.translate("Transaction", "Raise-up the support")
FreeCAD.activeDocument().openTransaction(result)
for b in fCmd.beams():
if pCmd.isPipe(b):
pCmd.laydownTheTube(b, refFace, support)
break
FreeCAD.activeDocument().recompute()
FreeCAD.activeDocument().commitTransaction()
def GetResources(self):
return {
"Pixmap": "Quetzal_Raiseup",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_Raiseup", "Raise-up the support"),
"ToolTip": QT_TRANSLATE_NOOP("Quetzal_Raiseup", "Raise the support to the pipe"),
}
class joinPype:
""" """
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import FreeCADGui
import pForms # pObservers
# s=pObservers.joinObserver()
FreeCADGui.Control.showDialog(pForms.joinForm()) # .Selection.addObserver(s)
def GetResources(self):
return {
"Pixmap": "Quetzal_JoinPype",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_JoinPype", "Join pipes"),
"ToolTip": QT_TRANSLATE_NOOP("Quetzal_JoinPype", "Select the part-pype and the port"),
}
class insertValve:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import pForms
# pipeFormObj=pForms.insertValveForm()
# FreeCADGui.Control.showDialog(pForms.insertValveForm())
pipeFormObj = pForms.insertValveForm()
def GetResources(self):
return {
"Pixmap": "Quetzal_InsertValve",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_InsertValve", "Insert a valve"),
"ToolTip": QT_TRANSLATE_NOOP("Quetzal_InsertValve", "Insert a valve"),
}
class attach2tube:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import pCmd
result=pCmd.translate("Transaction", "Attach to tube")
FreeCAD.activeDocument().openTransaction(result)
pCmd.attachToTube()
FreeCAD.activeDocument().recompute()
FreeCAD.activeDocument().commitTransaction()
def GetResources(self):
return {
"Pixmap": "Quetzal_Attach2Tube",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_Attach2Tube", "Attach to tube"),
"ToolTip": QT_TRANSLATE_NOOP(
"Quetzal_Attach2Tube", "Attach one pype to the nearest port of selected pipe"
),
}
class point2point:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import pForms
form = pForms.point2pointPipe()
def GetResources(self):
return {
"Pixmap": "Quetzal_Point2Point",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_Point2Point", "Draw a tube point by point"),
"ToolTip": QT_TRANSLATE_NOOP(
"Quetzal_Point2Point", "A new body is created on each click on subsequent points"
),
}
class insertAnyz:
"""
Dialog to insert any object saved as .STEP, .IGES or .BREP in folder ../Mod/dodo/shapez or subfolders.
"""
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import anyShapez
FreeCADGui.Control.showDialog(anyShapez.shapezDialog())
def GetResources(self):
return {
"Pixmap": "Quetzal_InsertAnyShape",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_InsertAnyShape", "Insert any shape"),
"ToolTip": QT_TRANSLATE_NOOP("Quetzal_InsertAnyShape", "Insert a STEP, IGES or BREP"),
}
class insertTank:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import FreeCADGui
import pForms
FreeCADGui.Control.showDialog(pForms.insertTankForm())
def GetResources(self):
return {
"Pixmap": "Quetzal_InsertTank",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_InsertTank", "Insert a tank"),
"ToolTip": QT_TRANSLATE_NOOP("Quetzal_InsertTank", "Create tank and nozzles"),
}
class insertRoute:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import FreeCADGui
import pForms
FreeCADGui.Control.showDialog(pForms.insertRouteForm())
def GetResources(self):
return {
"Pixmap": "Quetzal_InsertRoute",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_InsertRoute", "Insert a pipe route"),
"ToolTip": QT_TRANSLATE_NOOP(
"Quetzal_InsertRoute", "Create a sketch attached to a circular edge"
),
}
class makeHeader:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import pCmd
result=pCmd.translate("Transaction", "Connect to header")
FreeCAD.activeDocument().openTransaction(result)
FreeCAD.activeDocument().recompute()
FreeCAD.activeDocument().commitTransaction()
pCmd.header()
def GetResources(self):
return {
"Pixmap": "Quetzal_MakeHeader",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_MakeHeader", "Connect to header"),
"ToolTip": QT_TRANSLATE_NOOP(
"Quetzal_MakeHeader",
"Connect branches to one header pipe\nBranches and header's axes must be ortho",
),
}
class insertBeam:
def IsActive(self):
return FreeCAD.ActiveDocument is not None
def Activated(self):
import pForms
pForms.insertBeamForm()
def GetResources(self):
return {
"Pixmap": "Quetzal_InsertSection",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_InsertBeam", "Insert beam section"),
"ToolTip": QT_TRANSLATE_NOOP("Quetzal_InsertBeam",
"Insert a structural beam section. Select a port, edge, vertex, "
"or nothing to place at origin."),
}
class insertOutlet:
"""FreeCAD command: open the Insert Outlet dialog."""
def Activated(self):
import pForms
outletForm = pForms.insertOutletForm()
def IsActive(self):
return FreeCAD.activeDocument() is not None
def GetResources(self):
return {
"Pixmap": "Quetzal_InsertOutlet",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_InsertOutlet",
"Insert outlet"),
"ToolTip": QT_TRANSLATE_NOOP("Quetzal_InsertOutlet",
"Insert a branch-connection outlet fitting "
"(Butt weld/socket weld|Straight/45 lateral)"),
}
addCommand("Quetzal_InsertOutlet", insertOutlet())
# ---------------------------------------------------------------------------
# Adds the commands to the FreeCAD command manager
# ---------------------------------------------------------------------------
addCommand("Quetzal_InsertPipe", insertPipe())
addCommand("Quetzal_InsertElbow", insertElbow())
addCommand("Quetzal_InsertReduct", insertReduct())
addCommand("Quetzal_InsertCap", insertCap())
addCommand("Quetzal_InsertTee", insertTee())
addCommand("Quetzal_InsertValve", insertValve())
addCommand("Quetzal_InsertFlange", insertFlange())
addCommand("Quetzal_InsertGasket", insertGasket())
addCommand("Quetzal_InsertCoupling", _InsertCouplingUnionCmd())
addCommand("Quetzal_InsertUBolt", insertUbolt())
addCommand("Quetzal_InsertPypeLine", insertPypeLine())
addCommand("Quetzal_InsertBranch", insertBranch())
addCommand("Quetzal_InsertTank", insertTank())
addCommand("Quetzal_InsertRoute", insertRoute())
addCommand("Quetzal_BreakPipe", breakPipe())
addCommand("Quetzal_MateEdges", mateEdges())
addCommand("Quetzal_JoinPype", joinPype())
addCommand("Quetzal_Attach2Tube", attach2tube())
addCommand("Quetzal_Flat", flat())
addCommand("Quetzal_ExtendIntersection2", extend2intersection())
addCommand("Quetzal_ExtendIntersection1", extend1intersection())
addCommand("Quetzal_Laydown", laydown())
addCommand("Quetzal_Raiseup", raiseup())
addCommand("Quetzal_Point2Point", point2point())
addCommand("Quetzal_InsertAnyShape", insertAnyz())
addCommand("Quetzal_MakeHeader", makeHeader())
addCommand("Quetzal_InsertTerminalAdapter", insertTerminalAdapter())
addCommand("Quetzal_InsertBeam", insertBeam())
### QkMenus ###
class pipeQM:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import dodoPM
# dodoPM.pqm.updatePL()
dodoPM.pqm.show()
def GetResources(self):
return {
"Pixmap": "Quetzal_InsertPipe",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_PipeQM", "QM for pipes"),
}
addCommand("Quetzal_PipeQM", pipeQM())
# Quick Menu section
class elbowQM:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import dodoPM
dodoPM.eqm.show()
def GetResources(self):
return {
"Pixmap": "Quetzal_InsertElbow",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_ElbowQM", "QM for elbows"),
}
addCommand("Quetzal_ElbowQM", elbowQM())
class flangeQM:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import dodoPM
dodoPM.fqm.show()
def GetResources(self):
return {
"Pixmap": "Quetzal_InsertFlange",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_FlangeQM", "QM for flanges"),
}
addCommand("Quetzal_FlangeQM", flangeQM())
class valveQM:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import dodoPM
dodoPM.vqm.show()
def GetResources(self):
return {
"Pixmap": "Quetzal_InsertValve",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_ValveQM", "QM for valves"),
}
addCommand("Quetzal_ValveQM", valveQM())
class capQM:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import dodoPM
dodoPM.cqm.show()
def GetResources(self):
return {
"Pixmap": "Quetzal_InsertCap",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_CapQM", "QM for caps"),
}
addCommand("Quetzal_CapQM", capQM())
class teeQM:
def IsActive(self):
if FreeCAD.ActiveDocument is None:
return False
else:
return True
def Activated(self):
import dodoPM
dodoPM.cqm.show()
def GetResources(self):
return {
"Pixmap": "Quetzal_InsertTee",
"MenuText": QT_TRANSLATE_NOOP("Quetzal_TeeQM", "QM for tees"),
}
addCommand("Quetzal_CapQM", capQM())