3D Design

3D Design

Topics related to Ansys Discovery and Ansys SpaceClaim.

How to add a CustomProperty (Component / Document) in Scripting

    • herman
      Subscriber

      I'm able to check if a custom property  is present. But how to add a custom component property and a document component property in Python Scripting?

        if not document.CustomProperties.ContainsKey("KeyName"):
              document.CustomProperties.Add("KeyName", "TEST")

      gives an error, though Add pops up in intellicense.

    • Subashni Ravichandran
      Forum Moderator

      Hello Herman Moors

      Are you using Discovery SpaceClaim or the new Discovery?

    • herman
      Subscriber

      Hello Subashni

      I'am using Spaceclaim

    • Subashni Ravichandran
      Forum Moderator

      Hello Herman Moors

      Let me check with my team and get back to you.

    • Subashni Ravichandran
      Forum Moderator

      Hello Herman Moors

      The commands in the screenshot shared should work with API 21.2 version.

      Is there any specific property you are looking to add? Please let me know what properties you would like so that I can check with my team on the specific code for that.

Viewing 4 reply threads
  • The topic ‘How to add a CustomProperty (Component / Document) in Scripting’ is closed to new replies.