Skip to content
Snippets Groups Projects
Commit 0ce99336 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

update example to show how multiple entities can be selected in a loop

parent 78eb2005
No related branches found
No related tags found
No related merge requests found
Pipeline #11083 passed
...@@ -199,8 +199,12 @@ def checkForEvent(): ...@@ -199,8 +199,12 @@ def checkForEvent():
# user clicked on "Some action" # user clicked on "Some action"
gmsh.onelab.setString("ONELAB/Action", [""]) gmsh.onelab.setString("ONELAB/Action", [""])
gmsh.fltk.setStatusMessage( gmsh.fltk.setStatusMessage(
"Please select an entity (or press 'q' to quit)", True) "Please select one or more curves (or press 'q' to quit)", True)
r, ent = gmsh.fltk.selectEntities() while 1:
r, ent = gmsh.fltk.selectEntities(dim=1)
print("select returned", r)
print("selected curves", ent)
if r == 0: break
if gmsh.fltk.isAvailable() == 0: return 0 if gmsh.fltk.isAvailable() == 0: return 0
if r and len(ent): if r and len(ent):
gmsh.fltk.showContextWindow(ent[0][0], ent[0][1]) gmsh.fltk.showContextWindow(ent[0][0], ent[0][1])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment