-
-
November 3, 2020 at 4:22 pm
julius.langenhorst
SubscriberHello,nThe model I'm working on consists of a composite fabric that is placed in 0? and 90? direction in a stackup. The ModelingPly uses this stackup as ply material and 'Internal Draping' is activated.nI would like to run a parameter study in which one of the parameters is supposed to be the drape angle (a.k.a. shear angle a.k.a. the value that is shown in the legend after creating a Draping Mesh Plot). If I try to create a parameter in ACP I do not find the option for using this specific value. I tried using 'Expression Output' with this code:nmodel = db.active_modelnresult=model.mesh_query(name='draped_fiber_directions',position='nodal',selection='all',simulate=True)nreturn_value = resultnNeedless to say, it did not work. Do you have a better idea on how to extract the drape angle? Or at least why my solution is not working? Let me know if you need further information.nThank you!n -
November 5, 2020 at 2:36 pm
julius.langenhorst
SubscriberI found a solution to get the shear angle in a specific area. I changed the example code found in the Parameters' section of the ACP User Guide:n# Get active modelnmodel = db.active_modeln# Create new selection of all elements attached to a specific plynmodeling_ply = model.modeling_groups['ModelingGroup.1'].plies['ModelingPly.1']nmodel.select_elements(selection='sel10',op='new',attached_to=[modeling_ply])n# Get total shear angle of the first entity of selection sel0nshear_angles = list(model.mesh_query(name='angles',position='centroid',selection='sel10',entities=[modeling_ply],component='shear')[0])n# Get maximum shear anglenmax_shear_angle = max(shear_angles)n# Pass the found maximum shear angle as the script's result.nreturn_value = max_shear_anglenWhile it's great that I solved this problem, I don't quite understand what is happening as I'm not familiar with Python. nWhat does selection='sel10' stand for? Why can't it be changed to e.g. selection='all' (following error message:Failed to convert all to selection set enum. Must be of type 'selX'.) nWhy is the returned max shear angle not the same as shown in the legend of my draping mesh plot (38.93 and 44.83)?nIs it possible to create a list of all shear angles in the model?nBest Regards!n -
November 12, 2020 at 2:06 pm
Govindan Nagappan
Ansys EmployeenThe selection parameter is an object which is used in the backend to create and store the selection. selection='sel10' means that the current selection is stored as sel10. If you query some data, then you need to pass the name of the selection. If selection is `all`, then the backend selects all elements. So if selection is`all`, then you can skip the first command model.select_elements and directly execute the mesh_query command. The select_elements is needed to ensure that the mesh query only returns the values for the elements which are covered by the ply.n nIn your case:n#select all element of modeling_ply and store it under selection `sel10`nmodel.select_elements(selection='sel10',op='new',attached_to=[modeling_ply])n#query data from a certain selection (here shear angles of a modeling ply using selection object `sel10`)n model.mesh_query(name='angles',position='centroid',selection='sel10',entities=[modeling_ply],component='shear')n nAlternative (and easier to understand)nInstead of using model.select_elements and model.mesh_query, you can use plot objects and use their get_data methodn n#create angle plotnplot=db.active_model.layup_plots.create_angle_plot() nplot.component = 'shear' # set the componentnplot.color_table.auto_upper_value = Truenplot.color_table.upper_value = 90.0nplot.color_table.auto_lower_value = Truenplot.update()nplot.get_data(selected=modeling_ply) # returns the shear angles of a certain plynn n n -
November 14, 2020 at 8:11 pm
julius.langenhorst
SubscriberThanks for Your answer! nBut since get_data returns a n-dimensional array I can not use it as a parameter, right? Besides, everytime I change something in the code it creates a new layup plot called angle.X, that is supposed to happen?nIn any case, I found a different solution by writing a small python script that stores the angle in a .txt file. It is not an automated process but better than nothing.n
-
Viewing 3 reply threads
- The topic ‘How to parameterize the drape angle in ACP?’ is closed to new replies.
Ansys Innovation Space
Trending discussions
- The legend values are not changing.
- LPBF Simulation of dissimilar materials in ANSYS mechanical (Thermal Transient)
- Convergence error in modal analysis
- How to model a bimodular material in Mechanical
- APDL, memory, solid
- Meaning of the error
- Simulate a fan on the end of shaft
- Real Life Example of a non-symmetric eigenvalue problem
- Nonlinear load cases combinations
- How can the results of Pressures and Motions for all elements be obtained?
Top Contributors
-
3977
-
1461
-
1272
-
1124
-
1015
Top Rated Tags
© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.