本文整理汇总了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")