Skip to main content
1-Visitor
March 5, 2013
Solved

Where used?

  • March 5, 2013
  • 3 replies
  • 19494 views

Is there a way to see in which assembly’s a part is being used?

I have creo parametric 2.0. I don’t seem to have PDM link what is explained in the question of Mike Minsterketter.

Best answer by JonathanHodgson

Hi Stefan,

I've written a batch file to do this. It's a little slow and sometimes returns false positives, but it works.

The key lines are:

for /r . %%9 in (.) do findstr /m /i "%1" %%9\*.asm.* >> \whereused_%1.txt

start notepad \whereused_%1.txt

I've named it whereused.bat, and it is saved in the root directory of our Pro/E data drive (Z:).

To use it we call up a command prompt and type e.g.:

z:

cd \

whereused 12345

3 replies

13-Aquamarine
March 5, 2013

Hi Stefan,

I've written a batch file to do this. It's a little slow and sometimes returns false positives, but it works.

The key lines are:

for /r . %%9 in (.) do findstr /m /i "%1" %%9\*.asm.* >> \whereused_%1.txt

start notepad \whereused_%1.txt

I've named it whereused.bat, and it is saved in the root directory of our Pro/E data drive (Z:).

To use it we call up a command prompt and type e.g.:

z:

cd \

whereused 12345

sloman1-VisitorAuthor
1-Visitor
March 6, 2013

Thanks Jonathan!

I followed your instructions and it works!

Strange that it is not possible to have a standard option in Creo for "where used". But your batch file is a good alternative.

Stefan

Dale_Rosema
23-Emerald III
23-Emerald III
March 31, 2015

Can you help me a little with the batch file, JONATHAN Hodgson?

It this something that is like an old Dos program?

Thanks, Dale

13-Aquamarine
March 31, 2015

Hi Dale,

Yes, it is indeed effectively a DOS BATch script (only I think they're called "command scripts" these days).

Basically you just create a text file (Notepad works fine) containing those lines, but with a .bat extension instead of .txt - so "whereused.bat". You could also add @echo off as the first line - echo off stops it displaying (echoing) each command it executes to the screen, and the @ stops it echoing the echo off!

Then call up a command prompt and run it as I describe above.

"for /r . %%9 in (.)": recurse (/r) through all directories starting from the current one (.) and output the directory name to %%9

"do findstr /m /i "%1" %%9\*.asm.*": look for the string "%1" (which is the part number you typed after whereused) in *.asm.* in each directory %%9, not case sensitive (/i), outputting just the filename(s) where the string was found (/m)

">> \whereused_%1.txt": and append that filename to the end of a file in the root directory of the current drive called "whereused_%1.txt"

"start notepad \whereused_%1.txt": finally, open the file in Notepad

You can get help on most commands by typing them followed by /? at a command prompt:

for /?

findstr /?

or there are several webpages around devoted to the arcana of batch file language.

Dale_Rosema
23-Emerald III
23-Emerald III
March 31, 2015

Maybe I am not getting the spacing quite right:

whereused.bat

1-Visitor
December 21, 2017

I know this is a solved topic, but i worked with my company's IT sensai's to make a batch file that we liked for this issue.  

 

The batch file is attached.  Copy it in the root of whatever drive/folder you want to search and it will come up with all files that the name you search for is used in (limited to that drive/folder).