🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Check string pattern for component label and output matching IDs to TCL console

User: "Sebastian_Karp"
Altair Employee
Updated by Sebastian_Karp

Overview

This Script will check if component labels match the string pattern that is handed over as argument by the execution pattern (see below).

If matching, Component IDs will be printed to the TCL Console.

 

Usage/Installation Instructions

Run Script

 

image

 

 

Activate TCL Console from "View" dropdown.

Enter procedure name followed by your string pattern. Wildcards can be used.

 

execution pattern examples:
IDsByName "P747500\[1-6\];*"                                   -> Matches P7475001;*-7475006;*
OR
IDsByName "2\[5-9\]\[0-9\]\[0-9\]"                             -> Matches 2500-2999
OR
IDsByName "Shell\ \[2\]\[0\]\[0\]\[0\]\[6\]\[1-9\]\[1-9\]*"    -> Matches "Shell 2000600" - "Shell 2000699"

 

The Component IDs matching the pattern will be printed to the TCL Console.

Find more posts tagged with

Share projects with the Community

Share your models, scripts, workspaces, and more with the Altair Community.
New Exchange Project