Пример #1
0
 def getIcon(self):
     if hasattr(self,"Object"):
         if a2plib.isA2pSketch(self.Object):
             return a2plib.pathOfModule()+'/icons/a2p_SketchReference.svg'
         if hasattr(self.Object,"sourceFile") and hasattr(self.Object,"sourcePart"):
             if self.Object.sourcePart is not None and self.Object.sourcePart !='':
                 return a2plib.pathOfModule()+'/icons/a2p_ObjReference.svg'
         if hasattr(self.Object,"subassemblyImport"):
             if self.Object.subassemblyImport:
                 return ":/icons/a2p_Asm.svg"
         if hasattr(self.Object,"sourceFile"):
             if self.Object.sourceFile == 'converted':
                 return ":/icons/a2p_ConvertPart.svg"
     return ":/icons/a2p_Obj.svg"
Пример #2
0
 def GetResources(self):
     return {
         'Pixmap'  :     a2plib.pathOfModule()+'/icons/a2p_glasses.svg',
         'MenuText':     'toggle transparency of assembly',
         'ToolTip':      'toggle transparency of assembly',
         'Checkable':    self.IsChecked()
     }
Пример #3
0
 def GetResources(self):
     return {
         'Pixmap'  :     a2plib.pathOfModule()+'/icons/a2p_autoSolve.svg',
         'MenuText':     'toggle AutoSolve',
         'ToolTip':      toolTipMessage,
         'Checkable':    self.IsChecked()
         }
Пример #4
0
 def GetResources(self):
     import a2plib
     return {'Pixmap'  : a2plib.pathOfModule()+'/icons/a2p_ImportPart.svg',
             'Accel' : "Shift+A", # a default shortcut (optional)
             'MenuText': "add Part from external file",
             'ToolTip' : "add Part from external file"
             }
Пример #5
0
 def GetResources(self):
     return {
         'Pixmap':
         a2plib.pathOfModule() + '/icons/a2p_ReAdjustConstraints.svg',
         'MenuText': 'Readjust directions of all constraints',
         'ToolTip': 'Readjust directions of all constraints to fit best'
     }
Пример #6
0
 def GetResources(self):
     return {
         'Pixmap'  :     a2plib.pathOfModule()+'/icons/a2p_partialProcessing.svg',
         'MenuText':     'toggle partial processing',
         'ToolTip':      'toggle partial processing',
         'Checkable':    self.IsChecked()
         }
Пример #7
0
 def __init__(self):
     global A2P_VERSION
     import a2plib
     self.__class__.Icon = a2plib.pathOfModule(
     ) + "/icons/a2p_Workbench.svg"
     self.__class__.MenuText = 'A2plus ' + A2P_VERSION
     self.__class__.ToolTip = 'An other assembly workbench for FreeCAD.'
Пример #8
0
 def __init__(self):
     global A2P_VERSION
     from a2p_translateUtils import QT_TRANSLATE_NOOP
     import a2plib
     self.__class__.Icon = a2plib.pathOfModule() + "/icons/a2p_Workbench.svg"
     self.__class__.MenuText = 'A2plus '+A2P_VERSION
     self.__class__.ToolTip  = QT_TRANSLATE_NOOP("A2plus_solversystem", "An other assembly workbench for FreeCAD.")
 def GetResources(self):
     return {
         'Pixmap':
         a2plib.pathOfModule() + '/icons/a2p_SearchConstraintConflicts.svg',
         'MenuText': 'Identify conflicting constraints',
         'ToolTip': toolTipMessage
     }
Пример #10
0
 def GetResources(self):
     return {
         #'Pixmap' : ':/assembly2/icons/MovePart.svg',
         'Pixmap': a2plib.pathOfModule() + '/icons/a2p_MovePart.svg',
         'MenuText': 'move selected part',
         'ToolTip': 'move selected part'
     }
Пример #11
0
 def GetResources(self):
     return {
         #'Pixmap' : ':/assembly2/icons/Draft_Move.svg',
         'Pixmap'  : a2plib.pathOfModule()+'/icons/a2p_Draft_Move.svg',
         'MenuText': 'move',
         'ToolTip': 'move part  ( shift+click to copy )'
         }
