Modifying property regions

Forums NastPad Discussions Regular Expressions Modifying property regions

  • This topic has 0 replies, 1 voice, and was last updated July 24, 2017 by admin.
Viewing 0 reply threads
  • Author
    Posts
    • #223
      admin
      Keymaster

      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:
      NastPad Search Cards modify Nastran property IDs with element ID list

      • This topic was modified 7 years ago by admin.
Viewing 0 reply threads
  • You must be logged in to reply to this topic.