General Mechanical

General Mechanical

How Can I Create Python Input Parameter for Ansys ACP Module

    • GorkemKarasu
      Subscriber

      Hi,

      I'm using python script to run Ansys ACP module in Workbench. I want to create input parameters directly using this code and make optimization but I couldn’t create input parameter with python code.

      If anyone can help me, I would appreciate it?

    • utkukaanc
      Subscriber
      Hello I was looking for the same answer.
      I wrote a python code which returns the required inputs to feed ACP Pre Module. There are some variables in the python code which I need to access from Workbench in order to use DesignXplorer. However, Workbench cannot read the variables from the python script. Therefore, I cannot connect the ACP Pre Module to optimization modules.
      I am looking for a solution where the variables in the python script can be accessed from workbench and connected to optimization modules.
      Thanks.
    • erayvardar
      Subscriber
      Hi I have same problem!
      I'm using Ansys ACP module for composite structure modeling and I have python script for model creationin ACP. I want to make optimization with ACP but I didn't create input parameter from python to ACP. How can I solve this problem, could you answer please?
    • Belliveau18
      Subscriber
      Hi GorkemKarasu Since Workbench does not read the variables included into the ACP python script there is not any direct method to create parameter using the ACP python scripting. However, your python script can create parameter inside of the ACP app. Which can then be used inside of workbench and used in design optimization. Here is an example code to add the fabric thickness as a parameter :
      myModel=db.models['ACPModel']
      #Definetheparameter
      myModel.create_published_parameter(name='Parameter.1')
      #Nametheparameter
      myModel.parameters['Parameter.1'].name='Fabric.1.thickness'
      #Parameterobject
      myModel.parameters['Fabric.1.thickness'].source_object=myModel.material_data.fabrics['Fabric.1']
      #Property
      myModel.parameters['Fabric.1.thickness'].source_property='thickness'
      #Parameterdatatype
      myModel.parameters['Fabric.1.thickness'].acp_type='float'
Viewing 3 reply threads
  • You must be logged in to reply to this topic.