×
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

Need help for save as journal

Need help for save as journal

Need help for save as journal

(OP)
Hi,

Currently, I work with an assembly composed of family part member
I have not problem when I work on standard products, but for special products, I need to clone the assembly and family part members to do specific modification.
I can’t use cloning function to rename my assembly and parts and save it on a other directory, due to the use of family part.
Currently, I do several “save as” to do it, but it’s time consumer.

I would to do a NX journal to do it. The journal will have to :
Ask the user to choose a save directory
Ask the user a number (exemple : 145145)
Save the active assembly and the part under it in the save directory
Rename all part with the number as suffix (exemple : part_145145.prt)

I work on NX10

Could you help me to create this journal ?

Thank you
Patrice

RE: Need help for save as journal

(OP)
Hi,
I success to ask a directory, and a number to the user. And save the work part.
But, now I don't know how do this action on all the parts under the work assembly.
Could you help me, please ?

CODE --> vb

Option Strict off
Imports System
Imports NXOpen
Imports System.Windows.Forms
Imports NXOpen.UF
Imports NXOpen.Assemblies

Module Main

    Dim theSession As Session = Session.GetSession()
    Dim theUfSession As UFSession = UFSession.GetUFSession()
    Dim workPart As Part = theSession.Parts.Work
    Dim lw As ListingWindow = theSession.ListingWindow
    Public Folder as String = nothing
    Public dispPart As Part = theSession.Parts.Display

    Sub Main()


        ' ----------------------------------------------
        'demande chemin sauvegarde
        ' ----------------------------------------------
        lw.Open()

        Dim FolderBrowserDialog As FolderBrowserDialog = New FolderBrowserDialog()

        FolderBrowserDialog.SelectedPath = "C:"
        FolderBrowserDialog.Description = "Selectionner le dossier ou doivent être sauvegardé les pièce"

        If (FolderBrowserDialog.ShowDialog() <> DialogResult.OK) Then Return ' Sort si le user n'a rien indiqué
        Folder = FolderBrowserDialog.SelectedPath

        lw.WriteLine("Le directory choisi est :" & Folder)


        ' ----------------------------------------------        
        'demande numero projet
        ' ----------------------------------------------
        Dim numeroProjet As String = ""

        numeroProjet = InputBox("Enter project number", "numero projet", "")


        ' ----------------------------------------------
        '   Save As...
        ' ----------------------------------------------
        Dim partSaveStatus1 As PartSaveStatus
        Try
            partSaveStatus1 = workPart.SaveAs(Folder+"\"+workPart.Leaf+"_"+numeroProjet+".prt")
            partSaveStatus1.Dispose()
            Catch ex as Exception
        End Try


    End Sub


End Module 

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