Object Pick

The object_pick() function requests for the user to select an object in the running application. When you click on an object, its ObjectID is returned to the Python script. This provides you an intuitive way to select an object. The following example shows how to query the path and type name for the picked object.

from mapteksdk.pointstudio.operations import object_pick, write_report
from mapteksdk.project import Project
 
project = Project()
 
oid = object_pick()
 
path = oid.path
type_name = oid.type_name
 
write_report("Object pick", f"The object at {path} is a {type_name}")