Picking an entity and a point¶
Picking an entity and a point¶
1pick_info = impact.gui.picker.get_entity_and_point("Pick an entity", False)
2
3if pick_info.isNone():
4 impact.gui.output_toolbox.add("The pick was cancelled")
5else:
6
7 # Check whether an entity was picked
8 ent = pick_info.entity
9 if not ent.isNone():
10
11 # note that some entity types do not have an associated palette
12 if not ent.palette.isNone():
13 impact.gui.output_toolbox.add("Picked entity has palette: " + ent.palette.full_name)
14 impact.gui.output_toolbox.add("Picked point is: " + pick_info.point.to_string())
15