Пример #12
0
    def GetResources(self):
        import a2plib
        return {'Pixmap'  : a2plib.pathOfModule()+'/icons/a2p_ConvertPart.svg',
#                'Accel' : "Shift+C", # a default shortcut (optional)
                'MenuText': "Convert a part to A2plus",
                'ToolTip' : toolTip
                }
Пример #13
0
 def GetResources(self):
     return {
         'Pixmap': a2plib.pathOfModule() + '/icons/a2p_Isolate_Element.svg',
         'MenuText':
         'show only selected elements, or all if none is selected',
         'ToolTip':
         'show only selected elements, or all if none is selected'
     }
Пример #14
0
 def GetResources(self):
     return {
         'Pixmap': a2plib.pathOfModule() + '/icons/a2p_treeview.svg',
         'MenuText':
         'generate HTML file with detailed constraining structure',
         'ToolTip':
         'generate HTML file with detailed constraining structure'
     }
 def GetResources(self):
     return {
         'Pixmap':
         a2plib.pathOfModule() + '/icons/a2p_SearchConstraintConflicts.svg',
         'MenuText':
         QT_TRANSLATE_NOOP("A2plus_searchConstraintConflicts",
                           "Identify conflicting constraints"),
         'ToolTip':
         toolTipMessage
     }
Пример #16
0
 def process_menus(self, q):
     """ process the menu according to the button text"""
     if q.text() == "Open Dialog":
         CD_featurelabels.form1.showme()
     if q.text() == "Delete labels":
         CD_featurelabels.labels.deletelabels()
     if q.text() == "Change Part":
         sidefuncs.replacepart1()
     if q.text() == "Open Help":
         path = a2plib.pathOfModule() + "\CD_Help for Diagnostic tools.pdf"
         subprocess.Popen([path], shell=True)
Пример #17
0
 def GetResources(self):
     return {
         'Pixmap':
         a2plib.pathOfModule() + '/icons/a2p_ConvertPart.svg',
         #                'Accel'  : "Shift+C", # a default shortcut (optional)
         'MenuText':
         QT_TRANSLATE_NOOP("A2plus_convertPart",
                           "Convert a part to A2plus"),
         'ToolTip':
         toolTip
     }
Пример #18
0
 def GetResources(self):
     return {
         'Pixmap':
         a2plib.pathOfModule() + '/icons/a2p_ReAdjustConstraints.svg',
         'MenuText':
         translate("A2plus_constraintServices",
                   "Re-adjust directions of all constraints"),
         'ToolTip':
         translate("A2plus_constraintServices",
                   "Re-adjust directions of all constraints to fit best")
     }
Пример #19
0
    def Initialize(self):

        import a2plib  #QtCore.QResource.registerResource happens in assembly2lib
        import a2p_importpart
        import a2p_CircularEdgeConnection
        import a2p_planesParallelConstraint
        import a2p_planeConstraint
        import a2p_AxialConnection
        import a2p_angleConnection
        import a2p_pointIdentityConnection
        import a2p_pointOnLineConstraint
        import a2p_pointOnPlaneConstraint
        import a2p_sphericalConnection
        import a2p_solversystem
        import a2p_MuxAssembly

        commandslist = [
            'a2p_ImportPart', 'a2p_updateImportedParts', 'a2p_movePart',
            'a2p_duplicatePart', 'a2p_editImportedPart',
            'a2p_PointIdentityConnectionCommand',
            'a2p_PointOnLineConstraintCommand',
            'a2p_PointOnPlaneConstraintCommand', 'a2p_CircularEdgeConnection',
            'a2p_PlanesParallelConnectionCommand', 'a2p_PlaneConnection',
            'a2p_AxialConnection', 'a2p_AngledPlanesCommand',
            'a2p_SphericalConnection', 'a2p_SolverCommand',
            'a2p_DeleteConnectionsCommand', 'a2p_ViewConnectionsCommand',
            'a2p_SimpleAssemblyShapeCommand', 'a2p_ToggleTransparencyCommand',
            'a2p_isolateCommand', 'a2p_ToggleAutoSolveCommand',
            'a2p_TogglePartialProcessingCommand', 'a2p_repairTreeViewCommand'
        ]
        menuEntries = ['a2p_repairTreeViewCommand']
        self.appendToolbar('A2p', commandslist)
        self.appendMenu('A2p', menuEntries)
        #FreeCADGui.addPreferencePage( a2plib.pathOfModule() + '/GuiA2p/ui/a2p_prefs.ui','A2plus' )
        FreeCADGui.addPreferencePage(
            a2plib.pathOfModule() + '/GuiA2p/Resources/ui/a2p_prefs.ui',
            'A2plus')
Пример #20
0
 def GetResources(self):
     return {
         'Pixmap'  :     a2plib.pathOfModule()+'/icons/a2p_viewConnection.svg',
         'MenuText':     'show connected elements',
         'ToolTip':      'show connected elements',
         }
Пример #21
0
    def Initialize(self):
        import sys
        PyVersion = sys.version_info[0]
        if PyVersion == 2:
            import a2p_Resources2
        else:
            import a2p_Resources3
        import a2plib
        import a2p_importpart
        import a2p_recursiveUpdatePlanner
        import a2p_convertPart
        import a2p_solversystem
        import a2p_MuxAssembly
        import a2p_partinformation
        import a2p_constraintDialog
        import a2p_constraintcommands
        import a2p_bom # bom == bill of materials == partslist

        if a2plib.getRecursiveUpdateEnabled():
            partCommands = [
                'a2p_ImportPart',
                'a2p_ImportShapeReferenceCommand',
                'a2p_updateImportedParts',
                'a2p_recursiveUpdateImportedPartsCommand',
                'a2p_movePart',
                'a2p_MovePartUnderConstraints',
                'a2p_duplicatePart',
                'a2p_ConvertPart',
                'a2p_editImportedPart',
                'a2p_SaveAndExit_Command',
                ]
        else:
            partCommands = [
                'a2p_ImportPart',
                'a2p_ImportShapeReferenceCommand',
                'a2p_updateImportedParts',
                'a2p_movePart',
                'a2p_MovePartUnderConstraints',
                'a2p_duplicatePart',
                'a2p_ConvertPart',
                'a2p_editImportedPart',
                'a2p_SaveAndExit_Command',
                ]
        
        if a2plib.SHOW_CONSTRAINTS_ON_TOOLBAR:
            constraintCommands = [
                'a2p_ConstraintDialogCommand',
                'a2p_EditConstraintCommand',
                'a2p_DeleteConnectionsCommand',
                'a2p_PointIdentityConstraintCommand',
                'a2p_PointOnLineConstraintCommand',
                'a2p_PointOnPlaneConstraintCommand',
                'a2p_SphericalSurfaceConstraintCommand',
                'a2p_CircularEdgeConnection',
                'a2p_AxialConstraintCommand',
                'a2p_AxisParallelConstraintCommand',
                'a2p_AxisPlaneParallelCommand',
                'a2p_AxisPlaneNormalCommand',
                'a2p_AxisPlaneAngleCommand',
                'a2p_PlanesParallelConstraintCommand',
                'a2p_PlaneCoincidentConstraintCommand',
                'a2p_AngledPlanesConstraintCommand',
                'a2p_CenterOfMassConstraintCommand',
                ]
        else:
            constraintCommands = [
                'a2p_ConstraintDialogCommand',
                'a2p_EditConstraintCommand',
                'a2p_DeleteConnectionsCommand',
                ]
        
        solverCommands = [
            'a2p_SolverCommand',
            'a2p_ToggleAutoSolveCommand',
            'a2p_FlipConstraintDirectionCommand',
            'a2p_Show_Hierarchy_Command'
            ]
        viewCommands = [
            'a2p_isolateCommand',
            'a2p_ViewConnectionsCommand',
            'a2p_Restore_Transparency',
            'a2p_ToggleTransparencyCommand',            
            'a2p_Show_PartLabels_Command',
            'a2p_Show_DOF_info_Command',
            ]
        miscCommands = [
            'a2p_SimpleAssemblyShapeCommand',
            'a2p_repairTreeViewCommand',
            'a2p_CreatePartInformationSheet_Command',
            'a2p_CreatePartlist',
            ]

        self.appendToolbar(
               'A2p_Part',
               partCommands
               )
        self.appendToolbar(
               'A2p_Constraint',
               constraintCommands
               )
        self.appendToolbar(
               'A2p_Solver',
               solverCommands
               )
        self.appendToolbar(
               'A2p_View',
               viewCommands
               )
        self.appendToolbar(
               'A2p_Misc',
               miscCommands
               )

        self.appendMenu(
            'A2plus',
            partCommands
            )
        self.appendMenu(
            ['A2plus', 'Constraint'],
            constraintCommands
            )
        self.appendMenu(
            ['A2plus', 'Solver'],
            solverCommands
            )
        self.appendMenu(
            ['A2plus', 'View'],
            viewCommands
            )
        self.appendMenu(
            ['A2plus', 'Misc'],
            miscCommands
            )            
            
        menuEntries = [
            'a2p_absPath_to_relPath_Command',
            'a2p_MigrateProxiesCommand'
            ]
        self.appendMenu(
            ['A2plus', 'Misc'],
            menuEntries
            )
        FreeCADGui.addIconPath(':/icons')
        
        FreeCADGui.addPreferencePage(
            a2plib.pathOfModule() +
            '/GuiA2p/Resources/ui/a2p_prefs.ui','A2plus'
            )
