I want to create some points in FreeCAD and have their labels displayed next to them. My final goal is to implement this feature request I placed in OpenFOAM repo.
I tried creating some points in draft workbench and label them with:
App.newDocument("test")
Gui.activateWorkbench("DraftWorkbench")
import Draft
point00=Draft.makePoint(0.0,0.0,0.0)
point00.Label = "0"
point01=Draft.makePoint(1.0,0.0,0.0)
point01.Label = "1"
point03=Draft.makePoint(0.0,1.0,0.0)
point03.Label = "2"
Now from here if I add the code blow:
a=App.ActiveDocument.addObject("App::AnnotationLabel","Annotation")
a.LabelText=["0"]
it will label the first point:
How can I do the same for all of the points I create automatically? my goal is to have some points with labels shown next to them. preferably to have a function that takes x,y,z and label and show the point automatically with the label next to it.
P.S. A summary of this effort can be found in this GitHub Gist.