Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

How to look for a file by searching the directories in the assembly load options? (journal) 1

Status
Not open for further replies.

CNSZU

Mechanical
Sep 2, 2005
318
Hello,

I'm trying to use a journal to check if a certain part is located in one of the directories as specified in the assembly load options.

If the load options are set to "From Folder", you can get the search directory by simply getting the full path of the root component. And if it's set to "From Search Folders", you can use

Dim pColl As PartCollection = theSession.Parts
Dim SearchDirectories() As String
Dim bool() As Boolean
pColl.LoadOptions.GetSearchDirectories(SearchDirectories, bool)

But does anyone know how to get the search directories when the assembly load options is set to "As Saved"?


NX9 Win8.1 64bit i7-3770K 16GB Quadro2000
 
Replies continue below

Recommended for you

CNSZU said:
But does anyone know how to get the search directories when the assembly load options is set to "As Saved"?

When the load option is set to "as saved", the search directories are not used.

If I understand the intent of the question, you want to determine the last known 'save location' of a component that is not yet loaded in the assembly; is this correct?

If so, you can use the AskComponentData method. The 'part_name' returned will be the path to the component as last saved in the assembly.

Alternately, you could shell out to ugpc and/or ug_edit_part_names to query and edit component references in an assembly.

www.nxjournaling.com
 
Thank you, I believe AskComponentData will get me on the right track. As for the intent of the question, what I need is a way to deduce whether the components are in the state which is defined in the "search options".

I'm writing my own STEP export dialog box which automates things like the export directory, exporting sheet bodies based on their layers, and automatic renaming of solid bodies. However I want to add another feature that checks if there will be a problem exporting some of the parts. The reason is that sometimes when I export a step file the exporter cannot find some of the components due to them not being located in the search options. However, the step file will be created fine, just that some parts are missing. The problem is that there is no way of knowing if there are parts missing in the step file unless I look carefully in the step log file. To avoid this hassle, I want a warning message to appear in the information window as I'm exporting the step file in case there are parts that are not being exported due to the parts not being found in the search options.

NX9 Win8.1 64bit i7-3770K 16GB Quadro2000
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor