Assembly: Joint creation UI : add advanced offset handling.
This commit is contained in:
@@ -28,12 +28,10 @@ import Part
|
||||
|
||||
if App.GuiUp:
|
||||
import FreeCADGui as Gui
|
||||
|
||||
import PySide.QtCore as QtCore
|
||||
import PySide.QtGui as QtGui
|
||||
from PySide import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
# translate = App.Qt.translate
|
||||
translate = App.Qt.translate
|
||||
|
||||
__title__ = "Assembly utilitary functions"
|
||||
__author__ = "Ondsel"
|
||||
@@ -754,6 +752,21 @@ def findCylindersIntersection(obj, surface, edge, elt_index):
|
||||
return surface.Center
|
||||
|
||||
|
||||
def openEditingPlacementDialog(obj, propName):
|
||||
task_placement = Gui.TaskPlacement()
|
||||
dialog = task_placement.form
|
||||
|
||||
# Connect to the placement property
|
||||
task_placement.setPlacement(getattr(obj, propName))
|
||||
task_placement.setSelection([obj])
|
||||
task_placement.setPropertyName(propName)
|
||||
task_placement.bindObject()
|
||||
task_placement.setIgnoreTransactions(True)
|
||||
|
||||
dialog.findChild(QtWidgets.QPushButton, "selectedVertex").hide()
|
||||
dialog.exec_()
|
||||
|
||||
|
||||
def applyOffsetToPlacement(plc, offset):
|
||||
plc.Base = plc.Base + plc.Rotation.multVec(offset)
|
||||
return plc
|
||||
|
||||
Reference in New Issue
Block a user