3D Design

3D Design

Topics related to Ansys Discovery and Ansys SpaceClaim.

C# selection context

    • daniel.nouxet


      I have to verify before launch a function if a point on a cuve or on an edge is available.

      I start with the Sample exmple, PolygonMesh.cs:

      protected override void OnUpdate(Command command) {
                  command.IsEnabled = Window.ActiveWindow != null && Window.ActiveWindow.ActiveContext.SingleSelection is IDesignBody;

              protected override void OnExecute(Command command, ExecutionContext context, Rectangle buttonRect) {
                  Window window = Window.ActiveWindow;
                  if (window == null)

                  var desBody = window.ActiveContext.SingleSelection as IDesignBody;
                  if (desBody == null)

                  DesignBody desBodyMaster = desBody.Master;


      But I don't understand.

      I try to undertand thanks to theAPI, but the description are to light for me.


      Could you give me explanation ?


    • Naresh Patre
      Ansys Employee

      Hello dNouxet

      Help on API is available in the SpaceClaim_API.chm located in C:Program FilesANSYS Incv202scdmSpaceClaim.Api.V20 folder. There are some other library documents in this folder that you can check out. Other than this, I don't think there is any other documentation available.

Viewing 1 reply thread
  • The topic ‘C# selection context’ is closed to new replies.