456 lines
22 KiB
HTML
456 lines
22 KiB
HTML
<html><head><title>Macro FCWire To Volume</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link type='text/css' href='wiki.css' rel='stylesheet'></head><body><h1>Macro FCWire To Volume</h1></div>
|
|
|
|
<div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr"><div class="mw-parser-output"><table class="fcinfobox wikitable ct" width="100%" style="float: right; width: 230px; margin-left: 10px;">
|
|
<tr>
|
|
<td class="ctTitle">
|
|
<h3><span class="mw-headline" id="Macro_FCWire_To_Volume"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Macro_FCWire_To_Volume.png" class="image"><img alt="Macro FCWire To Volume.png" src="32px-Macro_FCWire_To_Volume.png" width="32" height="32" srcset="/wiki/images/thumb/f/f2/Macro_FCWire_To_Volume.png/48px-Macro_FCWire_To_Volume.png 1.5x, /wiki/images/thumb/f/f2/Macro_FCWire_To_Volume.png/64px-Macro_FCWire_To_Volume.png 2x" /></a> Macro FCWire To Volume</span></h3>
|
|
</td></tr>
|
|
<tr>
|
|
<th class="ctOdd">Description
|
|
</th></tr>
|
|
<tr>
|
|
<td class="ctEven left macro-description">Create the boolean operation with the selected wires
|
|
</td></tr>
|
|
<tr>
|
|
<th class="ctOdd">Author
|
|
</th></tr>
|
|
<tr>
|
|
<td class="ctEven macro-author"><a href="https://www.freecadweb.org/wiki/index.php?title=User:Mario52" title="User:Mario52">Mario52</a>
|
|
</td></tr>
|
|
<tr>
|
|
<th class="ctOdd">Links
|
|
</th></tr>
|
|
<tr>
|
|
<td class="ctEven"><a href="Macros_recipes.html" title="Macros recipes">Macros recipes</a><br /><a href="How_to_install_macros.html" title="How to install macros">How to install macros</a><br /><a href="Customize_Toolbars.html" title="Customize Toolbars">How to customize toolbars</a>
|
|
</td></tr>
|
|
<tr>
|
|
<th class="ctOdd">Version
|
|
</th></tr>
|
|
<tr>
|
|
<td class="ctEven macro-version">1.0
|
|
</td></tr>
|
|
<tr>
|
|
<th class="ctOdd">Date last modification
|
|
</th></tr>
|
|
<tr>
|
|
<td class="ctEven macro-date">2016-10-10
|
|
</td></tr>
|
|
<tr>
|
|
<th class="ctOdd">
|
|
</th></tr>
|
|
<tr>
|
|
<td class="ctToc"><br /><div id="toc" class="toc"><div class="toctitle"><h2>Contents</h2></div>
|
|
<ul>
|
|
<li class="toclevel-1"><a href="#Macro_FCWire_To_Volume"><span class="tocnumber">1</span> <span class="toctext">Macro FCWire To Volume</span></a></li>
|
|
<li class="toclevel-1 tocsection-1"><a href="#Description"><span class="tocnumber">2</span> <span class="toctext">Description</span></a></li>
|
|
<li class="toclevel-1 tocsection-2"><a href="#Uses"><span class="tocnumber">3</span> <span class="toctext">Uses</span></a></li>
|
|
<li class="toclevel-1 tocsection-3"><a href="#Script"><span class="tocnumber">4</span> <span class="toctext">Script</span></a></li>
|
|
<li class="toclevel-1 tocsection-4"><a href="#Link"><span class="tocnumber">5</span> <span class="toctext">Link</span></a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
</td></tr>
|
|
</table><a href="https://www.freecadweb.org/wiki/index.php?title=File:Macro_FCWire_To_Volume_01.png" class="image"><img alt="Macro FCWire To Volume 01.png" src="400px-Macro_FCWire_To_Volume_01.png" width="400" height="300" srcset="/wiki/images/thumb/9/9b/Macro_FCWire_To_Volume_01.png/600px-Macro_FCWire_To_Volume_01.png 1.5x, /wiki/images/9/9b/Macro_FCWire_To_Volume_01.png 2x" /></a>
|
|
<div style="clear:both"></div>
|
|
<h2><span class="mw-headline" id="Description">Description</span></h2>
|
|
<p>This macro create on object boolean with the object Draft selected.
|
|
</p>
|
|
<h2><span class="mw-headline" id="Uses">Uses</span></h2>
|
|
<p>Select the wires objects, enter the thickness choice the operation desired and click the button <span style="background: #DDDDDD; border: 1px solid #888888; padding: 0px 5px 1px 5px;">Create</span>
|
|
</p>
|
|
<div class="floatleft"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Macro_FCWire_To_Volume_00.png" class="image"><img alt="Macro FCWire To Volume 00.png" src="Macro_FCWire_To_Volume_00.png" width="175" height="214" /></a></div>
|
|
<div style="clear:both"></div>
|
|
<ul><li><b>SpinBox</b> : Give the thickness</li>
|
|
<li><b>Single</b> : If the checkBox is checked the object is on single object, if not the object created conserve the hierarchy of the construction the object (Default). The originals objects hare not modified.</li>
|
|
<li><b>Common</b> , <b>Substract</b> , <b>Union</b> , <b>Difference</b> : Boolean's operations</li>
|
|
<li><b>X</b> , <b>Y</b> , <b>Z</b> : Extrude Axis (Z by Default)</li>
|
|
<li><span style="background: #DDDDDD; border: 1px solid #888888; padding: 0px 5px 1px 5px;">Quit</span> : Quit themacro</li>
|
|
<li><span style="background: #DDDDDD; border: 1px solid #888888; padding: 0px 5px 1px 5px;">Create</span> : Create the Boolean object</li></ul>
|
|
<h2><span class="mw-headline" id="Script">Script</span></h2>
|
|
<p>Copy the macro in your macro folder.
|
|
</p><p>The icon for the tool bar <a href="https://www.freecadweb.org/wiki/index.php?title=File:Macro_FCWire_To_Volume.png" class="image"><img alt="Macro FCWire To Volume.png" src="32px-Macro_FCWire_To_Volume.png" width="32" height="32" srcset="/wiki/images/thumb/f/f2/Macro_FCWire_To_Volume.png/48px-Macro_FCWire_To_Volume.png 1.5x, /wiki/images/thumb/f/f2/Macro_FCWire_To_Volume.png/64px-Macro_FCWire_To_Volume.png 2x" /></a>
|
|
</p><p>Macro_FCWire_To_Volume.FCMacro
|
|
</p>
|
|
<pre># -*- coding: utf-8 -*-
|
|
from __future__ import unicode_literals
|
|
#
|
|
"""
|
|
***************************************************************************
|
|
* Copyright (c) 2016 <mario52> *
|
|
* *
|
|
* This file is a supplement to the FreeCAD CAx development system. *
|
|
* *
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
* it under the terms of the GNU Lesser General Public License (LGPL) *
|
|
* as published by the Free Software Foundation; either version 2 of *
|
|
* the License, or (at your option) any later version. *
|
|
* for detail see the LICENCE text file. *
|
|
* *
|
|
* This software is distributed in the hope that it will be useful, *
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
* GNU Library General Public License for more details. *
|
|
* *
|
|
* You should have received a copy of the GNU Library General Public *
|
|
* License along with this macro; if not, write to the Free Software *
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
|
* USA *
|
|
***************************************************************************
|
|
* WARNING! All changes in this file will be lost and *
|
|
* may cause malfunction of the program *
|
|
***************************************************************************
|
|
"""
|
|
#Macro_FCWire_To_Volume 10/10/2016_01
|
|
#
|
|
#OS: Windows 10
|
|
#Word size of OS: 64-bit
|
|
#Word size of FreeCAD: 64-bit
|
|
#Version: 0.16.6706 (Git)
|
|
#Build type: Release
|
|
#Branch: releases/FreeCAD-0-16
|
|
#Hash: f86a4e411ff7848dea98d7242f43b7774bee8fa0
|
|
#Python version: 2.7.8
|
|
#Qt version: 4.8.7
|
|
#Coin version: 4.0.0a
|
|
#OCC version: 6.8.0.oce-0.17
|
|
#
|
|
__title__ = "Macro_FCWire_To_Volume"
|
|
__author__ = "Mario52"
|
|
__url__ = "http://www.freecadweb.org/index-fr.html"
|
|
__version__ = "00.01"
|
|
__date__ = "10/10/2016"
|
|
|
|
try:
|
|
import PyQt4
|
|
from PyQt4 import QtGui ,QtCore
|
|
from PyQt4.QtGui import *
|
|
from PyQt4.QtCore import *
|
|
except Exception:
|
|
import PySide
|
|
from PySide import QtGui ,QtCore
|
|
from PySide.QtGui import *
|
|
from PySide.QtCore import *
|
|
|
|
import Draft, Part, PartGui, FreeCADGui, FreeCAD
|
|
from FreeCAD import Base
|
|
import math
|
|
from math import sqrt, pi, sin, cos, asin
|
|
|
|
Gui = FreeCADGui
|
|
App = FreeCAD
|
|
|
|
try:
|
|
_fromUtf8 = QtCore.QString.fromUtf8
|
|
except AttributeError:
|
|
def _fromUtf8(s):
|
|
return s
|
|
|
|
try:
|
|
_encoding = QtGui.QApplication.UnicodeUTF8
|
|
def _translate(context, text, disambig):
|
|
return QtGui.QApplication.translate(context, text, disambig, _encoding)
|
|
except AttributeError:
|
|
def _translate(context, text, disambig):
|
|
return QtGui.QApplication.translate(context, text, disambig)
|
|
|
|
def errorDialog(msg):
|
|
diag = QtGui.QMessageBox(QtGui.QMessageBox.Critical,u"Error Message",msg )
|
|
# diag.setWindowModality(QtCore.Qt.ApplicationModal) # la fonction a ete desactivee pour favoriser "WindowStaysOnTopHint"
|
|
try:
|
|
diag.setWindowFlags(PyQt4.QtCore.Qt.WindowStaysOnTopHint) # PyQt4 # cette fonction met la fenetre en avant
|
|
except Exception:
|
|
diag.setWindowFlags(PySide.QtCore.Qt.WindowStaysOnTopHint) # PySide # cette fonction met la fenetre en avant
|
|
diag.exec_()
|
|
|
|
class Ui_MainWindow(object):
|
|
|
|
def __init__(self ):
|
|
self.window = MainWindow
|
|
#self.path = FreeCAD.ConfigGet("AppHomePath")
|
|
self.path = FreeCAD.ConfigGet("UserAppData")
|
|
self.path = self.path.replace("\\","/")
|
|
|
|
self.thicknessValue = 0.0
|
|
self.thicknessX = 0.0 # extrusion
|
|
self.thicknessY = 0.0 # extrusion
|
|
self.thicknessZ = 0.0 # extrusion
|
|
|
|
def setupUi(self, MainWindow):
|
|
self.window = MainWindow
|
|
MainWindow.setObjectName(_fromUtf8("MainWindow"))
|
|
MainWindow.resize(171, 180)
|
|
MainWindow.setMinimumSize(QtCore.QSize(171, 180))
|
|
MainWindow.setMaximumSize(QtCore.QSize(171, 180))
|
|
self.centralwidget = QtGui.QWidget(MainWindow)
|
|
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
|
|
|
|
self.fontGlobal_08 = QtGui.QFont() # pour compatibilite Windows Linux pour tous les textes
|
|
self.fontGlobal_08.setFamily("Arial") # pour compatibilite Windows Linux pour tous les textes
|
|
self.fontGlobal_08.setPointSize(8.0) # pour compatibilite Windows Linux pour tous les textes
|
|
|
|
self.label_01 = QtGui.QLabel(self.centralwidget)
|
|
self.label_01.setGeometry(QtCore.QRect(10, 0, 151, 16))
|
|
self.label_01.setFont(self.fontGlobal_08) # pour compatibilite W L
|
|
self.label_01.setObjectName(_fromUtf8("label_01"))
|
|
|
|
self.doubleSpinBox = QtGui.QDoubleSpinBox(self.centralwidget)
|
|
self.doubleSpinBox.setGeometry(QtCore.QRect(10, 20, 81, 22))
|
|
self.doubleSpinBox.setFont(self.fontGlobal_08) # pour compatibilite W L
|
|
self.doubleSpinBox.setObjectName(_fromUtf8("doubleSpinBox"))
|
|
self.doubleSpinBox.setMinimum(0)
|
|
self.doubleSpinBox.setMaximum(999999.999999)
|
|
self.doubleSpinBox.setDecimals(3)
|
|
self.doubleSpinBox.setValue(0.0)
|
|
self.doubleSpinBox.valueChanged.connect(self.on_doubleSpinBox) ###
|
|
|
|
self.checkBox_01 = QtGui.QCheckBox(self.centralwidget)
|
|
self.checkBox_01.setGeometry(QtCore.QRect(100, 23, 70, 17))
|
|
self.checkBox_01.setFont(self.fontGlobal_08) # pour compatibilite W L
|
|
self.checkBox_01.setObjectName(_fromUtf8("checkBox_01"))
|
|
self.checkBox_01.setChecked(False) # True
|
|
self.checkBox_01.setToolTip(_fromUtf8("Check this checkBox"+"\n"+
|
|
"for create single object"))
|
|
|
|
self.FrameOp = QtGui.QFrame(self.centralwidget)
|
|
self.FrameOp.setGeometry(QtCore.QRect(10, 50, 81, 80))
|
|
self.FrameOp.setFrameShape(QtGui.QFrame.StyledPanel)
|
|
self.FrameOp.setFrameShadow(QtGui.QFrame.Raised)
|
|
self.FrameOp.setObjectName(_fromUtf8("FrameOp"))
|
|
|
|
self.RB_Common = QtGui.QRadioButton(self.FrameOp)
|
|
self.RB_Common.setGeometry(QtCore.QRect(10, 0, 82, 17))
|
|
self.RB_Common.setFont(self.fontGlobal_08) # pour compatibilite W L
|
|
self.RB_Common.setChecked(True)
|
|
self.RB_Common.setObjectName(_fromUtf8("RB_Common"))
|
|
|
|
self.RB_Substract = QtGui.QRadioButton(self.FrameOp)
|
|
self.RB_Substract.setGeometry(QtCore.QRect(10, 20, 82, 17))
|
|
self.RB_Substract.setFont(self.fontGlobal_08) # pour compatibilite W L
|
|
self.RB_Substract.setObjectName(_fromUtf8("RB_Substract"))
|
|
|
|
self.RB_Union = QtGui.QRadioButton(self.FrameOp)
|
|
self.RB_Union.setGeometry(QtCore.QRect(10, 40, 82, 17))
|
|
self.RB_Union.setFont(self.fontGlobal_08) # pour compatibilite W L
|
|
self.RB_Union.setObjectName(_fromUtf8("RB_Union"))
|
|
|
|
self.RB_Difference = QtGui.QRadioButton(self.FrameOp)
|
|
self.RB_Difference.setGeometry(QtCore.QRect(10, 60, 82, 17))
|
|
self.RB_Difference.setFont(self.fontGlobal_08) # pour compatibilite W L
|
|
self.RB_Difference.setObjectName(_fromUtf8("RB_Difference"))
|
|
|
|
self.FrameAxis = QtGui.QFrame(self.centralwidget)
|
|
self.FrameAxis.setGeometry(QtCore.QRect(90, 50, 71, 80))
|
|
self.FrameAxis.setFrameShape(QtGui.QFrame.StyledPanel)
|
|
self.FrameAxis.setFrameShadow(QtGui.QFrame.Raised)
|
|
self.FrameAxis.setObjectName(_fromUtf8("FrameAxis"))
|
|
|
|
self.RB_Axis_X = QtGui.QRadioButton(self.FrameAxis)
|
|
self.RB_Axis_X.setGeometry(QtCore.QRect(10, 0, 71, 17))
|
|
self.RB_Axis_X.setFont(self.fontGlobal_08) # pour compatibilite W L
|
|
self.RB_Axis_X.setObjectName(_fromUtf8("RB_Axis_X"))
|
|
self.RB_Axis_X.setToolTip(_fromUtf8("Plane YZ extrude direction X"))
|
|
|
|
self.RB_Axis_Y = QtGui.QRadioButton(self.FrameAxis)
|
|
self.RB_Axis_Y.setGeometry(QtCore.QRect(10, 30, 71, 17))
|
|
self.RB_Axis_Y.setFont(self.fontGlobal_08) # pour compatibilite W L
|
|
self.RB_Axis_Y.setObjectName(_fromUtf8("RB_Axis_Y"))
|
|
self.RB_Axis_Y.setToolTip(_fromUtf8("Plane XZ extrude direction Y"))
|
|
|
|
self.RB_Axis_Z = QtGui.QRadioButton(self.FrameAxis)
|
|
self.RB_Axis_Z.setGeometry(QtCore.QRect(10, 60, 71, 17))
|
|
self.RB_Axis_Z.setFont(self.fontGlobal_08) # pour compatibilite W L
|
|
self.RB_Axis_Z.setObjectName(_fromUtf8("RB_Axis_Z"))
|
|
self.RB_Axis_Z.setChecked(True)
|
|
self.RB_Axis_Z.setToolTip(_fromUtf8("Plane XY extrude direction Z"))
|
|
|
|
self.PB_Quit = QtGui.QPushButton(self.centralwidget)
|
|
self.PB_Quit.setGeometry(QtCore.QRect(10, 140, 73, 23))
|
|
self.PB_Quit.setFont(self.fontGlobal_08) # pour compatibilite W L
|
|
self.PB_Quit.setObjectName(_fromUtf8("PB_Quit"))
|
|
self.PB_Quit.clicked.connect(self.on_PB_Quit) ###
|
|
|
|
self.PB_Create = QtGui.QPushButton(self.centralwidget)
|
|
self.PB_Create.setGeometry(QtCore.QRect(90, 140, 73, 23))
|
|
self.PB_Create.setFont(self.fontGlobal_08) # pour compatibilite W L
|
|
self.PB_Create.setObjectName(_fromUtf8("PB_Create"))
|
|
self.PB_Create.clicked.connect(self.on_PB_Create) ###
|
|
|
|
MainWindow.setCentralWidget(self.centralwidget)
|
|
self.retranslateUi(MainWindow)
|
|
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
|
|
|
def retranslateUi(self, MainWindow):
|
|
MainWindow.setWindowTitle("FCWire To Volume")
|
|
self.label_01.setText("FCWire To Volume")
|
|
self.checkBox_01.setText("Single")
|
|
self.RB_Common.setText("Common")
|
|
self.RB_Substract.setText("Substract")
|
|
self.RB_Union.setText("Union")
|
|
self.RB_Difference.setText("Difference")
|
|
self.RB_Axis_X.setText( "X Axis")
|
|
self.RB_Axis_Y.setText("Y Axis")
|
|
self.RB_Axis_Z.setText("Z Axis")
|
|
self.PB_Quit.setText("Quit")
|
|
self.PB_Create.setText("Create")
|
|
|
|
try:
|
|
MainWindow.setWindowFlags(PyQt4.QtCore.Qt.WindowStaysOnTopHint) # PyQt4 cette fonction met la fenetre en avant
|
|
except Exception:
|
|
MainWindow.setWindowFlags(PySide.QtCore.Qt.WindowStaysOnTopHint) # PySide cette fonction met la fenetre en avant
|
|
|
|
def on_doubleSpinBox(self,value):
|
|
self.thicknessValue = value
|
|
|
|
def on_PB_Quit(self): # Quit
|
|
App.Console.PrintMessage(str("Fin FCWire To Volume ")+"\n")
|
|
self.window.hide()
|
|
|
|
def on_PB_Create(self):
|
|
selectionObjects = FreeCADGui.Selection.getSelection()
|
|
noface = 0
|
|
try:
|
|
selectedEdge = FreeCADGui.Selection.getSelectionEx()[0].SubObjects[0] # select one element SubObjects
|
|
if str(selectedEdge)[1:5] == "Face":
|
|
noface = 1
|
|
except Exception:
|
|
None
|
|
|
|
selectionDuplicate = []
|
|
del selectionDuplicate[:]
|
|
p = []
|
|
del p[:]
|
|
|
|
try:
|
|
###########
|
|
self.thicknessX = 0.0
|
|
self.thicknessY = 0.0
|
|
self.thicknessZ = 0.0
|
|
|
|
if self.RB_Axis_X.isChecked():
|
|
self.thicknessX = self.thicknessValue
|
|
if self.RB_Axis_Y.isChecked():
|
|
self.thicknessY = self.thicknessValue
|
|
if self.RB_Axis_Z.isChecked():
|
|
self.thicknessZ = self.thicknessValue
|
|
###########
|
|
|
|
if (len(selectionObjects) >= 2) and (noface == 0) and (self.thicknessX + self.thicknessY + self.thicknessZ != 0.0):
|
|
for i in selectionObjects: # duplicate object
|
|
Part.show(i.Shape.copy())
|
|
sD = doc.ActiveObject
|
|
sD.Label = i.Name
|
|
selectionDuplicate.append(sD)
|
|
|
|
for i in (selectionDuplicate): # extrude object
|
|
a = Draft.extrude(i,Base.Vector(self.thicknessX,self.thicknessY,self.thicknessZ)) # axis extrude X Y Z
|
|
a.Solid = True
|
|
p.append(a)
|
|
|
|
if self.RB_Common.isChecked():
|
|
name = "Common_" + selectionDuplicate[0].Label ## create Common_
|
|
tx = doc.addObject("Part::MultiCommon",name)
|
|
tx.Shapes = p
|
|
doc.recompute()
|
|
if self.checkBox_01.isChecked():
|
|
Part.show(tx.Shape)
|
|
singleO = App.ActiveDocument.ActiveObject
|
|
singleO.Label = name
|
|
doc.removeObject(tx.Name)
|
|
for i in range(len(selectionDuplicate)):
|
|
doc.removeObject(selectionDuplicate[i].Name)
|
|
doc.removeObject(p[i].Name)
|
|
App.Console.PrintMessage("RB_Common ")
|
|
|
|
elif self.RB_Substract.isChecked():
|
|
name = str("Cut_" + selectionDuplicate[0].Label) ## create Cut_
|
|
tx = doc.addObject("Part::Cut",name)
|
|
tx.Base = p[0]
|
|
tx.Tool = p[1]
|
|
doc.recompute()
|
|
if self.checkBox_01.isChecked():
|
|
Part.show(tx.Shape)
|
|
singleO = App.ActiveDocument.ActiveObject
|
|
singleO.Label = name
|
|
doc.removeObject(tx.Name)
|
|
for i in range(len(selectionDuplicate)):
|
|
doc.removeObject(selectionDuplicate[i].Name)
|
|
doc.removeObject(p[i].Name)
|
|
App.Console.PrintMessage("RB_Substract ")
|
|
|
|
elif self.RB_Union.isChecked():
|
|
name = str("Fusion_" + selectionDuplicate[0].Label) ## create Fusion_
|
|
tx = doc.addObject("Part::MultiFuse",name)
|
|
tx.Shapes = p
|
|
doc.recompute()
|
|
if self.checkBox_01.isChecked():
|
|
Part.show(tx.Shape)
|
|
singleO = App.ActiveDocument.ActiveObject
|
|
singleO.Label = name
|
|
doc.removeObject(tx.Name)
|
|
for i in range(len(selectionDuplicate)):
|
|
doc.removeObject(selectionDuplicate[i].Name)
|
|
doc.removeObject(p[i].Name)
|
|
App.Console.PrintMessage("RB_Union")
|
|
|
|
elif self.RB_Difference.isChecked():
|
|
name = "CommonD_" + selectionDuplicate[0].Label ##
|
|
commun = doc.addObject("Part::MultiCommon",name)
|
|
commun.Shapes = p
|
|
name = str("FusionD_" + selectionDuplicate[0].Label) ##
|
|
fusion = doc.addObject("Part::MultiFuse",name)
|
|
fusion.Shapes = p
|
|
name = str("Difference_" + selectionDuplicate[0].Label)## create Difference_
|
|
difference = doc.addObject("Part::Cut",name)
|
|
difference.Base = fusion
|
|
difference.Tool = commun
|
|
doc.recompute()
|
|
if self.checkBox_01.isChecked():
|
|
Part.show(difference.Shape)
|
|
singleO = App.ActiveDocument.ActiveObject
|
|
singleO.Label = name
|
|
doc.removeObject(commun.Name)
|
|
doc.removeObject(fusion.Name)
|
|
doc.removeObject(difference.Name)
|
|
for i in range(len(selectionDuplicate)):
|
|
doc.removeObject(selectionDuplicate[i].Name)
|
|
doc.removeObject(p[i].Name)
|
|
App.Console.PrintMessage("RB_Difference ")
|
|
|
|
doc.recompute()
|
|
App.Console.PrintMessage(str(self.thicknessX)+" "+str(self.thicknessY)+" "+str(self.thicknessZ) + "\n")
|
|
else:
|
|
if (self.thicknessX + self.thicknessY + self.thicknessZ == 0.0):
|
|
App.Console.PrintError("Thickness = 0" + "\n")
|
|
else:
|
|
App.Console.PrintError("Not for Face" + "\n")
|
|
except Exception:
|
|
print "Wrong selection or operation"
|
|
|
|
#______________________________________________________________________________________
|
|
|
|
doc = FreeCAD.ActiveDocument
|
|
if doc == None:
|
|
doc = FreeCAD.newDocument()
|
|
|
|
MainWindow = QtGui.QMainWindow()
|
|
ui = Ui_MainWindow()
|
|
ui.setupUi(MainWindow)
|
|
MainWindow.show() </pre>
|
|
<h2><span class="mw-headline" id="Link">Link</span></h2>
|
|
<p>The tread in the forum <a rel="nofollow" class="external text" href="http://forum.freecadweb.org/viewtopic.php?f=3&t=16570&start=50">Bunch of issues/questions</a>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div><div class="printfooter">
|
|
Online version: "<a dir="ltr" href="https://www.freecadweb.org/wiki/index.php?title=Macro_FCWire_To_Volume&oldid=240107">http://www.freecadweb.org/wiki/index.php?title=Macro_FCWire_To_Volume&oldid=240107</a>"</div>
|
|
<div id="catlinks" class="catlinks" data-mw="interface"></div><div class="visualClear"></div>
|
|
</div>
|
|
</div>
|
|
<div id="mw-navigation">
|
|
<h2>Navigation menu</h2>
|
|
|
|
</body></html> |