    

 ## On this page

  

 

 # EnSightService

 Last update: 16.07.2025 

<a id="details" name="details"></a>## Detailed Description

The remote EnSight command and control functions provided by the EnSight core. They provide access to the EnSight Python interpreter, scene geometry (via glTF blobs), the generated image stream and the internal event queue. Custom, special purpose interfaces exist for other applications. Most of these calls require the complete attention of the EnSight core to perform their operations and thus will block until the EnSight core becomes available. Calls that do not block in this fashion are marked "(non-blocking)" in their description.

## Function Documentation

<a id="ga571dc2c8bebe8c38e011cb4f3a3d5b0d" name="ga571dc2c8bebe8c38e011cb4f3a3d5b0d"></a>## [◆ ](#ga571dc2c8bebe8c38e011cb4f3a3d5b0d)AnimQueryProgress()

 rpc ensightservice::EnSightService::AnimQueryProgress  ( [AnimQueryProgressRequest](structensightservice_1_1_anim_query_progress_request.xhtml)  *animqueryprogressrequest*) 

An interface to query the progress an animation being saved

Returns[AnimQueryProgressReply](structensightservice_1_1_anim_query_progress_reply.xhtml) describing progress toward completion Definition at line [114](ensight_8proto_source.xhtml#l00114) of file [ensight.proto](ensight_8proto_source.xhtml).





<a id="ga9235533bdc45ad02be7cbed281eaca37" name="ga9235533bdc45ad02be7cbed281eaca37"></a>## [◆ ](#ga9235533bdc45ad02be7cbed281eaca37)AnimSave()

 rpc ensightservice::EnSightService::AnimSave  ( [AnimSaveRequest](structensightservice_1_1_anim_save_request.xhtml)  *animsaverequest*) 

An interface to save an image or animation

Returns[AnimSaveReply](structensightservice_1_1_anim_save_reply.xhtml)Definition at line [110](ensight_8proto_source.xhtml#l00110) of file [ensight.proto](ensight_8proto_source.xhtml).





<a id="gaa5a89ed87c59689f8be8dbfa474323d4" name="gaa5a89ed87c59689f8be8dbfa474323d4"></a>## [◆ ](#gaa5a89ed87c59689f8be8dbfa474323d4)Exit()

 rpc ensightservice::EnSightService::Exit  ( [ExitRequest](structensightservice_1_1_exit_request.xhtml)  *exitrequest*) 

Shutdown EnSight session

Returns[ExitReply](structensightservice_1_1_exit_reply.xhtml) an acknowledgment from the EnSight server Definition at line [52](ensight_8proto_source.xhtml#l00052) of file [ensight.proto](ensight_8proto_source.xhtml).





<a id="gab64a0bc516588def314e022736cc1dcc" name="gab64a0bc516588def314e022736cc1dcc"></a>## [◆ ](#gab64a0bc516588def314e022736cc1dcc)GetEventStream()

 rpc ensightservice::EnSightService::GetEventStream  ( [EventStreamRequest](structensightservice_1_1_event_stream_request.xhtml)  *eventstreamrequest*) 

Enable a filtered stream of callback events from the EnSight session (non-blocking)

EnSight supports a callback registration system that can associate a callback with with any attribute change in the client. This is the ensight.objs.addcallback() Python call. For example:

ensight.objs.addcallback(ensight.objs.core, None, prefix+"PARTLIST\_CHANGED",

 attrs=['PARTS'], flags=ensight.objs.EVENTMAP_FLAG_COMP_GLOBAL)



 will register a callback event associated with any changes in the ensight.objs.core.PARTS attribute. When this happens, EnSight will emit an event with the string "prefix+'PARTLIST\_CHANGED'". The gRPC interface enables a stream of these event strings to be returned to the calling application in [EventReply](structensightservice_1_1_event_reply.xhtml) messages. It also provides a simple prefix filter, so that only messages that start with the specific prefix will be returned on the event stream. This prefix is passed in the [EventStreamRequest](structensightservice_1_1_event_stream_request.xhtml) message.

Returns[EventReply](structensightservice_1_1_event_reply.xhtml) a stream of [EventReply](structensightservice_1_1_event_reply.xhtml) messages for each emitted event Definition at line [70](ensight_8proto_source.xhtml#l00070) of file [ensight.proto](ensight_8proto_source.xhtml).





<a id="gafa5fd7a25231c0b93591f681c3679d3b" name="gafa5fd7a25231c0b93591f681c3679d3b"></a>## [◆ ](#gafa5fd7a25231c0b93591f681c3679d3b)GetGeometry()

 rpc ensightservice::EnSightService::GetGeometry  ( [GeometryRequest](structensightservice_1_1_geometry_request.xhtml)  *geometryrequest*) 

Return current scene geometry representation

Returns[GeometryReply](structensightservice_1_1_geometry_reply.xhtml) the current scene geometry in glTF format Definition at line [48](ensight_8proto_source.xhtml#l00048) of file [ensight.proto](ensight_8proto_source.xhtml).





<a id="gaec3249209f41b4042cd2c24ba7f11024" name="gaec3249209f41b4042cd2c24ba7f11024"></a>## [◆ ](#gaec3249209f41b4042cd2c24ba7f11024)GetImageStream()

 rpc ensightservice::EnSightService::GetImageStream  ( [ImageStreamRequest](structensightservice_1_1_image_stream_request.xhtml)  *imagestreamrequest*) 

Enable a stream of rendered images from the EnSight session (non-blocking)

A stream of the images rendered by EnSight.

Returns[ImageReply](structensightservice_1_1_image_reply.xhtml "An image frame message.") a stream of [ImageReply](structensightservice_1_1_image_reply.xhtml "An image frame message.") messages for each image rendered Definition at line [106](ensight_8proto_source.xhtml#l00106) of file [ensight.proto](ensight_8proto_source.xhtml).





<a id="gadf6500961c95cd701020e5c8d2005138" name="gadf6500961c95cd701020e5c8d2005138"></a>## [◆ ](#gadf6500961c95cd701020e5c8d2005138)RenderImage()

 rpc ensightservice::EnSightService::RenderImage  ( [RenderRequest](structensightservice_1_1_render_request.xhtml)  *renderrequest*) 

Render an image of the current scene

Returns[RenderReply](structensightservice_1_1_render_reply.xhtml) the rendered image Definition at line [44](ensight_8proto_source.xhtml#l00044) of file [ensight.proto](ensight_8proto_source.xhtml).





<a id="ga73690c0e3495951863406e26dd7f906b" name="ga73690c0e3495951863406e26dd7f906b"></a>## [◆ ](#ga73690c0e3495951863406e26dd7f906b)RunPython()

 rpc ensightservice::EnSightService::RunPython  ( [PythonRequest](structensightservice_1_1_python_request.xhtml)  *pythonrequest*) 

Run a Python command string in the EnSight Python interpreter

Returns[PythonReply](structensightservice_1_1_python_reply.xhtml) the result of the string Definition at line [40](ensight_8proto_source.xhtml#l00040) of file [ensight.proto](ensight_8proto_source.xhtml).





<a id="gab466da93dfd6027a2a6dbe5df6902189" name="gab466da93dfd6027a2a6dbe5df6902189"></a>## [◆ ](#gab466da93dfd6027a2a6dbe5df6902189)SubscribeEvents()

 rpc ensightservice::EnSightService::SubscribeEvents  ( [SubscribeEventOptions](structensightservice_1_1_subscribe_event_options.xhtml)  *subscribeeventoptions*) 

Subscribe to the EnSight event stream via reverse gRPC connection (non-blocking)

Some gRPC clients have demonstrated problems maintaining a continuous [EventReply](structensightservice_1_1_event_reply.xhtml) stream. For these clients, it is possible for the client to reverse the gRPC connection so EnSight will make gRPC calls back to the client. In this case, the client application will start an [EnSightSubscription](group___en_sight_subscription.xhtml) service and inform EnSight of how to connect to it via [SubscribeEventOptions](structensightservice_1_1_subscribe_event_options.xhtml). EnSight will then make PublishEvent calls with the [EventReply](structensightservice_1_1_event_reply.xhtml) messages it would have used in the [GetEventStream()](group___en_sight_service.xhtml#gab64a0bc516588def314e022736cc1dcc) configuration.

Definition at line [81](ensight_8proto_source.xhtml#l00081) of file [ensight.proto](ensight_8proto_source.xhtml).





<a id="ga6295c516b8a271034e9ee785991c2e7b" name="ga6295c516b8a271034e9ee785991c2e7b"></a>## [◆ ](#ga6295c516b8a271034e9ee785991c2e7b)SubscribeImages()

 rpc ensightservice::EnSightService::SubscribeImages  ( [SubscribeImageOptions](structensightservice_1_1_subscribe_image_options.xhtml)  *subscribeimageoptions*) 

Subscribe to the EnSight image stream via reverse gRPC connection (non-blocking)

Some gRPC clients have demonstrated problems maintaining a continuous [ImageReply](structensightservice_1_1_image_reply.xhtml "An image frame message.") stream. For these clients, it is possible for the client to reverse the gRPC connection so EnSight will make gRPC calls back to the client. In this case, the client application will start an [EnSightSubscription](group___en_sight_subscription.xhtml) service and inform EnSight of how to connect to it via [SubscribeImageOptions](structensightservice_1_1_subscribe_image_options.xhtml). EnSight will then make PublishImage calls with a short lived (single image frame) [ImageReply](structensightservice_1_1_image_reply.xhtml "An image frame message.") message stream it would have used in the [GetEventStream()](group___en_sight_service.xhtml#gab64a0bc516588def314e022736cc1dcc) configuration. EnSight will make a separate PublishImage call for every frame of imagery it generates.

Definition at line [93](ensight_8proto_source.xhtml#l00093) of file [ensight.proto](ensight_8proto_source.xhtml).





<a id="ga9161e678fe3d7608820907269d55bf8c" name="ga9161e678fe3d7608820907269d55bf8c"></a>## [◆ ](#ga9161e678fe3d7608820907269d55bf8c)Unsubscribe()

 rpc ensightservice::EnSightService::Unsubscribe  ( [Prefix](structensightservice_1_1_prefix.xhtml)  *prefix*) 

Discontinue a previous established stream subscription (non-blocking)

This call will cause EnSight to stop making gRPC calls to the client gRPC server associated with the prefix string. It can be used to stop a [SubscribeEvents()](group___en_sight_service.xhtml#gab466da93dfd6027a2a6dbe5df6902189) or [SubscribeImages()](group___en_sight_service.xhtml#ga6295c516b8a271034e9ee785991c2e7b) call.

Definition at line [100](ensight_8proto_source.xhtml#l00100) of file [ensight.proto](ensight_8proto_source.xhtml).





## <a id="func-members" name="func-members"></a>Functions

rpc [ensightservice::EnSightService::RunPython](group___en_sight_service.xhtml#ga73690c0e3495951863406e26dd7f906b) ([PythonRequest](structensightservice_1_1_python_request.xhtml) pythonrequest) returns([PythonReply](structensightservice_1_1_python_reply.xhtml)) rpc [ensightservice::EnSightService::RenderImage](group___en_sight_service.xhtml#gadf6500961c95cd701020e5c8d2005138) ([RenderRequest](structensightservice_1_1_render_request.xhtml) renderrequest) returns([RenderReply](structensightservice_1_1_render_reply.xhtml)) rpc [ensightservice::EnSightService::GetGeometry](group___en_sight_service.xhtml#gafa5fd7a25231c0b93591f681c3679d3b) ([GeometryRequest](structensightservice_1_1_geometry_request.xhtml) geometryrequest) returns([GeometryReply](structensightservice_1_1_geometry_reply.xhtml)) rpc [ensightservice::EnSightService::Exit](group___en_sight_service.xhtml#gaa5a89ed87c59689f8be8dbfa474323d4) ([ExitRequest](structensightservice_1_1_exit_request.xhtml) exitrequest) returns([ExitReply](structensightservice_1_1_exit_reply.xhtml)) rpc [ensightservice::EnSightService::GetEventStream](group___en_sight_service.xhtml#gab64a0bc516588def314e022736cc1dcc) ([EventStreamRequest](structensightservice_1_1_event_stream_request.xhtml) eventstreamrequest) returns(stream [EventReply](structensightservice_1_1_event_reply.xhtml)) rpc [ensightservice::EnSightService::SubscribeEvents](group___en_sight_service.xhtml#gab466da93dfd6027a2a6dbe5df6902189) ([SubscribeEventOptions](structensightservice_1_1_subscribe_event_options.xhtml) subscribeeventoptions) returns([GenericResponse](structensightservice_1_1_generic_response.xhtml)) rpc [ensightservice::EnSightService::SubscribeImages](group___en_sight_service.xhtml#ga6295c516b8a271034e9ee785991c2e7b) ([SubscribeImageOptions](structensightservice_1_1_subscribe_image_options.xhtml) subscribeimageoptions) returns([GenericResponse](structensightservice_1_1_generic_response.xhtml)) rpc [ensightservice::EnSightService::Unsubscribe](group___en_sight_service.xhtml#ga9161e678fe3d7608820907269d55bf8c) ([Prefix](structensightservice_1_1_prefix.xhtml) prefix) returns([GenericResponse](structensightservice_1_1_generic_response.xhtml)) rpc [ensightservice::EnSightService::GetImageStream](group___en_sight_service.xhtml#gaec3249209f41b4042cd2c24ba7f11024) ([ImageStreamRequest](structensightservice_1_1_image_stream_request.xhtml) imagestreamrequest) returns(stream [ImageReply](structensightservice_1_1_image_reply.xhtml)) rpc [ensightservice::EnSightService::AnimSave](group___en_sight_service.xhtml#ga9235533bdc45ad02be7cbed281eaca37) ([AnimSaveRequest](structensightservice_1_1_anim_save_request.xhtml) animsaverequest) returns([AnimSaveReply](structensightservice_1_1_anim_save_reply.xhtml)) rpc [ensightservice::EnSightService::AnimQueryProgress](group___en_sight_service.xhtml#ga571dc2c8bebe8c38e011cb4f3a3d5b0d) ([AnimQueryProgressRequest](structensightservice_1_1_anim_query_progress_request.xhtml) animqueryprogressrequest) returns([AnimQueryProgressReply](structensightservice_1_1_anim_query_progress_reply.xhtml))