Search found 5625 matches

Go to advanced search

by openBrain
Sun Apr 18, 2021 7:23 pm
Forum: Python scripting and macros
Topic: Vertex element access
Replies: 16
Views: 230

Re: Vertex element access

It depends if you want the coordinates in the 3D world or in the sketch world. In the second case, I think you do right.
by openBrain
Sun Apr 18, 2021 7:18 pm
Forum: Help on using FreeCAD
Topic: Problem of screen geometry (the grid is not formed of squares)
Replies: 4
Views: 127

Re: Problem of screen geometry (the grid is not formed of squares)

About your remarks, I set the information in my signature (I had to reduce it, since you limit it to 255 chars). I hope that it is a good practice here? (So I will never forget). This is definitely a bad practice as your signature is shared through all your posts (even past ones). So when you'll up...
by openBrain
Sun Apr 18, 2021 6:19 pm
Forum: Python scripting and macros
Topic: How do we simulate a double-click in the tree view?
Replies: 12
Views: 551

Re: How do we simulate a double-click in the tree view?

ebrahim raeyat wrote:
Sun Apr 18, 2021 10:43 am
Thanks. Is there any example of this type or trying to do similar work?
None that I know... :/
by openBrain
Sun Apr 18, 2021 6:18 pm
Forum: Help on using FreeCAD
Topic: Section view by default in sketch mode?
Replies: 2
Views: 252

Re: Section view by default in sketch mode?

When entering a sketch - is it possible to make the view not only orientate itself to the sketch plane (ViewSketch https://wiki.freecadweb.org/Sketcher_ViewSketch), but also enable section view (ViewSection https://wiki.freecadweb.org/Sketcher_ViewSection)? If not - this would be a very useful sett...
by openBrain
Sun Apr 18, 2021 6:16 pm
Forum: Python scripting and macros
Topic: Vertex element access
Replies: 16
Views: 230

Re: Vertex element access

drmacro wrote:
Sun Apr 18, 2021 5:26 pm
Where did I get SKETCH_OBJECT from?
I explained above as an answer to onekk. This is a pointer to the sketch. No matter how you get it.
Where did I get YY from?
Was a copy-paste mistake. In the quoted example, YY=8, so YY-1=7. I fixed the previous post. ;)
by openBrain
Sun Apr 18, 2021 5:12 pm
Forum: Python scripting and macros
Topic: Vertex element access
Replies: 16
Views: 230

Re: Vertex element access

Umm...but, that is failing because Vertex8 (returned in the selected list) (and I can see in the Geometry list in the debugger) is not index 7, in Geometry list it (assuming 4 lines and 1 point object in the sketch) is index 4. :? Maybe I wasn't totally clear. OK, say 'Vertex8'. Enter 'SKETCH_OBJEC...
by openBrain
Sun Apr 18, 2021 4:48 pm
Forum: Python scripting and macros
Topic: Vertex element access
Replies: 16
Views: 230

Re: Vertex element access

Interesting, and for an edge there is a similar function. For an edge there is direct conversion. 'EdgeYY' is 'SKETCH_OBJECT.Geometry[YY-1]' SKETCH_OBJECT is object returned scanning Active.Geometry ? SKETCH_OBJECT is any pointer to a sketch, eg. 'App.ActiveDocument.SKETCH_NAME' or 'Gui.ActiveDocum...
by openBrain
Sun Apr 18, 2021 4:25 pm
Forum: Python scripting and macros
Topic: Vertex element access
Replies: 16
Views: 230

Re: Vertex element access

I didn't read everything in detail but here is how to go. As an example, let's imagine the user selection is "VertexYY". You get the sketch element with : SKETCH_OBJECT.getGeoVertexIndex(YY-1) This returns a tuple : the first value is the geometryID in the sketch world (that you can use in 'SKETCH_O...
by openBrain
Sun Apr 18, 2021 4:02 pm
Forum: Python scripting and macros
Topic: [Solved] PyQt Question : Getting FreeCAD's System Font
Replies: 13
Views: 548

Re: PyQt Question : Getting FreeCAD's System Font

Why is the SoLocation2Event at position [0,0] when the mouse hovers to the bottom-left of the view-area? Isn't it normally the top-left? Just wondering. Other than that, it's a cool app; especially the close button handler: didn't know you could do that in Python. This is the case in Qt, but not in...
by openBrain
Sun Apr 18, 2021 10:12 am
Forum: Python scripting and macros
Topic: How do we simulate a double-click in the tree view?
Replies: 12
Views: 551

Re: How do we simulate a double-click in the tree view?

Thanks. I am a little confused. The DoubleClick method doesn't execute when double-clicking an object in a 3D scene? Thus, how can I execute it? Thanks. You can't. FreeCAD offers no way to catch an action on the 3D view for a scripted object. You should provide with your object a mechanism that wou...

Go to advanced search