Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

GRIP setting for directory variable 1

Status
Not open for further replies.

gergs

Computer
Joined
Aug 20, 2004
Messages
94
Location
US
Hey guys,

See code below. I want to open a part from a directory by reading a system variable in GRIP. This ones yakking. Any ideas???

I can use this structure in other areas to map to a directory. But GRIP doesnt like it. It cant find the path to open he part. I want to be able to read a standard directory on an NT machine that may be on different drives for each users machine when it loads. Im using the UG install right now but may change. Problem is it wont read this to start with.

Thanks!!!



NUMBER/RSP
STRING/PNAM(80)
DATA/PNAM,'${UGII_BASE_DIR}\mypart.prt'

CHOOSE/'Start seed Part',$
'Exit',$
'Continue',$
DEFLT,1,RSP
JUMP/EXIT:,EXIT:,,,EXIT:,GO:,RSP
$$____________________________________________________________________

GO:

print/PNAM

FETCH/PART,PNAM
$$_____________________________________________________________________
EXIT:
HALT
 
You need to tell UG what the environment variable is set to. GRIP doesn't know how to read them directly.

part_dir = envvar/ugii_base_dir,ask

pnam = part_dir + '\mypart.prt'


We defined a system environment variable for the directory separator (/ or\) depending on if the system was Unix or Windows. Then we did this in our programs:
dir_del=envvar/'IR_DELIM',ask
partnam=part_dir+dir_del+'mypart.prt'





"Wildfires are dangerous, hard to control, and economically catastrophic."
"Fixed in the next release" should replace "Product First" as the PTC slogan.

Ben Loosli
CAD/CAM System Analyst
Ingersoll-Rand
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top