Пример #22
0
 def GetResources(self):
     return {
         'Pixmap'  : a2plib.pathOfModule()+'/icons/a2p_SearchConstraintConflicts.svg',
         'MenuText': 'Conflictfinder tool: Search conflicting constraints',
         'ToolTip': 'Conflictfinder tool: Search conflicting constraints by solving them one after another'
         }
Пример #23
0
 def __init__(self):
     import a2plib
     self.__class__.Icon = a2plib.pathOfModule(
     ) + "/icons/a2p_workbench.svg"
     self.__class__.MenuText = 'A2plus'
     self.__class__.ToolTip = 'An other assembly workbench for FreeCAD'
Пример #24
0
    def Initialize(self):
        from a2p_translateUtils import QT_TRANSLATE_NOOP
        from a2p_translateUtils import translate
        from a2p_translateUtils import tr_

        import sys
        PyVersion = sys.version_info[0]
        if PyVersion == 2:
            import a2p_Resources2
        else:
            import a2p_Resources3
        import a2plib

        # add translations path
        FreeCADGui.addLanguagePath(a2plib.getLanguagePath())
        FreeCADGui.updateLocale()
        print("languagePath of A2plus Workbench is: {}".format(
            a2plib.getLanguagePath()))

        import a2p_importpart
        import a2p_recursiveUpdatePlanner
        import a2p_convertPart
        import a2p_solversystem
        import a2p_MuxAssembly
        import a2p_partinformation
        import a2p_constraintDialog
        import a2p_constraintcommands
        import a2p_bom  # bom == bill of materials == partslist
        import a2p_constraintServices
        import a2p_searchConstraintConflicts
        import CD_A2plusupdater  # for Constraint Diagnostic function
        if a2plib.getRecursiveUpdateEnabled():
            partCommands = [
                'a2p_ImportPart',
                'a2p_ImportShapeReferenceCommand',
                'a2p_updateImportedParts',
                'a2p_recursiveUpdateImportedPartsCommand',
                'a2p_movePart',
                'a2p_MovePartUnderConstraints',
                'a2p_duplicatePart',
                'a2p_ConvertPart',
                'a2p_editImportedPart',
                'a2p_SaveAndExit_Command',
            ]
        else:
            partCommands = [
                'a2p_ImportPart',
                'a2p_ImportShapeReferenceCommand',
                'a2p_updateImportedParts',
                'a2p_movePart',
                'a2p_MovePartUnderConstraints',
                'a2p_duplicatePart',
                'a2p_ConvertPart',
                'a2p_editImportedPart',
                'a2p_SaveAndExit_Command',
            ]

        if a2plib.SHOW_CONSTRAINTS_ON_TOOLBAR:
            constraintCommands = [
                'a2p_ConstraintDialogCommand',
                'a2p_EditConstraintCommand',
                'a2p_reAdjustConstraintDirectionsCommand',
                'a2p_DeleteConnectionsCommand',
                'a2p_PointIdentityConstraintCommand',
                'a2p_PointOnLineConstraintCommand',
                'a2p_PointOnPlaneConstraintCommand',
                'a2p_SphericalSurfaceConstraintCommand',
                'a2p_CircularEdgeConnection',
                'a2p_AxialConstraintCommand',
                'a2p_AxisParallelConstraintCommand',
                'a2p_AxisPlaneParallelCommand',
                'a2p_AxisPlaneNormalCommand',
                'a2p_AxisPlaneAngleCommand',
                'a2p_PlanesParallelConstraintCommand',
                'a2p_PlaneCoincidentConstraintCommand',
                'a2p_AngledPlanesConstraintCommand',
                'a2p_CenterOfMassConstraintCommand',
            ]
        else:
            constraintCommands = [
                'a2p_ConstraintDialogCommand',
                'a2p_EditConstraintCommand',
                'a2p_reAdjustConstraintDirectionsCommand',
                'a2p_DeleteConnectionsCommand',
            ]

        if a2plib.GRAPHICALDEBUG:
            solverCommands = [
                'a2p_SolverCommand', 'a2p_ToggleAutoSolveCommand',
                'a2p_FlipConstraintDirectionCommand',
                'a2p_Show_Hierarchy_Command',
                'a2p_SearchConstraintConflictsCommand',
                'a2p_cleanUpDebug3dCommand'
            ]
        else:
            solverCommands = [
                'a2p_SolverCommand', 'a2p_ToggleAutoSolveCommand',
                'a2p_FlipConstraintDirectionCommand',
                'a2p_Show_Hierarchy_Command',
                'a2p_SearchConstraintConflictsCommand'
            ]
        viewCommands = [
            'a2p_isolateCommand',
            'a2p_ViewConnectionsCommand',
            'a2p_Restore_Transparency',
            'a2p_ToggleTransparencyCommand',
            'a2p_Show_PartLabels_Command',
            'a2p_Show_DOF_info_Command',
        ]
        miscCommands = [
            'a2p_SimpleAssemblyShapeCommand',
            'a2p_repairTreeViewCommand',
            'a2p_CreatePartInformationSheet_Command',
            'a2p_CreatePartlist',
        ]

        self.appendToolbar('A2p_Part', partCommands)
        self.appendToolbar('A2p_Constraint', constraintCommands)
        self.appendToolbar('A2p_Solver', solverCommands)
        self.appendToolbar('A2p_View', viewCommands)
        self.appendToolbar('A2p_Misc', miscCommands)

        self.appendMenu('A2plus', partCommands)
        self.appendMenu(
            ['A2plus', translate("A2plus_appendMenu", 'Constraint')],
            constraintCommands)
        self.appendMenu(
            ['A2plus', translate("A2plus_appendMenu", 'Solver')],
            solverCommands)
        self.appendMenu(
            ['A2plus', translate("A2plus_appendMenu", 'View')], viewCommands)
        self.appendMenu(
            ['A2plus', translate("A2plus_appendMenu", 'Misc')], miscCommands)

        menuEntries = [
            'a2p_absPath_to_relPath_Command', 'a2p_MigrateProxiesCommand'
        ]
        self.appendMenu(['A2plus', 'Misc'], menuEntries)
        FreeCADGui.addIconPath(':/icons')

        FreeCADGui.addPreferencePage(
            a2plib.pathOfModule() + '/GuiA2p/Resources/ui/a2p_prefs.ui',
            'A2plus')

        DiagnosticCommands = [
            'rnp_Constraint_Viewer',
            'rnp_Update_A2pParts',
        ]

        self.appendToolbar('A2Diagnostics', DiagnosticCommands)
