Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Journal: Check "File.Exist" in NX with TC

Status
Not open for further replies.

MANox

Mechanical
Apr 2, 2007
121
Hey everybody,

I want open drawing in NX with TC, using journal.
vb said:
basePart1 = theSession.Parts.OpenActiveDisplay("@DB\" & workPart.GetStringAttribute("DB_PART_NO") & "\" & workPart.GetStringAttribute("DB_PART_REV") & "\specification\" & workPart.GetStringAttribute("DB_PART_NO") & "_dwg", NXOpen.DisplayPartOption.AllowAdditional, partLoadStatus1)
status1 = Nothing
status1 = theSession.Parts.SetActiveDisplay(basePart1, NXOpen.DisplayPartOption.AllowAdditional, NXOpen.PartDisplayPartWorkPartOption.UseLast, partLoadStatus1)
workPart = theSession.Parts.Work
displayPart = theSession.Parts.Display
partLoadStatus1.Dispose()
This part of code works very well.

First I want check is drawing file exist.
In native mode I used
Code:
If File.Exist("file_name_with_extension")Then...
Maybe somebody know command with I can use in TC?

Best regards

MANok
NX12&TC10
 
Replies continue below

Recommended for you

One possible solution would be to wrap the call to SetActiveDisplay in a Try block. If the file doesn't exist, it should throw a specific error that you can catch.

www.nxjournaling.com
 
Thanks cowski,

You are The Best...

Best regards

MANok
NX12&TC10
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor