How-to determine global coordinates of a circle or arc?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
ppemawm
Veteran
Posts: 1090
Joined: Fri May 17, 2013 3:54 pm
Location: Manhattan New York

Re: How-to determine global coordinates of a circle or arc?

Post by ppemawm »

Thanks to triplus and mario 52 for their valuable time to continue to look into this.
triplus wrote:Now if that is the way to tackle this or is it more important to have less clutter in status bar by removing the text after 3 seconds i am not sure.
I would vote to have the information in the status bar stay only for a given mouse selection until the next selection. That way the coordinate(s) could be easily copied and pasted into an input field.

For now, the toolbar macro that triplus shared is quite adequate.
"It is a poor workman who blames his tools..." ;)
triplus
Veteran
Posts: 9472
Joined: Mon Dec 12, 2011 4:45 pm

Re: How-to determine global coordinates of a circle or arc?

Post by triplus »

ppemawm wrote:I would vote to have the information in the status bar stay only for a given mouse selection until the next selection. That way the coordinate(s) could be easily copied and pasted into an input field.
I don't know if this is a bug or desired behaviour but based on my tests "Preselected:" message is always displayed. That is hovering the mouse over 3D objects shows current coordinates and the message is removed after 3s of hovering inactivity. And there currently isn't any "Selected" message.

I guess if time value would be removed "Preselected:" message would always be displayed and that could make sense. But there is one piece missing currently and that is once there is no preselection under the mouse the message should be removed.
mario52
Veteran
Posts: 4542
Joined: Wed May 16, 2012 2:13 pm

Re: How-to determine global coordinates of a circle or arc?

Post by mario52 »

hi
with this macro you have the statusbar info and Triplus info (but the macro stay resident)

Code: Select all

# -*- coding: utf-8 -*-                                                        ##    PAS EFFACER
class SelObserver:
#    def setPreselection(self,doc,obj,sub): # Preselection (survol)
    print "run .."
    def addSelection(self,doc,obj,sub,pnt):  # Selection
      
        print doc    # document
        print obj    # object
        print sub    # sub object
        print "Coordinates point mouse     : ",pnt    # coordinate point mouse

        try:     # triplus code
#            print Gui.Selection.getSelectionEx()[0].SubObjects[0].Curve.Center
            print "Coordinates center circle X : ",Gui.Selection.getSelectionEx()[0].SubObjects[0].Curve.Center.x
            print "Coordinates center circle Y : ",Gui.Selection.getSelectionEx()[0].SubObjects[0].Curve.Center.y
            print "Coordinates center circle Z : ",Gui.Selection.getSelectionEx()[0].SubObjects[0].Curve.Center.z

            print "Radius circle               : ",Gui.Selection.getSelectionEx()[0].SubObjects[0].Curve.Radius
        except Exception:
            None
        print "_____________________"

    def removeSelection(self,doc,obj,sub):    # Effacer l'objet selectionne
        print "removeSelection"
#    def setSelection(self,doc):               # Selection dans ComboView
#        FreeCADGui.Selection.removeObserver(s)# desinstalle la fonction residente
#        print "setSelection quit"
    def clearSelection(self,doc):             # Si clic sur l'ecran, effacer la selection
        print "clearSelection"                # Si clic sur un autre objet, efface le precedent
s=SelObserver()
FreeCADGui.Selection.addObserver(s)           # installe la fonction en mode resident

Preselected00.png
Preselected00.png (12.12 KiB) Viewed 1580 times
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
triplus
Veteran
Posts: 9472
Joined: Mon Dec 12, 2011 4:45 pm

Re: How-to determine global coordinates of a circle or arc?

Post by triplus »

Yes using selection observer for sure makes the end user life easier. As in a way this is "continuous mode". ;)

And additional benefit when using macros is copy/paste works. Therefore i guess the only solution left that could further improve this in the future is to add "pick a point" tool directly in the placement dialog. But then i guess it could work too fast and it could become to easy. Probably you would need something like a driving licence for it. :lol:
chrisb
Veteran
Posts: 52169
Joined: Tue Mar 17, 2015 9:14 am

Re: How-to determine global coordinates of a circle or arc?

Post by chrisb »

For testing purpose i increased it to 10s and to be honest writing the number down on a piece of paper if it has a lot of decimal places. And for all 3 coordinates... Likely 10s wouldn't be enough. Therefore i am not sure if it would make any sense in increasing this value as likely 20s would need to be set. Now if that is the way to tackle this or is it more important to have less clutter in status bar by removing the text after 3 seconds i am not sure.
I would greately appreciate the display in the status bar for at least 10s. I cannot remember how often I wanted to have just a quick look at the coordinates and it was always this fiddling with mouse over-off-over. I need it e.g. when I double check some hand written gcode based on the model (yes I use path WB as well).
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
microelly2
Veteran
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: How-to determine global coordinates of a circle or arc?

Post by microelly2 »

chrisb wrote:
For testing purpose i increased it to 10s and to be honest writing the number down on a piece of paper if it has a lot of decimal places. And for all 3 coordinates... Likely 10s wouldn't be enough. Therefore i am not sure if it would make any sense in increasing this value as likely 20s would need to be set. Now if that is the way to tackle this or is it more important to have less clutter in status bar by removing the text after 3 seconds i am not sure.
I would greately appreciate the display in the status bar for at least 10s. I cannot remember how often I wanted to have just a quick look at the coordinates and it was always this fiddling with mouse over-off-over. I need it e.g. when I double check some hand written gcode based on the model (yes I use path WB as well).
What about having the option to write the informations into a multiline textwidget/report view?
So we can copy and paste them?
chrisb
Veteran
Posts: 52169
Joined: Tue Mar 17, 2015 9:14 am

Re: How-to determine global coordinates of a circle or arc?

Post by chrisb »

What about having the option to write the informations into a multiline textwidget/report view?
So we can copy and paste them?
Would be ok for me, although I would like to be able to turn it off in report view. I don't know anything about the internals of the Tools->Parameters, but just for displaying it seems a natural approach to configure the display time there - perhaps with the option of entering 0 for indefinite.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
triplus
Veteran
Posts: 9472
Joined: Mon Dec 12, 2011 4:45 pm

Re: How-to determine global coordinates of a circle or arc?

Post by triplus »

microelly2 wrote:What about having the option to write the informations into a multiline textwidget/report view?
So we can copy and paste them?
The amount of info would likely beat the purpose.
chrisb wrote:I would greately appreciate the display in the status bar for at least 10s.
Yes the original request was to increase the time as current time is set too low and it causes usability issue. Therefore this could be resolved and i can make pull request and set the time to 10s. If Preselected message would be cleared when mouse is going over places without anything to select message probably could be set to always on. But this isn't the case therefore at best i can help with increasing the time to 10s for now if that makes sense to others.
User avatar
ppemawm
Veteran
Posts: 1090
Joined: Fri May 17, 2013 3:54 pm
Location: Manhattan New York

Re: How-to determine global coordinates of a circle or arc?

Post by ppemawm »

triplus wrote:best i can help with increasing the time to 10s for now if that makes sense to others
This works for me.

I find that after several years of routinely using FreeCAD as a consulting engineer creating parametric models and assemblies that 80% of the time I use the information in the status bar is for coordinates either for Center in Placement or for Sketch offset. Having time to record one or more of the coordinates would significantly assist in work flow. Unfortunately it doesn't seem that you can copy and paste from the status bar. For that case, the above macros are most helpful.
"It is a poor workman who blames his tools..." ;)
User avatar
sgrogan
Veteran
Posts: 6501
Joined: Wed Oct 22, 2014 5:02 pm

Re: How-to determine global coordinates of a circle or arc?

Post by sgrogan »

Right Click on Report view > Options > Activate Logging. Gui selections are written to Report view
"fight the good fight"
Post Reply