3D Design

3D Design

Topics related to Ansys Discovery and Ansys SpaceClaim.

How to delete parameters created in Space Claim?

    • henrique.geraissate
      Subscriber

      Hello everyone,

      I am trying to perform a parametric study in which each design point will change my geometry dimensions. These parameters that I want to vary were created through the Space Claim ruler dimension feature.

      What happens is, whenever I delete a parameter in Space Claim, it is NOT deleted from the parameter list in workbench. Also, if I recreate the parameter in Space Claim with the exact same name, it is duplicated in the Workbench list and I receive the following error when trying to run the simulation:

      "System.ArgumentException: An item with the same key has already been added"

      I've found a similar post here in the forum, but it is unanswered.

      Does anyone knows how could I delete this old parameters from the Workbench list?

      Thanks in advance,
      Henrique

    • peteroznewman
      Subscriber

      This thread has a solution which I copy/pasted into my reply.  I have not tried this myself.

      I found that if you go to the variable that you are using for the input parameter and then uncheck the "use as input parameter" checkbox, save the project, then go back and check the checkbox and it should clear up the unused parameter.
      I also found that in the case where you delete an expression or variable that you used as an input parameter it will not delete it from the Workbench parameters list. To get around this, remake the variable that you deleted, i.e. if you deleted a variable, that we'll call X1, that was an input parameter, remake the variable X1 but this time don't check the "use as input parameter" checkbox, save the project, and it will be deleted from your parameter list in Workbench. Then you can go back and delete the variable again.

      • henrique.geraissate
        Subscriber

        Hello Peter, thanks for your answer.

        Unfortunately, I guess that it doesn't applied to my case as in SpaceClaim you don't have this "use as input parameter" check box. It seems that, once you create the parameter in the "groups" tab, you cannot undo that action. I mean, you can delete it or even ctrl+z it, but it will be already transfered to the workbench list, from which you won't be able to remove anymore. I don't know if I am missing something though.

        Any other thoughts?

        Henrique

    • Govindan Nagappan
      Ansys Employee

      If you do not see the parameters in Spaceclaim - > groups tab, but shows up in WB parameter set, you can use script to delete the parameter

      1. In Workbench project page, Go to File -> Scripting -> Open Command Window
      2. Copy and paste the following commands and hit enter to delete the parameter

       

      p2 = Parameters.GetParameter("P2")

      parameterizedEntity = p2.GetAssociatedEntityProperties().keys()[0]

      parameterizedProperty = p2.GetAssociatedEntityProperties()[parameterizedEntity][0]

      p2.Disassociate(parameterizedEntity, parameterizedProperty)

      p2.Delete()

       

      In the commands above, we are deleting parameter named P2.

      p2 = Parameters.GetParameter("P2")

      You can change the name to delete a different parameter

      • henrique.geraissate
        Subscriber

        Dear Govindan,

        That worked just perfectly, thank you very much for sharing those commands!

        Kind regards,

        Henrique

Viewing 2 reply threads
  • The topic ‘How to delete parameters created in Space Claim?’ is closed to new replies.