pythonocc-core icon indicating copy to clipboard operation
pythonocc-core copied to clipboard

How to select multiple edges at the same time?

Open Abhinav-Anil opened this issue 5 years ago • 1 comments

I am unable to select multiple lines on the step files at the same time. If I select the first edge then the second edge, then the first edge would disappear and therefore I'm not able to do parallel line geometries type work.

pythonocc version - 0.17.3 python - 3.7

please help/guide me @tpaviot

Abhinav-Anil avatar Sep 29 '20 09:09 Abhinav-Anil

list_edge=[]# list of edge
def line_clicked(shp, *kwargs):
    """ This function is called whenever a line is selected
    """
    for shape in shp:  # this should be a TopoDS_Edge
        print("Edge selected: ", shape)
        e = topods_Edge(shape)
        list_edge.append(e)
        if len(list_edge)==2:#control edge number
            pass
            am = AIS_AngleDimension(list_edge[0], list_edge[1])
            display.Context.Display(am, True)
            list_edge.clear()



context.Display(ais_shape,True)
context.SetTransparency(ais_shape, 0, True)
owner = ais_shape.GetOwner()
display.register_select_callback(line_clicked)


start_display()



context.Display(ais_shape,True)
context.SetTransparency(ais_shape, 0, True)
owner = ais_shape.GetOwner()
display.SetSelectionModeEdge() # switch to edge selection mode
display.register_select_callback(line_clicked)


start_display()

qunat avatar Nov 25 '20 02:11 qunat