示例#1
0
        self.buttonLayout.addWidget(self.CancelButton)
        self.buttonLayout.addStretch()
        self.buttonLayout.addWidget(self.DelButton)
        self.mainLayout.addLayout(self.buttonLayout)

        # finally, apply the layout to the main window
        self.UI.setLayout(self.mainLayout)

        # Actions
        self.varList.currentIndexChanged.connect( self.onSelectProp )
        self.CancelButton.clicked.connect(self.onCancel)
        self.DelButton.clicked.connect(self.onDel)





"""
    +-----------------------------------------------+
    |       add the command to the workbench        |
    +-----------------------------------------------+
"""
Gui.addCommand( 'Asm4_addVariable', addVariable() )
Gui.addCommand( 'Asm4_delVariable', delVariable() )

variablesCmdList = [ 'Asm4_addVariable', 'Asm4_delVariable' ]
tooltip  = "Adds a variable into the \"Variables\" placeholder in the document.\n"
tooltip += "This variable can then be used in any formula using the ExpressionEngine\n"
tooltip += "of any compatible input field. These are marked with a \"f(x)\" symbol."
Gui.addCommand( 'Asm4_variablesCmd', Asm4.dropDownCmd( variablesCmdList, 'Variables', tooltip ))
示例#2
0
        # check that the Fasteners WB has been loaded before:
        if not 'FSChangeParams' in Gui.listCommands():
            Gui.activateWorkbench('FastenersWorkbench')
            Gui.activateWorkbench('Assembly4Workbench')
        # check that we have selected a Fastener from the Fastener WB
        selection = getSelectionFS()
        if selection:
            Gui.runCommand('FSChangeParams')


"""
    +-----------------------------------------------+
    |       add the commands to the workbench       |
    +-----------------------------------------------+
"""
Gui.addCommand('Asm4_insertScrew', insertFastener('Screw'))
Gui.addCommand('Asm4_insertNut', insertFastener('Nut'))
Gui.addCommand('Asm4_insertWasher', insertFastener('Washer'))
#Gui.addCommand( 'Asm4_insertRod',      insertFastener('ThreadedRod') )
Gui.addCommand('Asm4_placeFastener', placeFastenerCmd())
Gui.addCommand('Asm4_cloneFastenersToAxes', cloneFastenersToAxesCmd())
Gui.addCommand('Asm4_FSparameters', changeFSparametersCmd())

# defines the drop-down button for Fasteners:
FastenersCmdList = [
    'Asm4_insertScrew', 'Asm4_insertNut', 'Asm4_insertWasher',
    'Asm4_cloneFastenersToAxes', 'Asm4_FSparameters'
]
Gui.addCommand('Asm4_Fasteners', Asm4.dropDownCmd(FastenersCmdList,
                                                  'Fasteners'))
示例#3
0
                axis.Support = [(selectedObj, (edgeName, ))]
                axis.MapMode = 'AxisOfCurvature'
                axis.MapReversed = False
                axis.ResizeMode = 'Manual'
                axis.Length = edgeObj.BoundBox.DiagonalLength
                axis.ViewObject.ShapeColor = (0.0, 0.0, 1.0)
                axis.ViewObject.Transparency = 50
                axis.recompute()
                parentPart.recompute()


"""
    +-----------------------------------------------+
    |       add the commands to the workbench       |
    +-----------------------------------------------+
"""
Gui.addCommand('Asm4_newPoint', newDatum('Point'))
Gui.addCommand('Asm4_newAxis', newDatum('Axis'))
Gui.addCommand('Asm4_newPlane', newDatum('Plane'))
Gui.addCommand('Asm4_newLCS', newDatum('LCS'))
Gui.addCommand('Asm4_newSketch', newDatum('Sketch'))
Gui.addCommand('Asm4_newHole', newHole())

# defines the drop-down button for Datum objects
createDatumList = [
    'Asm4_newLCS', 'Asm4_newPlane', 'Asm4_newAxis', 'Asm4_newPoint',
    'Asm4_newHole'
]
Gui.addCommand('Asm4_createDatum',
               Asm4.dropDownCmd(createDatumList, 'Create Datum Object'))