Skip to content

Instantly share code, notes, and snippets.

@yorikvanhavre
Last active December 14, 2015 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yorikvanhavre/5076624 to your computer and use it in GitHub Desktop.
Save yorikvanhavre/5076624 to your computer and use it in GitHub Desktop.
FreeCAD - use Sketcher datums from python
from pivy import coin
import SketcherGui
coin.SoType.fromName("SoDatumLabel")
l=coin.SoType.fromName("SoDatumLabel").createInstance()
l.Type
l.string.setValue("Yorik")
sg=Gui.ActiveDocument.ActiveView.getSceneGraph()
sg.addChild(l)
l.datumtype.getValue()
l.datumtype.setValue(2)
l.datumtype.setValue(1)
l.datumtype.setValue(0)
l.datumtype.setValue(2)
l.pnts
l.pnts[0]
p1=coin.SbVec3f([0.0,0.0,0.0])
p2=coin.SbVec3f([2.0,2.0,0.0])
l.pnts.setValues([p1,p2])
l.textColor.setValue(coin.SbVec3f([1.0,0.0,0.0]))
l.string.setValue("")
l.string.setValue("Té")
l.string.setValue("Bl#")
l.string.setValue("Blü")
l.param1.setValue(1)
l.param2.setValue(.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment