FreeCAD workbench to create assembly handbooks
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
515 B

doc = App.activeDocument()
view = doc.getObject('View')
if len(Gui.Selection.getSelection()) != 1:
raise Exception("Veuillez sélectionner exactement un objet")
object = Gui.Selection.getSelection()[0]
# Get object center in view space
objectCenterWorld = object.LinkPlacement.Matrix.multiply(object.LinkedObject.Shape.CenterOfGravity)
vertId = view.makeCosmeticVertex3d(objectCenterWorld)
vert = view.getCosmeticVertex(vertId)
objectCenterView = vert.Point
view.removeCosmeticVertex(vertId)
# Create Balloon