Open Component Location

Hi Everyone,

Need to Open component loaded location by running the code,

Any code available???

If you have a loaded component, what exactly do you want to open? Perhaps you want to open a windows explorer to the folder that contains the component part file?

Please explain.

Yes I want to open file location in windows explorer and explorer should be pointing to that file "I mean file should be selected"

Here the problem is we are having lots of directories for standard parts so in load options search directory, we are using entire folder by using 3 dots, And some times we need to replace standard part with different variant, its being painful to search that part and locate its location, coz other variants will be in same directory from where the part is loaded.
I hope you understood the issue.

-[]-

What you want can probably be done, but I don't have any code to share at the moment. In the mean time, in the NX menu try using Information -> Part -> Loaded parts. This will generate a report of all the parts in the NX session and tell you where they are loaded from.

Here is the code but is there any faster way for this???

' NX 10.0.2.6
' Journal created by gashaik on Fri Aug 19 11:29:31 2016 India Standard Time
'
Option Strict Off
Imports System
Imports System.IO
Imports NXOpen
Imports NXOpen.Assemblies

Module NXJournal
Sub Main (ByVal args() As String)

Dim theSession As NXOpen.Session = NXOpen.Session.GetSession()
Dim workPart As NXOpen.Part = theSession.Parts.Work
Dim displayPart As NXOpen.Part = theSession.Parts.Display

Dim theUI As UI = UI.GetUI()

Dim components1(0) As NXOpen.Assemblies.Component
components1(0) = CType(theUI.SelectionManager.GetSelectedObject(0), NXOpen.Assemblies.Component)
Dim errorList1 As NXOpen.ErrorList

Dim c_part As Part = Nothing
c_part = components1(0).Prototype
Dim directory As String = Path.GetDirectoryName(c_part.FullPath)
Dim pth as string= c_part.FullPath
System.Diagnostics.Process.Start("explorer.exe", "/select," & pth)

End Sub
End Module

-[]-

Most of the time spent running this as a journal will be used up compiling the code. If you have an author license, you can compile it to a dll file and specify an "unload option" which can speed up execution of the code.

However, even running this as a journal, the windows explorer almost immediately opens on my computer. Does it take a long time on your computer, or are you just a particularly impatient person?

Well...
the person who is about to use this code is impatient,
and I'm not having Author license,

-[]-