Grip Question
Grip Question
(OP)
Hi Everyone
I use the below in a program to cycle thru components in an assembly and write the file names to a text file. My problem is a do loop is only good for 1000 labels and many of my assemblies are well over that. Can someone tell me how to write all the names of every component and not miss any ? This may be easy for some of you but I am a hacker at the best of times and any help would be appreciated.
Thanks
Bob Smith
CREATE/TXT, 2
inexte/all
mask/63
DO/D900:,i,1,900
comps(i) = nexte/ifend,a10:
names(i) = &name(comps(i))
print/ names(i)
WRITE/2, names(i)
D900:
I use the below in a program to cycle thru components in an assembly and write the file names to a text file. My problem is a do loop is only good for 1000 labels and many of my assemblies are well over that. Can someone tell me how to write all the names of every component and not miss any ? This may be easy for some of you but I am a hacker at the best of times and any help would be appreciated.
Thanks
Bob Smith
CREATE/TXT, 2
inexte/all
mask/63
DO/D900:,i,1,900
comps(i) = nexte/ifend,a10:
names(i) = &name(comps(i))
print/ names(i)
WRITE/2, names(i)
D900:





RE: Grip Question
You could also check if the name was already written to the file so you only get unique file names.
"Wildfires are dangerous, hard to control, and economically catastrophic."
Ben Loosli
Sr IS Technologist
L-3 Communications
RE: Grip Question
CREATE/TXT, 2
inexte/all
mask/63
L001:
comps(i) = nexte/ifend,END1:
names(i) = &name(comps(i))
print/ names(i)
WRITE/2, names(i)
JUMP/L001:
END1:
This will continue to 'loop' until you reach the last component and then it will jump to END1: and you're out of the 'loop'.
John R. Baker, P.E.
Product 'Evangelist'
NX Product Line
UGS Corp
Cypress, CA
http://www.ugs.com
RE: Grip Question
I knew someone would give me the correct path to follow. Like I said I'm more of a hacker than a programmer I appreciate it.
Bob Smith
RE: Grip Question
I changed the program below is what i changed it to with the declarations
STRING/names(3000,100) $$ part names used in loop
ENTITY/comps(3000) $$ number of components
NUMBER/i $$ used in loop
CREATE/TXT, 2
inexte/all
mask/63 $$comps only
D90: $$loop for all comp names
comps(i) = nexte/ifend,a9:
names(i) = &name(comps(i))
print/ names(i)
WRITE/2, names(i) $$write names to file
JUMP/D90:
a9:
when i run the program i get the error "subscript of an array is out of range" what did I do wrong here? again any help would be greatly appreciated
RE: Grip Question
RE: Grip Question
Bob