We’re updating our badges platform. Badge issuance is temporarily paused, but all completions are being recorded and will be fulfilled once the platform is live. Thank you for your patience.
3D Design

3D Design

Topics related to Ansys Discovery and Ansys SpaceClaim.

What does GetRootPart do?

    • balfaro
      Subscriber

      Hi all,

       

      I am reviewing a Python script that is supposed to automatically generate geometry in SpaceClaim, and as I was going through it I noticed the line

       

      bodies = GetRootPart().Bodies

       

      I have looked through the API documentation for my versions (V19), but I cannot see this funcion anywhere. Does anyone know what it does?

    • jonl
      Subscriber

       

       

      The root part is the top level of your model and includes all components, bodies, datums and such. In your case, "bodies" is a list of all the bodies at the top level of your model (meaning any bodies within components are not included).

       

       

    • Andrew Stankovich
      Ansys Employee

       

      SpaceClaim scripting is broken up into primarily two different sections: Core API and Scripting API. The Script Editor inside SpaceClaim is configured in such a way that it may not be clear when a command is being called from the SpaceClaim.Api.Vxx namesspace or the SpaceClaim.Api.Vxx.Scripting namesspace. These aliases makes it easier to quickly write code and reuse recorded code due to the shortened naming, but it means that often times the documentation can be difficult to find for a specific alias.

      If you are using 22R2 there is now a combined chm document for the APIs at “C:\Program Files\Ansys Inc\v222\scdm\SpaceClaim.Api.V22\API_Combined_Class_Library.chm”

      If you are using an older version please search both the API_Class_Library.chm and the API_Scripting_Class_Library.chm when looking for documentation.

      The GetRootPart() function returns the reference to the top most (root) part of the currently opened document. This is explained in more detail in the Developers Guide pdf in the installation. "C:\Program Files\Ansys Inc\v222\scdm\SpaceClaim.Api.V22\Developers Guide.pdf" See image below for outline of an example of the hierarchy in SpaceClaim.

Viewing 2 reply threads
  • The topic ‘What does GetRootPart do?’ is closed to new replies.