Skip to content

Instantly share code, notes, and snippets.

import Part
from pivy import coin
class Molecule:
def __init__(self, obj):
''' Add two point properties '''
obj.addProperty("App::PropertyVector","p1","Line","Start point")
obj.addProperty("App::PropertyVector","p2","Line","End point").p2=FreeCAD.Vector(5,0,0)
obj.Proxy = self
@tomkcook
tomkcook / test.py
Created May 14, 2020 08:48
Test code for FreeCAD highlighting and selection
class Molecule:
def __init__(self, obj):
''' Add two point properties '''
obj.addProperty("App::PropertyVector","p1","Line","Start point")
obj.addProperty("App::PropertyVector","p2","Line","End point").p2=FreeCAD.Vector(5,0,0)
obj.Proxy = self
def onChanged(self, fp, prop):
pass
@tomkcook
tomkcook / app.py
Created March 20, 2018 15:50
Authenticate against Sharepoint using flask-oauthlib (not yet working - see comments)
# Notes
# - All IDs are GUIDs
# - You get the client ID and the client secret by registering your app. You can
# do this through sharepoint online or through Azure AD.
# - Getting an access token goes in two steps; you request an authorization token from Sharepoint,
# then an access token from ACS.
# - Getting the authorization token from Sharepoint works (returned as a request to
# /login?code=XXX )
# - Getting the access token doesn't work. Apparently because Sharepoint and ACS disagree about
# what is a valid client ID. Sharepoint wants just the app's GUID, while ACS wants to see