forked from youen/assembly_handbook
Added macro to annotate a view (wip)
This commit is contained in:
parent
c354bd9671
commit
41097abf6a
17
ahb_cmd_view_annotate.py
Normal file
17
ahb_cmd_view_annotate.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user