Inserting Tabular data using python script:Can’t assign to read-only property Inputs of type ‘Field’
-
-
March 24, 2021 at 7:05 am
prakhars962
SubscriberI was trying to insert a tabular data for displacement as follows:nSlMn = ExtAPI.SelectionManagernSlMn.ClearSelection()nSel = SlMn.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)ndisp=DataModel.AnalysisList[0].AddDisplacement()nSel.Ids=[25] # ID 25 is an edgendisp.Location=Selndisp.XComponent.Output.DefinitionType=VariableDefinitionType.Discretendisp.YComponent.Output.DefinitionType=VariableDefinitionType.Discretendisp.ZComponent.Output.DefinitionType=VariableDefinitionType.Discretendisp.YComponent.Inputs=[Quantity('0 [sec]'),Quantity('0.1[sec]'),Quantity('0.2 [sec]'),Quantity('1[sec]')]nI am getting this error:ncan't assign to read-only property Inputs of type 'Field'nnI was using the same syntax prescribed for forces in the ANSYS ACT developer guide. How can a tabular data be read-only if I can manually input values in the table?nIs there anything wrong with my code? Also, I have tried the tree children method (disp=Model.Analyses[0].Children[5]). This gives the same error.n -
March 24, 2021 at 7:55 am
Erik Kostson
Ansys EmployeeHinnThis link shows how to do it for a convection load, but the same principle there can be applied to any load so AddDisplacement(), AddForce, etc.nnDear Ansys Learning Forum Team,I am writing an Iron Python script on Ansys Mechanical for a thermal problem.When a convection load is created (A), in order to define the Film coefficient (, I need to perform a click on the dropdown list and then, I can select the Tabular option (C). (See attached figure).However, if I want to automatize this task, I can not do it manually. Therefore, my question is how to define a film coefficient table by command line? (i.e. to perform task (C) ).Any suggestion will be appreciated.Best regards,Ramiro M.Ps: After reading the Ansys ACT manual, it saysField Convection.FilmCoefficient { get; }Gets the FilmCoefficient.RemarksThis property cannot be set. When one wants to change its value, one should operate on the returned Field object, either on its inputs or on its output variables .https://us.v-cdn.net/6032193/uploads/T3H9BDTUA69B/filmcoefficient.jpg:https://forum.ansys.com/discussion/26059/how-to-define-a-film-coefficient-table-by-command-line-in-ansys-mechanical
nThank younnErikn -
March 24, 2021 at 11:09 pm
-
March 25, 2021 at 7:35 am
Erik Kostson
Ansys EmployeeHinnYes, I see, there is no such option.nnIf we assign it like I showed , then we can have it as constant via our tabular values or ramped (as needed).nnSo that is the workaround - i think we can close this discussion now - but if you have any other questions, then feel free to open up a new discussion.nnAll the bestnnErik
-
- You must be logged in to reply to this topic.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Saving & sharing of Working project files in .wbpz format
- An Unknown error occurred during solution. Check the Solver Output…..
- Understanding Force Convergence Solution Output
- Solver Pivot Warning in Beam Element Model
- Colors and Mesh Display
- How to calculate the residual stress on a coating by Vickers indentation?
- whether have the difference between using contact and target bodies
- What is the difference between bonded contact region and fixed joint
- The solver engine was unable to converge on a solution for the nonlinear problem as constrained.
- User manual
-
2524
-
2066
-
1279
-
1096
-
457
© 2023 Copyright ANSYS, Inc. All rights reserved.