|
[Sponsors] |
July 7, 2020, 08:11 |
Mesh slected Areas using Python-script?
|
#1 |
New Member
Join Date: Jul 2020
Posts: 3
Rep Power: 6 |
Dear Community,
iīm new to Ansa Scripting (Python) and need to find a way that meshes selected Areas seperatly on a whole model - in this Case for example a part from a motorengine. after running the existing Batch mesher, there are a lot of small areas that should be finer-meshed. To Avoid, that our engineers have to spent one whole day to mesh them finer manually, we Need a script. The idea is, that the user can select some Areas and the script is meshing them finer without changing the non-selected Areas. It would be great if the user is able to set the Parameters by himself (ex: if there is an angle of 90 Degree, he wants 3 rows) Unfortunetly i didnīt find a solution anywhere. Thankīs a lot for your help in Advance! |
|
July 8, 2020, 03:54 |
|
#2 |
Member
Maries
Join Date: Mar 2010
Location: Cologne, Germany
Posts: 75
Rep Power: 16 |
Hi,
There is no need of python script for this. Batchmesher is itself capable of doing this. In the batch mesher parameter setting use the feature handler option and set right row numbers based on your fillet radius. I remember there is a tutorial for batch meshing in ansa tutorial folder. You can refer that for further info Best Regards Maries |
|
July 8, 2020, 04:33 |
|
#3 | |
New Member
Join Date: Jul 2020
Posts: 3
Rep Power: 6 |
Quote:
Hi Maries, Yes we are using it Right now and most of the time it does itīs Job well but on some Areas not, thats why we Need to mesh them manually or run a script for a finer mesh on the selected Areas. Is there a better solution? Thanks in Advance! |
||
July 8, 2020, 06:57 |
|
#4 |
Member
Maries
Join Date: Mar 2010
Location: Cologne, Germany
Posts: 75
Rep Power: 16 |
Yes that is possible.
Code:
IsolateRadius, BETA PYTHON development Manual NAME: IsolateRadius - Isolates all the faces based on a given radius limit. SYNOPSIS: ansa.base.IsolateRadius(radius) Named Arguments DESCRIPTION: This function isolates on the screen all the faces based on a given radius limit. Arguments radius float The radius limit to isolate the faces. |
|
July 10, 2020, 05:36 |
|
#5 | ||
New Member
Join Date: Jul 2020
Posts: 3
Rep Power: 6 |
Thanks for your help!
is it also possible to mesh selected Fillets ? For now, iīm using this code: Quote:
The result is like : Quote:
The entitiy._id is equal to the id of the selected Fillet in the Feature Manager. How can i change Values here or mesh them seperatly by using an other mesh-param-file? |
|||
August 20, 2020, 01:05 |
|
#6 |
New Member
RAJALINGAM MANICKAM
Join Date: Mar 2018
Location: Hyderabad
Posts: 3
Rep Power: 8 |
Hi,
You can add collected fillet faces to the batch mesh scenario by using below API, for this you have to save one separate meshing scenario. SYNOPSIS: ansa.batchmesh.AddPartToMeshingScenario(INPUT_ref, SCENARIO_ref) DESCRIPTION: This function adds an item or an array of items (part, group, property or volume) to a batch mesh scenario. ARGUMENTS: [required] INPUT_ref object References the item to be added to the senario. The type of the item may be a part, group, property or volume. [required] SCENARIO_ref object References the senario. The senario's type must be in accordance to the type of the item. Regards, Rajalingam. M Last edited by MRAJALIN; August 20, 2020 at 02:12. |
|
November 2, 2020, 11:59 |
Similar issue with scripting
|
#7 |
New Member
Michael
Join Date: Nov 2020
Posts: 1
Rep Power: 0 |
Hello every one,
I am encountering a problem very similar to yours. In order to automate a rather long process, I'm scripting the generation of layers on Ansa. However, I'm encountering a problem, and I'm afraid it will be difficult to solve, as I have the impression that some functions are missing in Ansa scripting... My problem is the following: I want to assign different names to my layers from a python script using ansa scripting, and these layers must be in the same layers generation session because they share common boundaries, so I can't put them in separate sessions, otherwise they don't connect properly when building layers. So I want to: - Create a session: batchmesh.GetNewLayersSession() - Add the PID I want to mesh: batchmesh.AddPartToSession() - Read a parameter map: batchmesh.ReadSessionMeshParams() - Create a certain number of Area: batchmesh.GetNewLayersArea(name_area) - Add some PIDs from my session to these areas. This is the blocking point, there is no function for that... Has anyone ever had the problem? Thank you so much, Regards, Michael |
|
December 16, 2020, 12:09 |
|
#8 |
New Member
Join Date: May 2014
Posts: 21
Rep Power: 12 |
@MikeMart:
Indeed such a function does not exist. As a workaround you could create a filter specifically for this layers area using AddFilterToSession. This function can be used for sessions and layer areas as well. Then apply the filters using DistributeAllItemsToScenarios. For example if you have a pointer to the layers area (it is returned by the GetNewLayerArea function) named area1, you can use: Code:
batchmesh.AddFilterToSession('Name', 'equals', 'SHELL_PROPERTY', area1, 'all', 'no', 'layer_area_filter_1') batchmesh.DistributeAllItemsToScenarios() Regarding layers areas, these are entities of type: 'BATCH_MESH_LAYERS_AREA'. You can use this keyword to collect them (CollectEntities). @StrawHat: You could also delete the mesh from just the faces you wish to refine and then re-run your batch mesh with the option "Freeze existing mesh". |
|
Tags |
ansa meshing, ansa scripting |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[ANSYS Meshing] Export fluent mesh via script | Nigirim | ANSYS Meshing & Geometry | 10 | March 24, 2022 06:00 |
[OpenFOAM] Using python script for automatic post processing of openFoam | vPaquet | ParaView | 12 | December 16, 2021 04:30 |
[snappyHexMesh] Snappyhex mesh: poor inlet mesh | Swagga5aur | OpenFOAM Meshing & Mesh Conversion | 1 | December 3, 2016 17:59 |
Star CCM Overset Mesh Error (Rotating Turbine) | thezack | Siemens | 7 | October 12, 2016 12:14 |
fluent add additional zones for the mesh file | SSL | FLUENT | 2 | January 26, 2008 12:55 |