当前位置: 首页>>代码示例>>Python>>正文


Python PathScripts.PathSelection类代码示例

本文整理汇总了Python中PathScripts.PathSelection的典型用法代码示例。如果您正苦于以下问题:Python PathSelection类的具体用法?Python PathSelection怎么用?Python PathSelection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PathSelection类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

 def __init__(self):
     import PathScripts.PathSelection as PST
     PST.drillselect()
开发者ID:3DPrinterGuy,项目名称:FreeCAD,代码行数:3,代码来源:PathDrilling.py

示例2: __del__

 def __del__(self):
     import PathScripts.PathSelection as PST
     PST.clear()
开发者ID:3DPrinterGuy,项目名称:FreeCAD,代码行数:3,代码来源:PathDrilling.py

示例3: __init__

 def __init__(self):
     import PathScripts.PathSelection as PST
     PST.profileselect()
开发者ID:Drooids,项目名称:FreeCAD,代码行数:3,代码来源:PathProfile.py

示例4: __init__

 def __init__(self):
     import PathScripts.PathSelection as PST
     PST.surfaceselect()
开发者ID:KonstantinFinagin,项目名称:FreeCAD,代码行数:3,代码来源:PathSurface.py

示例5: getSelectionFactory

 def getSelectionFactory(self):
     '''getSelectionFactory() ... return a factory function that can be used to create the selection observer.'''
     return PathSelection.select(self.OpName)
开发者ID:,项目名称:,代码行数:3,代码来源:

示例6: preCleanup

 def preCleanup(self):
     for page in self.featurePages:
         page.onDirtyChanged(None)
     PathSelection.clear()
     FreeCADGui.Selection.removeObserver(self)
     self.obj.ViewObject.Proxy.clearTaskPanel()
开发者ID:,项目名称:,代码行数:6,代码来源:

示例7: __init__

 def __init__(self):
     import PathScripts.PathSelection as PST
     PST.pocketselect()
开发者ID:FreeCAD,项目名称:FreeCAD,代码行数:3,代码来源:PathPocket.py

示例8: __init__

 def __init__(self):
     import PathScripts.PathSelection as PST
     PST.contourselect()
开发者ID:sliptonic,项目名称:FreeCAD,代码行数:3,代码来源:PathContour.py

示例9: __del__

 def __del__(self):
     PathSelection.clear()
开发者ID:,项目名称:,代码行数:2,代码来源:

示例10: __init__

 def __init__(self):
     import PathScripts.PathSelection as PST
     PST.engraveselect()
开发者ID:DeepSOIC,项目名称:FreeCAD-ellipse,代码行数:3,代码来源:PathEngrave.py

示例11: Activated

    def Activated(self):
        import Path
        from PathScripts import PathUtils,PathProfile,PathProject
        prjexists = False
        selection = PathSelection.multiSelect()

        if not selection:
            return

        # if everything is ok, execute and register the transaction in the undo/redo stack
        FreeCAD.ActiveDocument.openTransaction(translate("Path_Profile","Create Profile"))
        FreeCADGui.addModule("PathScripts.PathProfile")

        obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython","Profile")
        PathProfile.ObjectProfile(obj)
        PathProfile.ViewProviderProfile(obj.ViewObject)

        obj.Base = (FreeCAD.ActiveDocument.getObject(selection['objname']))

        if selection['facenames']:
            #FreeCAD.Console.PrintMessage('There are edges selected\n')
            obj.Face1 = (FreeCAD.ActiveDocument.getObject(selection['objname']),selection['facenames'][0])
            if len(selection['facenames'])>1:
                obj.Face2 = (FreeCAD.ActiveDocument.getObject(selection['objname']),selection['facenames'][-1])

        if selection['edgenames']:
            #FreeCAD.Console.PrintMessage('There are edges selected\n')
            
            obj.Edge1 =(FreeCAD.ActiveDocument.getObject(selection['objname']),(selection['edgenames'][0]))
            if len(selection['edgenames'])>1:
                obj.Edge2 =(FreeCAD.ActiveDocument.getObject(selection['objname']),(selection['edgenames'][-1]))

        if selection['pointlist']:
            FreeCADGui.doCommand('from FreeCAD import Vector')
            stptX, stptY, stptZ = selection['pointlist'][0].X, selection['pointlist'][0].Y, selection['pointlist'][0].Z
            obj.StartPoint = Vector((stptX),(stptY),(stptZ))
            if len(selection['pointlist'])>1: # we have more than one point so we have an end point
                endptX, endptY, endptZ = selection['pointlist'][-1].X, selection['pointlist'][-1].Y, selection['pointlist'][-1].Z
                obj.EndPoint = Vector(endptX,endptY,endptZ)
        if selection['pathwire'].isClosed():
            obj.PathClosed = True
            if selection['clockwise']:
                obj.Side = "Left"
                obj.Direction = "CW"
            elif selection['clockwise'] == False: 
                obj.Side = "Right"
                obj.Direction = "CCW"
        else:
            obj.Side = "On"
            obj.Direction = "CCW"
            obj.PathClosed = False

        ZMax = obj.Base[0].Shape.BoundBox.ZMax
        ZMin = obj.Base[0].Shape.BoundBox.ZMin
        obj.StepDown.Value = 1.0
        obj.StartDepth.Value = ZMax- obj.StepDown.Value
        obj.FinalDepth.Value = ZMin-1.0
        obj.ClearanceHeight.Value =  ZMax + 5.0
        obj.SegLen.Value = 0.5
        obj.Active = True
        obj.ViewObject.ShowFirstRapid = False

        project = PathUtils.addToProject(obj)

        tl = PathUtils.changeTool(obj,project)
        if tl:
            obj.ToolNumber = tl

        FreeCAD.ActiveDocument.commitTransaction()
        FreeCAD.ActiveDocument.recompute()
开发者ID:AllenBootung,项目名称:FreeCAD,代码行数:70,代码来源:PathProfile.py


注:本文中的PathScripts.PathSelection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。