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
ErKo
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:/forum/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
ErKo
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
-
- The topic ‘Inserting Tabular data using python script:Can’t assign to read-only property Inputs of type ‘Field’’ is closed to new replies.
-
6625
-
1906
-
1469
-
1311
-
1022
© 2026 Copyright ANSYS, Inc. All rights reserved.
