×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

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

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

(OP)
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

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

Quote (CNSZU)

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

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

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources