CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ANSA (https://www.cfd-online.com/Forums/ansa/)
-   -   Ansa (https://www.cfd-online.com/Forums/ansa/227772-ansa.html)

sumpate June 9, 2020 12:21

Ansa
 
How can we check in ansa that how many times one pid is used..?? e.g. if same pid is given to 2 parts or 3 parts or more then that ?

greg.cfd October 19, 2020 06:06

Hi, you can run this script:


Code:

# PYTHON script
import os
import ansa
from ansa import *

def main():
    deck = constants.OPENFOAM
    base.BlockRedraws(True)
    pids = base.CollectEntities(deck, None, 'SHELL_PROPERTY')
    for pid in pids:
        base.Or(pid)
        vis_parts = base.CollectEntities(deck, None, 'ANSAPART', filter_visible = True)
        print('PID ', pid._id, ' is used by ', len(vis_parts), 'parts : ', ', '.join([p._name for p in vis_parts]))
    base.BlockRedraws(False)


if __name__ == '__main__':
    main()


If you don't want to use python scripting, you can show only the PID, then open the model browser (part manager) and do a box selection from the screen. The parts of that PID will be selected.


All times are GMT -4. The time now is 03:49.