本文整理匯總了Python中OpenSCADUtils.searchforopenscadexe方法的典型用法代碼示例。如果您正苦於以下問題:Python OpenSCADUtils.searchforopenscadexe方法的具體用法?Python OpenSCADUtils.searchforopenscadexe怎麽用?Python OpenSCADUtils.searchforopenscadexe使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OpenSCADUtils
的用法示例。
在下文中一共展示了OpenSCADUtils.searchforopenscadexe方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Initialize
# 需要導入模塊: import OpenSCADUtils [as 別名]
# 或者: from OpenSCADUtils import searchforopenscadexe [as 別名]
def Initialize(self):
def QT_TRANSLATE_NOOP(scope, text):
return text
import OpenSCAD_rc,OpenSCADCommands
commands=['OpenSCAD_ReplaceObject','OpenSCAD_RemoveSubtree',\
'OpenSCAD_RefineShapeFeature',\
'OpenSCAD_IncreaseToleranceFeature', 'OpenSCAD_Edgestofaces', \
'OpenSCAD_ExpandPlacements','OpenSCAD_ExplodeGroup']
toolbarcommands=['OpenSCAD_ReplaceObject','OpenSCAD_RemoveSubtree',\
'OpenSCAD_ExplodeGroup','OpenSCAD_RefineShapeFeature']
#'OpenSCAD_IncreaseToleranceFeature' #icon still missing
import PartGui
parttoolbarcommands = ['Part_CheckGeometry',"Part_Primitives",\
"Part_Builder",'Part_Cut','Part_Fuse','Part_Common',\
'Part_Extrude',"Part_Revolve"]
import FreeCAD
param = FreeCAD.ParamGet(\
"User parameter:BaseApp/Preferences/Mod/OpenSCAD")
openscadfilename = param.GetString('openscadexecutable')
if not openscadfilename:
import OpenSCADUtils
openscadfilename = OpenSCADUtils.searchforopenscadexe()
if openscadfilename: #automatic search was succsessful
FreeCAD.addImportType("OpenSCAD Format (*.scad)","importCSG")
param.SetString('openscadexecutable',openscadfilename) #save the result
if openscadfilename:
commands.extend(['OpenSCAD_AddOpenSCADElement',
'OpenSCAD_MeshBoolean','OpenSCAD_Hull','OpenSCAD_Minkowski'])
toolbarcommands.extend(['OpenSCAD_AddOpenSCADElement',
'OpenSCAD_MeshBoolean','OpenSCAD_Hull','OpenSCAD_Minkowski'])
else:
FreeCAD.Console.PrintWarning('OpenSCAD executable not found\n')
self.appendToolbar(QT_TRANSLATE_NOOP('Workbench','OpenSCADTools'),toolbarcommands)
self.appendMenu('OpenSCAD',commands)
self.appendToolbar(QT_TRANSLATE_NOOP('Workbech','OpenSCAD Part tools'),parttoolbarcommands)
#self.appendMenu('OpenSCAD',["AddOpenSCADElement"])
###self.appendCommandbar("&Generic Tools",["ColorCodeShape"])
FreeCADGui.addIconPath(":/icons")
FreeCADGui.addLanguagePath(":/translations")
FreeCADGui.addPreferencePage(":/ui/openscadprefs-base.ui","OpenSCAD")