|
[Sponsors] |
November 14, 2018, 05:43 |
ANs Scripting with base.collectEntities
|
#1 |
New Member
kishan Dholariya
Join Date: Nov 2018
Location: Ingolstadt
Posts: 2
Rep Power: 0 |
I want to Show the particular node numbers, that numbers I know.
there is error in my code. TypeError: CollectEntities: argument 2 must be an iterable of ANSA objects. here is my code ansa.base.SetCurrentDeck(constants.NASTRAN) base.All() base.Invert() grids = base.CollectEntities(constants.NASTRAN, inc_gridlist1, "GRID") base.Or(grids) base.Neighb("ALL") whatshould be on the secondplace in base.collectentities ? what is object in ANSA? Last edited by Kdhol; November 14, 2018 at 12:19. |
|
November 17, 2018, 08:32 |
|
#2 |
New Member
Join Date: Sep 2016
Posts: 9
Rep Power: 10 |
Hi Kdhol,
The second object in the CollectEntities function is the container from which ANSA will search to find the type of entities you are looking for. You have two options to pass: (1) "None" which will tell ANSA to search the entire domain or (2) a list of ANSA objects/entities to search from. See below for some examples. For example, to find all "GRID" entities in the domain. The second object would be None: Code:
all_grids = ansa.base.CollectEntities(ansa.constants.NASTRAN, None, "GRID") Code:
shells = [shell_1, shell_2, ..., shell_n] # List of SHELL entities, possibly gathered using the "CollectEntities" function shell_grids = ansa.base.CollectEntities(ansa.constants.NASTRAN, shells, "GRID") Alex |
|
November 19, 2018, 08:45 |
Collecting Nodes using ANSA script
|
#3 |
Member
Mahmoud Aboukhedr
Join Date: Feb 2014
Location: London
Posts: 40
Rep Power: 12 |
Hello,
If I understand correctly, you have a list of Nodes, and you want to show only this nodes using a script. You will not be able to show only the (Nodes), but you will be able to show only the (faces that carry this node). So for example, if you have a list of two nodes for example (135, 141) You can use this the script below to collect the nodes, then show only the nodes, which will give you the faces at which this node belongs. Code:
nodeID = [135,141] % list of nodes nodeID_1 = [] % empty list for ID in nodeID: % collect the nodes in the empty list nodeID_1.append(base.GetEntity(constants.NASTRAN, "GRID", ID)) for i in nodeID_1: % print full information about the collected nodes print(i) % show only the collected nodes base.Or(i) MA |
|
Tags |
collecctentities |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro scripting in netbeans, importing star libraries | laurensvd | STAR-CCM+ | 3 | October 31, 2020 23:06 |
[ANSYS Meshing] Need help with selection of edges using scripting | studentzz | ANSYS Meshing & Geometry | 1 | March 5, 2017 17:49 |
Glyph Scripting Origin | pdp.aero | Pointwise & Gridgen | 3 | July 9, 2015 17:57 |
record actions via scripting | Marabelle | ANSYS | 0 | July 31, 2013 12:57 |
[DesignModeler] change import by scripting | dragonwei | ANSYS Meshing & Geometry | 0 | September 17, 2012 06:08 |