Selecting wire vertex problem

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!
jfc4120
Posts: 448
Joined: Sat Jul 02, 2022 11:16 pm

Re: Selecting wire vertex problem

Post by jfc4120 »

Found point size under appearance. But even after making them huge, I still cannot select the vertex that has another line or wire intersecting.
User avatar
Vincent B
Veteran
Posts: 4713
Joined: Sun Apr 05, 2015 9:02 am
Location: La Rochelle, France

Re: Selecting wire vertex problem

Post by Vincent B »

Try to increasing this parameter. ;)
Attachments
Capture.JPG
Capture.JPG (69.53 KiB) Viewed 697 times
heda
Veteran
Posts: 1348
Joined: Sat Dec 12, 2015 5:49 pm

Re: Selecting wire vertex problem

Post by heda »

could it be that you are talking about a z-order thing?

fc only has the "top one from current view" selectable.

pics are with wire black points, and the line with brown points, one view is "top", the other "bottom" (points are overemphasized)
Snip macro screenshot-bf76e2.png
Snip macro screenshot-bf76e2.png (6.11 KiB) Viewed 681 times
Snip macro screenshot-027b79.png
Snip macro screenshot-027b79.png (6.67 KiB) Viewed 681 times
now, there is a way to get to the "hidden" objects
- make selection view visible
- check the "pick list" box
- select in 3d-view
- select from the list...
Snip macro screenshot-f09845.png
Snip macro screenshot-f09845.png (26.85 KiB) Viewed 681 times
edwilliams16
Veteran
Posts: 3106
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: Selecting wire vertex problem

Post by edwilliams16 »

I can pick the vertex in 'As Is' drawstyle, but not in 'Wireframe'
heda
Veteran
Posts: 1348
Joined: Sat Dec 12, 2015 5:49 pm

Re: Selecting wire vertex problem

Post by heda »

indeed, how peculiar - and annoying
jfc4120
Posts: 448
Joined: Sat Jul 02, 2022 11:16 pm

Re: Selecting wire vertex problem

Post by jfc4120 »

What's weird is, as said in wireframe exist the problem. But changing to draw style "as is" or "flat lines" allows picking the vertex.
edwilliams16
Veteran
Posts: 3106
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: Selecting wire vertex problem

Post by edwilliams16 »

Have the user pick an edge at a point close to the desired vertex, then

Code: Select all

sel, = Gui.Selection.getSelectionEx()
pp =sel.PickedPoints[0]
edge = sel.SubObjects[0]
dists = [((v.Point - pp).Length, v) for v in edge.Vertexes] 
closestVertex = dists[0][1]  if dists[0][0] < dists[1][0] else dists[1][1]
Part.show(closestVertex, 'Picked Vertex')
returns the vertex you want.
jfc4120
Posts: 448
Joined: Sat Jul 02, 2022 11:16 pm

Re: Selecting wire vertex problem

Post by jfc4120 »

@edwilliams16

That is genius, holy moly how did you learn some of this stuff.

Edit, I get:
File "C:/Users/Owner/AppData/Roaming/FreeCAD/Macro/ed_pick.FCMacro", line 15, in <module>
closestVertex = dists[0][1] if dists[0][0] < dists[1][0] else dists[1][1]
<class 'IndexError'>: list index out of range
Also I need to integrate into existing code:

Code: Select all

selX = FreeCADGui.Selection.getSelectionEx()
PrintMsg = FreeCAD.Console.PrintMessage
PrintMsg("Objects selected:\n")
KOUNT = 0
for sel in selX:
    maxname = max((len(name) for name in sel.SubElementNames)) + 4
    msg = '{:>%d}  --->  (X,Y,Z) = ({:.3f}, {:.3f}, {:.3f})\n' % maxname
    PrintMsg(f'{sel.Object.Name} ({sel.Object.Label})\n')
    for subName, p in zip(sel.SubElementNames, sel.PickedPoints):
        KOUNT = KOUNT + 1
        X = p.x * .039370078
        Y = p.y * .039370078
        Z = p.z * .039370078
        #########  More code  ############
And the other end will be selected also, 4 vertices of a face at least is selected.
Last edited by jfc4120 on Sun Aug 07, 2022 3:51 am, edited 1 time in total.
edwilliams16
Veteran
Posts: 3106
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: Selecting wire vertex problem

Post by edwilliams16 »

jfc4120 wrote: Sun Aug 07, 2022 3:24 am
Might be a useful workaround anytime you need a vertex. They are fiddly to pick even when you can pick them.
jfc4120
Posts: 448
Joined: Sat Jul 02, 2022 11:16 pm

Re: Selecting wire vertex problem

Post by jfc4120 »

Please see edit in my last reply.
Post Reply