本文整理汇总了Python中PathScripts.PathPreferences.PathPreferences类的典型用法代码示例。如果您正苦于以下问题:Python PathPreferences类的具体用法?Python PathPreferences怎么用?Python PathPreferences使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PathPreferences类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: loadSettings
def loadSettings(self):
self.form.leDefaultFilePath.setText(PathPreferences.defaultFilePath())
self.form.leDefaultJobTemplate.setText(PathPreferences.defaultJobTemplate())
blacklist = PathPreferences.postProcessorBlacklist()
for processor in PathPreferences.allAvailablePostProcessors():
item = QtGui.QListWidgetItem(processor)
if processor in blacklist:
item.setCheckState(QtCore.Qt.CheckState.Unchecked)
else:
item.setCheckState(QtCore.Qt.CheckState.Checked)
item.setFlags( QtCore.Qt.ItemFlag.ItemIsSelectable | QtCore.Qt.ItemFlag.ItemIsEnabled | QtCore.Qt.ItemFlag.ItemIsUserCheckable)
self.form.postProcessorList.addItem(item)
self.verifyAndUpdateDefaultPostProcessorWith(PathPreferences.defaultPostProcessor())
self.form.defaultPostProcessorArgs.setText(PathPreferences.defaultPostProcessorArgs())
geomTol = Units.Quantity(PathPreferences.defaultGeometryTolerance(), Units.Length)
self.form.geometryTolerance.setText(geomTol.UserString)
self.form.curveAccuracy.setText(Units.Quantity(PathPreferences.defaultLibAreaCurveAccuracy(), Units.Length).UserString)
self.form.leOutputFile.setText(PathPreferences.defaultOutputFile())
self.selectComboEntry(self.form.cboOutputPolicy, PathPreferences.defaultOutputPolicy())
self.form.tbDefaultFilePath.clicked.connect(self.browseDefaultFilePath)
self.form.tbDefaultJobTemplate.clicked.connect(self.browseDefaultJobTemplate)
self.form.postProcessorList.itemEntered.connect(self.setProcessorListTooltip)
self.form.postProcessorList.itemChanged.connect(self.verifyAndUpdateDefaultPostProcessor)
self.form.defaultPostProcessor.currentIndexChanged.connect(self.updateDefaultPostProcessorToolTip)
self.form.tbOutputFile.clicked.connect(self.browseOutputFile)
self.loadStockSettings()
示例2: __init__
def __init__(self, obj):
# obj.addProperty("App::PropertyFile", "PostProcessor", "CodeOutput", "Select the Post Processor file for this project")
obj.addProperty("App::PropertyFile", "OutputFile", "CodeOutput", QtCore.QT_TRANSLATE_NOOP("App::Property","The NC output file for this project"))
obj.OutputFile = PathPreferences.defaultOutputFile()
obj.setEditorMode("OutputFile", 0) # set to default mode
obj.addProperty("App::PropertyString", "Description", "Path", QtCore.QT_TRANSLATE_NOOP("App::Property","An optional description for this job"))
obj.addProperty("App::PropertyEnumeration", "PostProcessor", "Output", QtCore.QT_TRANSLATE_NOOP("App::Property","Select the Post Processor"))
obj.PostProcessor = PathPreferences.allEnabledPostProcessors([''])
obj.PostProcessor = PathPreferences.defaultPostProcessor()
obj.addProperty("App::PropertyString", "PostProcessorArgs", "Output", QtCore.QT_TRANSLATE_NOOP("App::Property", "Arguments for the Post Processor (specific to the script)"))
obj.PostProcessorArgs = PathPreferences.defaultPostProcessorArgs()
obj.addProperty("App::PropertyString", "MachineName", "Output", QtCore.QT_TRANSLATE_NOOP("App::Property","Name of the Machine that will use the CNC program"))
obj.addProperty("Path::PropertyTooltable", "Tooltable", "Base", QtCore.QT_TRANSLATE_NOOP("App::Property","The tooltable used for this CNC program"))
obj.addProperty("App::PropertyEnumeration", "MachineUnits", "Output", QtCore.QT_TRANSLATE_NOOP("App::Property","Units that the machine works in, ie Metric or Inch"))
obj.MachineUnits = ['Metric', 'Inch']
obj.addProperty("App::PropertyDistance", "X_Max", "Limits", QtCore.QT_TRANSLATE_NOOP("App::Property","The Maximum distance in X the machine can travel"))
obj.addProperty("App::PropertyDistance", "Y_Max", "Limits", QtCore.QT_TRANSLATE_NOOP("App::Property","The Maximum distance in X the machine can travel"))
obj.addProperty("App::PropertyDistance", "Z_Max", "Limits", QtCore.QT_TRANSLATE_NOOP("App::Property","The Maximum distance in X the machine can travel"))
obj.addProperty("App::PropertyDistance", "X_Min", "Limits", QtCore.QT_TRANSLATE_NOOP("App::Property","The Minimum distance in X the machine can travel"))
obj.addProperty("App::PropertyDistance", "Y_Min", "Limits", QtCore.QT_TRANSLATE_NOOP("App::Property","The Minimum distance in X the machine can travel"))
obj.addProperty("App::PropertyDistance", "Z_Min", "Limits", QtCore.QT_TRANSLATE_NOOP("App::Property","The Minimum distance in X the machine can travel"))
obj.addProperty("App::PropertyLink", "Base", "Base", "The base object for all operations")
obj.Proxy = self
if FreeCAD.GuiUp:
ViewProviderJob(obj.ViewObject)
示例3: saveStockSettings
def saveStockSettings(self):
if self.form.stockGroup.isChecked():
attrs = {}
attrs['version'] = 1
typ = [PathStock.StockType.CreateBox, PathStock.StockType.CreateCylinder, PathStock.StockType.FromBase][self.form.stock.currentIndex()]
attrs['create'] = typ
if typ == PathStock.StockType.CreateBox:
attrs['length'] = FreeCAD.Units.Quantity(self.form.stockBoxLength.text()).UserString
attrs['width'] = FreeCAD.Units.Quantity(self.form.stockBoxWidth.text()).UserString
attrs['height'] = FreeCAD.Units.Quantity(self.form.stockBoxHeight.text()).UserString
if typ == PathStock.StockType.CreateCylinder:
attrs['radius'] = FreeCAD.Units.Quantity(self.form.stockCylinderRadius.text()).UserString
attrs['height'] = FreeCAD.Units.Quantity(self.form.stockCylinderHeight.text()).UserString
if typ == PathStock.StockType.FromBase:
attrs['xneg'] = FreeCAD.Units.Quantity(self.form.stockExtXneg.text()).UserString
attrs['xpos'] = FreeCAD.Units.Quantity(self.form.stockExtXpos.text()).UserString
attrs['yneg'] = FreeCAD.Units.Quantity(self.form.stockExtYneg.text()).UserString
attrs['ypos'] = FreeCAD.Units.Quantity(self.form.stockExtYpos.text()).UserString
attrs['zneg'] = FreeCAD.Units.Quantity(self.form.stockExtZneg.text()).UserString
attrs['zpos'] = FreeCAD.Units.Quantity(self.form.stockExtZpos.text()).UserString
if self.form.stockPlacementGroup.isChecked():
angle = FreeCAD.Units.Quantity(self.form.stockAngle.text()).Value
axis = FreeCAD.Vector(self.form.stockAxisX.value(), self.form.stockAxisY.value(), self.form.stockAxisZ.value())
rot = FreeCAD.Rotation(axis, angle)
attrs['rotX'] = rot.Q[0]
attrs['rotY'] = rot.Q[1]
attrs['rotZ'] = rot.Q[2]
attrs['rotW'] = rot.Q[3]
attrs['posX'] = FreeCAD.Units.Quantity(self.form.stockPositionX.text()).Value
attrs['posY'] = FreeCAD.Units.Quantity(self.form.stockPositionY.text()).Value
attrs['posZ'] = FreeCAD.Units.Quantity(self.form.stockPositionZ.text()).Value
PathPreferences.setDefaultStockTemplate(json.dumps(attrs))
else:
PathPreferences.setDefaultStockTemplate('')
示例4: resolveFileName
def resolveFileName(self, job):
path = PathPreferences.defaultOutputFile()
if job.PostProcessorOutputFile:
path = job.PostProcessorOutputFile
filename = path
if '%D' in filename:
D = FreeCAD.ActiveDocument.FileName
if D:
D = os.path.dirname(D)
# in case the document is in the current working directory
if not D:
D = '.'
else:
FreeCAD.Console.PrintError("Please save document in order to resolve output path!\n")
return None
filename = filename.replace('%D', D)
if '%d' in filename:
d = FreeCAD.ActiveDocument.Label
filename = filename.replace('%d', d)
if '%j' in filename:
j = job.Label
filename = filename.replace('%j', j)
if '%M' in filename:
pref = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Macro")
M = pref.GetString("MacroPath", FreeCAD.getUserAppDataDir())
filename = filename.replace('%M', M)
policy = PathPreferences.defaultOutputPolicy()
openDialog = policy == 'Open File Dialog'
if os.path.isdir(filename) or not os.path.isdir(os.path.dirname(filename)):
# Either the entire filename resolves into a directory or the parent directory doesn't exist.
# Either way I don't know what to do - ask for help
openDialog = True
if os.path.isfile(filename) and not openDialog:
if policy == 'Open File Dialog on conflict':
openDialog = True
elif policy == 'Append Unique ID on conflict':
fn, ext = os.path.splitext(filename)
nr = fn[-3:]
n = 1
if nr.isdigit():
n = int(nr)
while os.path.isfile("%s%03d%s" % (fn, n, ext)):
n = n + 1
filename = "%s%03d%s" % (fn, n, ext)
if openDialog:
foo = QtGui.QFileDialog.getSaveFileName(QtGui.QApplication.activeWindow(), "Output File", filename)
if foo:
filename = foo[0]
else:
filename = None
return filename
示例5: resolveFileName
def resolveFileName(self, job):
# print("resolveFileName(%s)" % job.Label)
path = PathPreferences.defaultOutputFile()
if job.OutputFile:
path = job.OutputFile
filename = path
if "%D" in filename:
D = FreeCAD.ActiveDocument.FileName
if D:
D = os.path.dirname(D)
else:
FreeCAD.Console.PrintError("Please save document in order to resolve output path!\n")
return None
filename = filename.replace("%D", D)
if "%d" in filename:
d = FreeCAD.ActiveDocument.Label
filename = filename.replace("%d", d)
if "%j" in filename:
j = job.Label
filename = filename.replace("%j", j)
if "%M" in filename:
pref = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Macro")
M = pref.GetString("MacroPath", FreeCAD.getUserAppDataDir())
filename = filename.replace("%M", M)
policy = PathPreferences.defaultOutputPolicy()
openDialog = policy == "Open File Dialog"
if os.path.isdir(filename) or not os.path.isdir(os.path.dirname(filename)):
# Either the entire filename resolves into a directory or the parent directory doesn't exist.
# Either way I don't know what to do - ask for help
openDialog = True
if os.path.isfile(filename) and not openDialog:
if policy == "Open File Dialog on conflict":
openDialog = True
elif policy == "Append Unique ID on conflict":
fn, ext = os.path.splitext(filename)
nr = fn[-3:]
n = 1
if nr.isdigit():
n = int(nr)
while os.path.isfile("%s%03d%s" % (fn, n, ext)):
n = n + 1
filename = "%s%03d%s" % (fn, n, ext)
if openDialog:
foo = QtGui.QFileDialog.getSaveFileName(QtGui.qApp.activeWindow(), "Output File", filename)
if foo:
filename = foo[0]
else:
filename = None
# print("resolveFileName(%s, %s) -> '%s'" % (path, policy, filename))
return filename
示例6: saveSettings
def saveSettings(self):
processor = str(self.form.defaultPostProcessor.currentText())
args = str(self.form.defaultPostProcessorArgs.text())
blacklist = []
for i in range(0, self.form.postProcessorList.count()):
item = self.form.postProcessorList.item(i)
if item.checkState() == QtCore.Qt.CheckState.Unchecked:
blacklist.append(item.text())
PathPreferences.savePostProcessorDefaults(processor, args, blacklist)
path = str(self.form.leOutputFile.text())
policy = str(self.form.cboOutputPolicy.currentText())
PathPreferences.saveOutputFileDefaults(path, policy)
示例7: saveSettings
def saveSettings(self):
pref = PathPreferences.preferences()
pref.SetFloat(self.DefaultHoldingTagWidth, FreeCAD.Units.Quantity(self.form.ifWidth.text()).Value)
pref.SetFloat(self.DefaultHoldingTagHeight, FreeCAD.Units.Quantity(self.form.ifHeight.text()).Value)
pref.SetFloat(self.DefaultHoldingTagAngle, self.form.dsbAngle.value())
pref.SetFloat(self.DefaultHoldingTagRadius, FreeCAD.Units.Quantity(self.form.ifRadius.text()))
pref.SetUnsigned(self.DefaultHoldingTagCount, self.form.sbCount.value())
示例8: load
def load(cls, processor):
PathLog.track(processor)
syspath = sys.path
paths = PathPreferences.searchPaths()
paths.extend(sys.path)
sys.path = paths
postname = processor + "_post"
namespace = {}
#can't modify function local scope with exec in python3
exec("import %s as current_post" % postname, namespace)
current_post = namespace['current_post']
# make sure the script is reloaded if it was previously loaded
# should the script have been imported for the first time above
# then the initialization code of the script gets executed twice
# resulting in 2 load messages if the script outputs one of those.
try:
# Python 2.7
exec("reload(%s)" % 'current_post')
except NameError:
# Python 3.4+
from importlib import reload
exec("reload(%s)" % 'current_post')
sys.path = syspath
instance = PostProcessor(current_post)
instance.units = None
if hasattr(current_post, "UNITS"):
if current_post.UNITS == "G21":
instance.units = "Metric"
else:
instance.units = "Inch"
instance.machineName = None
if hasattr(current_post, "MACHINE_NAME"):
instance.machineName = current_post.MACHINE_NAME
instance.cornerMax = None
if hasattr(current_post, "CORNER_MAX"):
instance.cornerMax = {'x': current_post.CORNER_MAX['x'],
'y': current_post.CORNER_MAX['y'],
'z': current_post.CORNER_MAX['z']}
instance.cornerMin = None
if hasattr(current_post, "CORNER_MIN"):
instance.cornerMin = {'x': current_post.CORNER_MIN['x'],
'y': current_post.CORNER_MIN['y'],
'z': current_post.CORNER_MIN['z']}
instance.tooltip = None
instance.tooltipArgs = None
if hasattr(current_post, "TOOLTIP"):
instance.tooltip = current_post.TOOLTIP
if hasattr(current_post, "TOOLTIP_ARGS"):
instance.tooltipArgs = current_post.TOOLTIP_ARGS
return instance
示例9: resolvePostProcessor
def resolvePostProcessor(self, job):
if hasattr(job, "PostProcessor"):
post = PathPreferences.defaultPostProcessor()
if job.PostProcessor:
post = job.PostProcessor
if post and PostProcessor.exists(post):
return post
dlg = DlgSelectPostProcessor()
return dlg.exec_()
示例10: opExecute
def opExecute(self, obj):
'''opExecute(obj) ... process engraving operation'''
PathLog.track()
output = ""
if obj.Comment != "":
output += '(' + str(obj.Comment)+')\n'
output += "(" + obj.Label + ")"
output += "(Compensated Tool Path. Diameter: " + str(obj.ToolController.Tool.Diameter) + ")"
parentJob = PathUtils.findParentJob(obj)
if parentJob is None:
return
print("base object: " + self.baseobject.Name)
if obj.Algorithm in ['OCL Dropcutter', 'OCL Waterline']:
try:
import ocl
except:
FreeCAD.Console.PrintError(
translate("Path_Surface", "This operation requires OpenCamLib to be installed.\n"))
return
if self.baseobject.TypeId.startswith('Mesh'):
mesh = self.baseobject.Mesh
else:
# try/except is for Path Jobs created before GeometryTolerance
try:
deflection = parentJob.GeometryTolerance
except AttributeError:
from PathScripts.PathPreferences import PathPreferences
deflection = PathPreferences.defaultGeometryTolerance()
self.baseobject.Shape.tessellate(0.5)
mesh = MeshPart.meshFromShape(self.baseobject.Shape, Deflection=deflection)
bb = mesh.BoundBox
s = ocl.STLSurf()
for f in mesh.Facets:
p = f.Points[0]
q = f.Points[1]
r = f.Points[2]
t = ocl.Triangle(ocl.Point(p[0], p[1], p[2]), ocl.Point(
q[0], q[1], q[2]), ocl.Point(r[0], r[1], r[2]))
s.addTriangle(t)
if obj.Algorithm == 'OCL Dropcutter':
output = self._dropcutter(obj, s, bb)
elif obj.Algorithm == 'OCL Waterline':
output = self._waterline(obj, s, bb)
self.commandlist.extend(output)
示例11: Activated
def Activated(self):
job = FreeCADGui.Selection.getSelection()[0]
dialog = DlgJobTemplateExport(job)
if dialog.exec_() == 1:
foo = QtGui.QFileDialog.getSaveFileName(QtGui.qApp.activeWindow(),
"Path - Job Template",
PathPreferences.filePath(),
"job_*.xml")[0]
if foo:
self.Execute(job, foo, dialog)
示例12: Activated
def Activated(self):
job = self.GetJob()
dialog = DlgJobTemplateExport(job)
if dialog.exec_() == 1:
foo = QtGui.QFileDialog.getSaveFileName(QtGui.QApplication.activeWindow(),
"Path - Job Template",
PathPreferences.filePath(),
"job_*.json")[0]
if foo:
self.Execute(job, foo, dialog)
示例13: __init__
def __init__(self, obj):
# obj.addProperty("App::PropertyFile", "PostProcessor", "CodeOutput", "Select the Post Processor file for this project")
obj.addProperty("App::PropertyFile", "OutputFile", "CodeOutput", QtCore.QT_TRANSLATE_NOOP("App::Property","The NC output file for this project"))
obj.OutputFile = PathPreferences.defaultOutputFile()
obj.setEditorMode("OutputFile", 0) # set to default mode
obj.addProperty("App::PropertyString", "Description", "Path", QtCore.QT_TRANSLATE_NOOP("App::Property","An optional description for this job"))
obj.addProperty("App::PropertyEnumeration", "PostProcessor", "Output", QtCore.QT_TRANSLATE_NOOP("App::Property","Select the Post Processor"))
obj.PostProcessor = postProcessors = PathPreferences.allEnabledPostProcessors()
defaultPostProcessor = PathPreferences.defaultPostProcessor()
# Check to see if default post processor hasn't been 'lost' (This can happen when Macro dir has changed)
if defaultPostProcessor in postProcessors:
obj.PostProcessor = defaultPostProcessor
else:
obj.PostProcessor = postProcessors[0]
obj.addProperty("App::PropertyString", "PostProcessorArgs", "Output", QtCore.QT_TRANSLATE_NOOP("App::Property", "Arguments for the Post Processor (specific to the script)"))
obj.PostProcessorArgs = PathPreferences.defaultPostProcessorArgs()
obj.addProperty("App::PropertyString", "MachineName", "Output", QtCore.QT_TRANSLATE_NOOP("App::Property","Name of the Machine that will use the CNC program"))
#obj.addProperty("Path::PropertyTooltable", "Tooltable", "Base", QtCore.QT_TRANSLATE_NOOP("App::Property","The tooltable used for this CNC program"))
obj.addProperty("App::PropertyEnumeration", "MachineUnits", "Output", QtCore.QT_TRANSLATE_NOOP("App::Property","Units that the machine works in, ie Metric or Inch"))
obj.MachineUnits = ['Metric', 'Inch']
obj.addProperty("App::PropertyDistance", "GeometryTolerance", "Geometry",
QtCore.QT_TRANSLATE_NOOP("App::Property", "For computing Paths; smaller increases accuracy, but slows down computation"))
obj.GeometryTolerance = PathPreferences.defaultGeometryTolerance()
obj.addProperty("App::PropertyDistance", "X_Max", "Limits", QtCore.QT_TRANSLATE_NOOP("App::Property","The Maximum distance in X the machine can travel"))
obj.addProperty("App::PropertyDistance", "Y_Max", "Limits", QtCore.QT_TRANSLATE_NOOP("App::Property","The Maximum distance in X the machine can travel"))
obj.addProperty("App::PropertyDistance", "Z_Max", "Limits", QtCore.QT_TRANSLATE_NOOP("App::Property","The Maximum distance in X the machine can travel"))
obj.addProperty("App::PropertyDistance", "X_Min", "Limits", QtCore.QT_TRANSLATE_NOOP("App::Property","The Minimum distance in X the machine can travel"))
obj.addProperty("App::PropertyDistance", "Y_Min", "Limits", QtCore.QT_TRANSLATE_NOOP("App::Property","The Minimum distance in X the machine can travel"))
obj.addProperty("App::PropertyDistance", "Z_Min", "Limits", QtCore.QT_TRANSLATE_NOOP("App::Property","The Minimum distance in X the machine can travel"))
obj.addProperty("App::PropertyLink", "Base", "Base", "The base object for all operations")
obj.Proxy = self
if FreeCAD.GuiUp:
ViewProviderJob(obj.ViewObject)
示例14: setupColors
def setupColors(self):
def colorForColorValue(val):
v = [((val >> n) & 0xff) / 255. for n in [24, 16, 8, 0]]
return coin.SbColor(v[0], v[1], v[2])
pref = PathPreferences.preferences()
# R G B A
npc = pref.GetUnsigned('DefaultPathMarkerColor', ((85*256 + 255)*256 + 0) * 256 + 255)
hpc = pref.GetUnsigned('DefaultHighlightPathColor', ((255*256 + 125)*256 + 0)*256 + 255)
dpc = pref.GetUnsigned('DefaultDisabledPathColor', ((205*256 + 205)*256 + 205)*256 + 154)
self.colors = [colorForColorValue(npc), colorForColorValue(dpc), colorForColorValue(hpc)]
示例15: __init__
def __init__(self, obj, base, template = None):
self.obj = obj
obj.addProperty("App::PropertyFile", "PostProcessorOutputFile", "Output", QtCore.QT_TRANSLATE_NOOP("App::Property","The NC output file for this project"))
obj.addProperty("App::PropertyEnumeration", "PostProcessor", "Output", QtCore.QT_TRANSLATE_NOOP("App::Property","Select the Post Processor"))
obj.addProperty("App::PropertyString", "PostProcessorArgs", "Output", QtCore.QT_TRANSLATE_NOOP("App::Property", "Arguments for the Post Processor (specific to the script)"))
obj.addProperty("App::PropertyString", "Description", "Path", QtCore.QT_TRANSLATE_NOOP("App::Property","An optional description for this job"))
obj.addProperty("App::PropertyDistance", "GeometryTolerance", "Geometry", QtCore.QT_TRANSLATE_NOOP("App::Property", "For computing Paths; smaller increases accuracy, but slows down computation"))
obj.addProperty("App::PropertyLink", "Base", "Base", QtCore.QT_TRANSLATE_NOOP("PathJob", "The base object for all operations"))
obj.addProperty("App::PropertyLink", "Stock", "Base", QtCore.QT_TRANSLATE_NOOP("PathJob", "Solid object to be used as stock."))
obj.addProperty("App::PropertyLink", "Operations", "Base", QtCore.QT_TRANSLATE_NOOP("PathJob", "Compound path of all operations in the order they are processed."))
obj.addProperty("App::PropertyLinkList", "ToolController", "Base", QtCore.QT_TRANSLATE_NOOP("PathJob", "Collection of tool controllers available for this job."))
obj.PostProcessorOutputFile = PathPreferences.defaultOutputFile()
#obj.setEditorMode("PostProcessorOutputFile", 0) # set to default mode
obj.PostProcessor = postProcessors = PathPreferences.allEnabledPostProcessors()
defaultPostProcessor = PathPreferences.defaultPostProcessor()
# Check to see if default post processor hasn't been 'lost' (This can happen when Macro dir has changed)
if defaultPostProcessor in postProcessors:
obj.PostProcessor = defaultPostProcessor
else:
obj.PostProcessor = postProcessors[0]
obj.PostProcessorArgs = PathPreferences.defaultPostProcessorArgs()
obj.GeometryTolerance = PathPreferences.defaultGeometryTolerance()
ops = FreeCAD.ActiveDocument.addObject("Path::FeatureCompoundPython", "Operations")
obj.Operations = ops
obj.setEditorMode('Operations', 2) # hide
obj.setEditorMode('Placement', 2)
obj.Base = createResourceClone(obj, base, 'Base', 'BaseGeometry')
obj.Proxy = self
self.assignTemplate(obj, template)
if not obj.Stock:
obj.Stock = PathStock.CreateFromBase(obj)
if obj.Stock.ViewObject:
obj.Stock.ViewObject.Visibility = False