Only used measure a few times. It seems that in 0.20 there is no distance object appearing in tree, with properties. Rather: it prints to report view.
How to access distance variable shown here with python?
Thanks in advance
Distance tool prints to report view, how is this queried with python?
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Distance tool prints to report view, how is this queried with python?
In FreeCAD is three Measure systems
App::MeasureDistance
This draws white line, object is saved in Tree and have access from Python.
Call from: MainMenu > Tools > Measure Distance
Part_Measure
This draws colored lines, object is NOT saved in Tree and NOT have access from Python. It prints in the report view.
Call from: MainMenu > Measure ( If Part WB is active )
Measure.Measurement()
Call from Python. It not draw
App::MeasureDistance
This draws white line, object is saved in Tree and have access from Python.
Call from: MainMenu > Tools > Measure Distance
Part_Measure
This draws colored lines, object is NOT saved in Tree and NOT have access from Python. It prints in the report view.
Call from: MainMenu > Measure ( If Part WB is active )
Measure.Measurement()
Call from Python. It not draw
Re: Distance tool prints to report view, how is this queried with python?
Measure.Measurement()
where does one read up on Measurement() methods?
Part_Measure was going to use this for its orthogonal measure... If any GUI experts reading, how to save the report view as text, with python
App::MeasureDistance this doesn't have orthogonality it seems, but I'll try make a FPO to use it... :/
How do I make a FPO which allows user to select two points in GUI?
Code: Select all
def create(obj_name):
obj = App.ActiveDocument.addObject('App::MeasureDistance', obj_name) # Creates a new FreeCAD FeaturePython
measure(obj)
return obj
class measure():
def __init__(self, obj):
self.Type = 'measure'
obj.Proxy = self
def execute(v1,v2):
v1 = Gui.userinput
v2 = Gui.userinput