It is often desirable to modify the property of a selection of elements in a Nastran model. Pre-processors can make light work of this task, but if you want to do it directly to the bulk data files, then it can be cumbersome and often requires some sort of script.
Using the enhanced regular expressions in NastPad, this can be achieved with a simple find/replace operation. For example, to modify the property ID of a selection of CQUAD4 or CTRIA3 elements, you can use the following:
Find what: ^(CQUAD4 |CTRIA3 )(?<x>~check_id('x', '100:120:2 153 197')~.{8}).{8}
Replace with: \1\2~put_int(71)~
This will replace the property ID in field 3 with ’71’ for the even element ID’s between 100 and 120, and additional elements 153 and 197.
This sort of expression can actually be constructed automatically by NastPad by using the “Search Cards” tab in the Search dialog. Below is a screenshot of the inputs to achieve the same result:
-
This topic was modified 7 years ago by admin.