Пример #25
0
 def GetResources(self):
     return {
         'Pixmap'  :     a2plib.pathOfModule()+'/icons/a2p_treeview.svg',
         'MenuText':     'repair treeView',
         'ToolTip':      toolTipMessage
         }
Пример #26
0
    def Initialize(self):
        import sys
        PyVersion = sys.version_info[0]
        if PyVersion == 2:
            import a2p_Resources2
        else:
            import a2p_Resources3
        import a2plib  #QtCore.QResource.registerResource happens in assembly2lib
        import a2p_importpart
        import a2p_convertPart
        import a2p_CircularEdgeConnection
        import a2p_planesParallelConstraint
        import a2p_planeConstraint
        import a2p_AxialConnection
        import a2p_angleConnection
        import a2p_pointIdentityConnection
        import a2p_pointOnLineConstraint
        import a2p_pointOnPlaneConstraint
        import a2p_sphericalConnection
        import a2p_solversystem
        import a2p_MuxAssembly
        import a2p_partinformation
        import a2p_bom  #bill of materials == partslist

        partCommands = [
            'a2p_ImportPart',
            'a2p_updateImportedParts',
            'a2p_movePart',
            'a2p_duplicatePart',
            'a2p_ConvertPart',
            'a2p_editImportedPart',
        ]
        constraintCommands = [
            'a2p_PointIdentityConnectionCommand',
            'a2p_PointOnLineConstraintCommand',
            'a2p_PointOnPlaneConstraintCommand',
            'a2p_CircularEdgeConnection',
            'a2p_AxialConnection',
            'a2p_PlanesParallelConnectionCommand',
            'a2p_PlaneConnection',
            'a2p_AngledPlanesCommand',
            'a2p_SphericalConnection',
            'a2p_DeleteConnectionsCommand',
        ]
        solverCommands = [
            'a2p_SolverCommand',
            #'a2p_newSolverCommand',
            'a2p_ToggleAutoSolveCommand',
            'a2p_FlipConstraintDirectionCommand',
            'a2p_Show_DOF_info_Command',
            'a2p_Show_Hierarchy_Command'
            #'a2p_TogglePartialProcessingCommand',
        ]
        viewCommands = [
            'a2p_ViewConnectionsCommand',
            'a2p_ToggleTransparencyCommand',
            'a2p_isolateCommand',
        ]
        miscCommands = [
            'a2p_SimpleAssemblyShapeCommand', 'a2p_repairTreeViewCommand',
            'a2p_CreatePartInformationSheet_Command', 'a2p_CreatePartlist'
        ]

        self.appendToolbar('A2p_Part', partCommands)
        self.appendToolbar('A2p_Constraint', constraintCommands)
        self.appendToolbar('A2p_Solver', solverCommands)
        self.appendToolbar('A2p_View', viewCommands)
        self.appendToolbar('A2p_Misc', miscCommands)

        commandslist = list()
        commandslist.extend(partCommands)
        commandslist.extend(constraintCommands)
        commandslist.extend(solverCommands)
        commandslist.extend(viewCommands)
        commandslist.extend(miscCommands)

        self.appendMenu('A2p', commandslist)

        menuEntries = [
            'a2p_repairTreeViewCommand', 'a2p_absPath_to_relPath_Command'
        ]
        self.appendMenu('A2p', menuEntries)
        FreeCADGui.addIconPath(':/icons')
        #FreeCADGui.addPreferencePage( a2plib.pathOfModule() + '/GuiA2p/ui/a2p_prefs.ui','A2plus' )
        FreeCADGui.addPreferencePage(
            a2plib.pathOfModule() + '/GuiA2p/Resources/ui/a2p_prefs.ui',
            'A2plus')
Пример #27
0
 def GetResources(self):
     return {
         'Pixmap'  : a2plib.pathOfModule()+'/icons/a2p_DuplicatePart.svg',
         'MenuText': 'duplicate',
         'ToolTip': 'duplicate part (hold shift for multiple)'
         }
Пример #28
0
 def GetResources(self):
     return {
         'Pixmap'  : a2plib.pathOfModule()+'/icons/a2p_EditPart.svg',
         'MenuText': 'edit',
         }
Пример #29
0
 def GetResources(self):
     return {
         'Pixmap': a2plib.pathOfModule() + '/icons/a2p_DOFs.svg',
         'MenuText': 'print detailed DOF information to console',
         'ToolTip': 'print detailed DOF information to console'
     }
Пример #30
0
 def GetResources(self):
     return {
         'Pixmap'  : a2plib.pathOfModule()+'/icons/a2p_deleteConnections.svg',
         'MenuText': 'delete constraints',
         }