|
[Sponsors] |
ANSA_Scripting Batch mesh session and scenario |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 22, 2019, 05:51 |
ANSA_Scripting Batch mesh session and scenario
|
#1 |
New Member
Rakesh kumar
Join Date: May 2019
Location: India
Posts: 4
Rep Power: 7 |
Hi all,
I am new to Pyhon scripting, and i generated the following code to automate the batch mesh generation process by giving reference to saved mesh parameters and quality criteria files. The mesh is generated , and the specific session is running but the part is not getting allocated to the component.PFA screenshots. import os import ansa from ansa import * deck=constants.ABAQUS def main(): mesh_scen=batchmesh.GetNewMeshingScenario('New','P ARTS') session=batchmesh.GetNewSession('s1') parts = base.CollectEntities (deck, None, 'ANSAPART') batchmesh.AddPartToMeshingScenario (parts, mesh_scen) batchmesh.AddSessionToMeshingScenario(session, mesh_scen) ret_val=batchmesh.ReadSessionMeshParams(session,'D :/Rakesh/param1.ansa_mpar') ret_val2=batchmesh.ReadSessionQualityCriteria(sess ion,'D:/Rakesh/quality.ansa_qual') status = batchmesh.RunMeshingScenario(mesh_scen, 30) print(ret_val) print(ret_val2) print(status) if __name__ == '__main__': main() |
|
June 14, 2019, 09:56 |
|
#2 |
Member
Mahmoud Aboukhedr
Join Date: Feb 2014
Location: London
Posts: 40
Rep Power: 12 |
If I understand correctly, your request is to get a screenshot after running the batch mesh script. If so, you can use something similar to the code below:
Code:
status = utils.SnapShot(abs_filename_1, image_format='PNG', transparent=True) if status == 0: print('Image saved in ' + abs_filename_1) status = utils.SnapShot(abs_filename_2, red=100, green=140, blue=210, text_axes=False) if status == 0: print('Image saved in ' + abs_filename_2) |
|
June 27, 2019, 05:26 |
Mistake in Mesh criteria allocation to geometry
|
#3 |
New Member
Rakesh kumar
Join Date: May 2019
Location: India
Posts: 4
Rep Power: 7 |
My requirement is not to get the screenshot after batch meshing.
My requirement is to run the script when ever i got the job for that particular component. But after running the script ,the geometry is not getting allocated to the mesh parameters.In the meshing scenario, only mesh parametrs are showing after running this script,but not the contents( i mean geometry). In my input geometry, i am keeeping only the component that is required to mesh. The return values are only for checking whether it is executing or not. I hope no coonfusions |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|