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!

NX6 jpeg default directory 1

Status
Not open for further replies.

jerry1423

Mechanical
Aug 19, 2005
3,428
The default location for a jpeg image is the ugii directory.
Is there way to change that location to something else?
I have looked as many places as I could think of, including the customer defaults, and cannot find where to change it.
 
Replies continue below

Recommended for you

For what purpose? Import? Export? UI?

Mark Rief
Product Manager
Siemens PLM
 
To export.
I want to make a macro that saves pictures at differnt angles of several versions of designs that we have.
There will be well over 300 pictures total. The macro I have now only saves them to ugii.
The difficulty in creating the macro is being able to specify what directory the macro puts them in - but when I need to change the directory I may put the path name in a text file and have the macro read it from there.
 
Here is a quick journal to get you started. It outputs each of the saved views to a jpeg in the specified directory.

Code:
[COLOR=blue]Option[/color] [COLOR=blue]Strict[/color] [COLOR=blue]Off[/color]  
[COLOR=blue]Imports[/color] System  
[COLOR=blue]Imports[/color] System.IO  
[COLOR=blue]Imports[/color] NXOpen  
[COLOR=blue]Imports[/color] NXOpen.UF  

[COLOR=blue]Module[/color] Module1  

    [COLOR=blue]Sub[/color] Main()  

        [COLOR=blue]Dim[/color] theSession [COLOR=blue]As[/color] Session [COLOR=blue]=[/color] Session.GetSession()  
        [COLOR=blue]Dim[/color] ufs [COLOR=blue]As[/color] UFSession [COLOR=blue]=[/color] UFSession.GetUFSession()  
        [COLOR=blue]Dim[/color] workPart [COLOR=blue]As[/color] Part [COLOR=blue]=[/color] theSession.Parts.Work  
        [COLOR=blue]Dim[/color] partName [COLOR=blue]As[/color] [COLOR=blue]String[/color] [COLOR=blue]=[/color] Path.GetFileNameWithoutExtension(workPart.FullPath)  

 [COLOR=green]'directory to output jpegs, change as needed[/color]
        [highlight #FCE94F][COLOR=blue]Dim[/color] outputDirectory [COLOR=blue]As[/color] [COLOR=blue]String[/color] [COLOR=blue]=[/color] "C:\temp"[/highlight]  
        [COLOR=blue]Dim[/color] strPartJpg [COLOR=blue]As[/color] [COLOR=blue]String[/color] [COLOR=blue]=[/color] ""  

        [COLOR=blue]If[/color] [COLOR=blue]Not[/color] Directory.Exists(outputDirectory) [COLOR=blue]Then[/color]  
            MsgBox("The specified directory does [COLOR=blue]not[/color] exist, journal will now exit", MsgBoxStyle.Exclamation, outputDirectory [COLOR=blue]&[/color] " [COLOR=blue]not[/color] found")  
            [COLOR=blue]Exit[/color] [COLOR=blue]Sub[/color]  
        End [COLOR=blue]If[/color]  

        [COLOR=blue]Dim[/color] wpModelingView [COLOR=blue]As[/color] ModelingView  
        [COLOR=blue]For[/color] [COLOR=blue]Each[/color] wpModelingView [COLOR=blue]In[/color] workPart.ModelingViews  
            workPart.Views.WorkView.Orient(wpModelingView.Name, View.ScaleAdjustment.Fit)  
            strPartJpg [COLOR=blue]=[/color] partName [COLOR=blue]&[/color] "_" [COLOR=blue]&[/color] wpModelingView.Name [COLOR=blue]&[/color] ".jpg"  
            strPartJpg [COLOR=blue]=[/color] Path.Combine(outputDirectory, strPartJpg)  
            ufs.Disp.CreateImage(strPartJpg, UFDisp.ImageFormat.Jpeg, UFDisp.BackgroundColor.White)  
        [COLOR=blue]Next[/color]  


    End [COLOR=blue]Sub[/color]  


    [COLOR=blue]Public[/color] [COLOR=blue]Function[/color] GetUnloadOption(ByVal dummy [COLOR=blue]As[/color] [COLOR=blue]String[/color]) [COLOR=blue]As[/color] [COLOR=blue]Integer[/color]  

 [COLOR=green]'Unloads the image when the NX session terminates[/color]
        GetUnloadOption [COLOR=blue]=[/color] NXOpen.Session.LibraryUnloadOption.AtTermination  

    End [COLOR=blue]Function[/color]  

End [COLOR=blue]Module[/color]

Change the highlighted line to point to the directory of your choice.
If this is along the lines of what you are looking for, we can improve it with the features you need.

www.nxjournaling.com
 
There is an old feature / function to set up a html template to document models and assemblies. In that template one can define how a number of screenshots should be taken. It will ootb then create a html page, and create the needed screenshots.
I think the product was called UG / Webexpress some 10-15 years ago. I think it's available under file - export - author HTML.
What one need to do is edit a ".htt" ( The html template) to set the image preferences.

Regards,
Tomas
 
Hi Cowski,

Is there any way to add these JPEG shots to an HTML or a PDF file directly?

If you have 50 views, is a nightmare to organize them properly...

Thanks.
 
Something along the lines of this?

Code:
[COLOR=green]'NXJournaling.com[/color]
[COLOR=green]'March 21, 2012[/color]
[COLOR=green]'Journal purpose: export shaded model views to a pdf file[/color]
[COLOR=green]'  the journal creates an "A" or "A4" size sheet for each model view, places[/color]
[COLOR=green]'  the view on the sheet and scales it to fit. The journal then exports all[/color]
[COLOR=green]'  the sheets to the specified pdf file[/color]

[COLOR=blue]Option[/color] [COLOR=blue]Strict[/color] [COLOR=blue]Off[/color]  
[COLOR=blue]Imports[/color] System  
[COLOR=blue]Imports[/color] System.IO  
[COLOR=blue]Imports[/color] System.Windows.Forms  
[COLOR=blue]Imports[/color] System.Collections  
[COLOR=blue]Imports[/color] NXOpen  

[COLOR=blue]Module[/color] Export_Shaded_pdf  

    [COLOR=blue]Dim[/color] theSession [COLOR=blue]As[/color] Session [COLOR=blue]=[/color] Session.GetSession()  
    [COLOR=blue]Dim[/color] workPart [COLOR=blue]As[/color] Part [COLOR=blue]=[/color] theSession.Parts.Work  
    [COLOR=blue]Dim[/color] ufs [COLOR=blue]As[/color] UF.UFSession [COLOR=blue]=[/color] UF.UFSession.GetUFSession()  

    [COLOR=blue]Dim[/color] pdfSheets [COLOR=blue]As[/color] [COLOR=blue]New[/color] ArrayList  

    [COLOR=blue]Sub[/color] Main()  

        [COLOR=blue]Dim[/color] markId1 [COLOR=blue]As[/color] Session.UndoMarkId  
        markId1 [COLOR=blue]=[/color] theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start")  
        theSession.SetUndoMarkName(markId1, "pdf_sheets")  

        [COLOR=blue]Dim[/color] pdfSheet [COLOR=blue]As[/color] Drawings.DrawingSheet  
        [COLOR=blue]Dim[/color] outputFileName(1) [COLOR=blue]As[/color] [COLOR=blue]String[/color]  
        [COLOR=blue]Dim[/color] pdfFile [COLOR=blue]As[/color] [COLOR=blue]String[/color]  

        [COLOR=blue]Dim[/color] wpModelingView [COLOR=blue]As[/color] ModelingView  
        [COLOR=blue]For[/color] [COLOR=blue]Each[/color] wpModelingView [COLOR=blue]In[/color] workPart.ModelingViews  
 [COLOR=green]'create new sheet for view[/color]
            pdfSheet [COLOR=blue]=[/color] CreateSheet()  
            pdfSheet.SetName(wpModelingView.Name)  
 [COLOR=green]'add view to new sheet[/color]
            AddView(wpModelingView, pdfSheet)  
            pdfSheets.Add(pdfSheet)  
        [COLOR=blue]Next[/color]  

        outputFileName(0) [COLOR=blue]=[/color] OutputPath()  
        outputFileName(1) [COLOR=blue]=[/color] Path.GetFileNameWithoutExtension(workPart.FullPath) [COLOR=blue]&[/color] ".pdf"  
        pdfFile [COLOR=blue]=[/color] Path.Combine(outputFileName(0), outputFileName(1))  

        [COLOR=blue]If[/color] My.Computer.FileSystem.FileExists(pdfFile) [COLOR=blue]Then[/color]  
            My.Computer.FileSystem.DeleteFile(pdfFile)  
        End [COLOR=blue]If[/color]  

 [COLOR=green]'output new sheets to pdf[/color]
        [COLOR=blue]Try[/color]  
            [COLOR=blue]Call[/color] CreatePDF(pdfFile)  
        [COLOR=blue]Catch[/color] ex [COLOR=blue]As[/color] UnauthorizedAccessException  
            MessageBox.Show("You [COLOR=blue]do[/color] [COLOR=blue]not[/color] have permission [COLOR=blue]to[/color] write [COLOR=blue]to[/color] this directory", "PDF file creation error", MessageBoxButtons.OK, MessageBoxIcon.Error)  
        [COLOR=blue]Catch[/color] ex [COLOR=blue]As[/color] ApplicationException  
            MessageBox.Show(ex.Message, "PDF file creation error", MessageBoxButtons.OK, MessageBoxIcon.Error)  
        End [COLOR=blue]Try[/color]  

 [COLOR=green]'optional: delete pdf sheets[/color]
        [COLOR=blue]Dim[/color] markId2 [COLOR=blue]As[/color] Session.UndoMarkId  
        markId2 [COLOR=blue]=[/color] theSession.SetUndoMark(Session.MarkVisibility.Visible, "Delete")  

        [COLOR=blue]Dim[/color] objects1(pdfSheets.Count [COLOR=blue]-[/color] 1) [COLOR=blue]As[/color] NXObject  
        [COLOR=blue]For[/color] i [COLOR=blue]As[/color] [COLOR=blue]Integer[/color] [COLOR=blue]=[/color] 0 [COLOR=blue]To[/color] pdfSheets.Count [COLOR=blue]-[/color] 1  
            objects1(i) [COLOR=blue]=[/color] pdfSheets.Item(i)  
        [COLOR=blue]Next[/color]  
        pdfSheets.Clear()  

        [COLOR=blue]Dim[/color] nErrs1 [COLOR=blue]As[/color] [COLOR=blue]Integer[/color]  
        nErrs1 [COLOR=blue]=[/color] theSession.UpdateManager.AddToDeleteList(objects1)  

        [COLOR=blue]Dim[/color] notifyOnDelete2 [COLOR=blue]As[/color] [COLOR=blue]Boolean[/color]  
        notifyOnDelete2 [COLOR=blue]=[/color] theSession.Preferences.Modeling.NotifyOnDelete  

        [COLOR=blue]Dim[/color] nErrs2 [COLOR=blue]As[/color] [COLOR=blue]Integer[/color]  
        nErrs2 [COLOR=blue]=[/color] theSession.UpdateManager.DoUpdate(markId2)  


    End [COLOR=blue]Sub[/color]  

    [COLOR=blue]Public[/color] [COLOR=blue]Function[/color] CreateSheet() [COLOR=blue]As[/color] Drawings.DrawingSheet  
 [COLOR=green]' ----------------------------------------------[/color]
 [COLOR=green]'   Menu: Insert->Sheet...[/color]
 [COLOR=green]' ----------------------------------------------[/color]

 [COLOR=green]'Dim markId1 As Session.UndoMarkId[/color]
 [COLOR=green]'markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start")[/color]

        [COLOR=blue]Dim[/color] nullDrawings_DrawingSheet [COLOR=blue]As[/color] Drawings.DrawingSheet [COLOR=blue]=[/color] [COLOR=blue]Nothing[/color]  

        [COLOR=blue]Dim[/color] drawingSheetBuilder1 [COLOR=blue]As[/color] Drawings.DrawingSheetBuilder  
        drawingSheetBuilder1 [COLOR=blue]=[/color] workPart.DrawingSheets.DrawingSheetBuilder(nullDrawings_DrawingSheet)  

        drawingSheetBuilder1.Option [COLOR=blue]=[/color] Drawings.DrawingSheetBuilder.SheetOption.StandardSize  
 [COLOR=green]'start with 1:1 scale sheet, view will be scaled to fit later[/color]
        drawingSheetBuilder1.ScaleNumerator [COLOR=blue]=[/color] 1.0  
        drawingSheetBuilder1.ScaleDenominator [COLOR=blue]=[/color] 1.0  

        [COLOR=blue]If[/color] workPart.PartUnits [COLOR=blue]=[/color] Part.Units.Inches [COLOR=blue]Then[/color]  
            drawingSheetBuilder1.Units [COLOR=blue]=[/color] Drawings.DrawingSheetBuilder.SheetUnits.English  
 [COLOR=green]'insert standard letter size sheet[/color]
            drawingSheetBuilder1.Height [COLOR=blue]=[/color] 8.5  
            drawingSheetBuilder1.Length [COLOR=blue]=[/color] 11.0  
[COLOR=blue]Else[/color]  [COLOR=green]'metric unit file[/color]
            drawingSheetBuilder1.Units [COLOR=blue]=[/color] Drawings.DrawingSheetBuilder.SheetUnits.Metric  
 [COLOR=green]'insert standard A4 size sheet[/color]
            drawingSheetBuilder1.Height [COLOR=blue]=[/color] 210  
            drawingSheetBuilder1.Length [COLOR=blue]=[/color] 297  
        End [COLOR=blue]If[/color]  

 [COLOR=green]'sheetLength = drawingSheetBuilder1.Length[/color]
 [COLOR=green]'sheetHeight = drawingSheetBuilder1.Height[/color]

        drawingSheetBuilder1.ProjectionAngle [COLOR=blue]=[/color] Drawings.DrawingSheetBuilder.SheetProjectionAngle.Third  

        [COLOR=blue]Dim[/color] pdfSheet [COLOR=blue]As[/color] Drawings.DrawingSheet  
        pdfSheet [COLOR=blue]=[/color] drawingSheetBuilder1.Commit()  

 [COLOR=green]'theSession.SetUndoMarkName(markId1, "##01Sheet")[/color]

        drawingSheetBuilder1.Destroy()  

        [COLOR=blue]Return[/color] pdfSheet  

    End [COLOR=blue]Function[/color]  

    [COLOR=blue]Public[/color] [COLOR=blue]Sub[/color] AddView(ByVal view [COLOR=blue]As[/color] ModelingView, [COLOR=blue]ByVal[/color] sheet [COLOR=blue]As[/color] Drawings.DrawingSheet)  
 [COLOR=green]' ----------------------------------------------[/color]
 [COLOR=green]'   Menu: Insert->View->Base...[/color]
 [COLOR=green]' ----------------------------------------------[/color]
 [COLOR=green]'Dim markId3 As Session.UndoMarkId[/color]
 [COLOR=green]'markId3 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start")[/color]

        sheet.Open()  

        [COLOR=blue]Dim[/color] nullDrawings_BaseView [COLOR=blue]As[/color] Drawings.BaseView [COLOR=blue]=[/color] [COLOR=blue]Nothing[/color]  

        [COLOR=blue]Dim[/color] baseViewBuilder1 [COLOR=blue]As[/color] Drawings.BaseViewBuilder  
        baseViewBuilder1 [COLOR=blue]=[/color] workPart.DraftingViews.CreateBaseViewBuilder(nullDrawings_BaseView)  

        baseViewBuilder1.SelectModelView.SelectedView [COLOR=blue]=[/color] view  

 [COLOR=green]'theSession.SetUndoMarkName(markId3, "Base View Dialog")[/color]

        baseViewBuilder1.Style.ViewStyleBase.Part [COLOR=blue]=[/color] workPart  

        baseViewBuilder1.Style.ViewStyleBase.PartName [COLOR=blue]=[/color] workPart.FullPath  

        [COLOR=blue]Dim[/color] arrangement1 [COLOR=blue]As[/color] Assemblies.Arrangement [COLOR=blue]=[/color] workPart.ComponentAssembly.ActiveArrangement  

        baseViewBuilder1.Style.ViewStyleBase.Arrangement.SelectedArrangement [COLOR=blue]=[/color] arrangement1  

        baseViewBuilder1.Style.ViewStyleShading.RenderingStyle [COLOR=blue]=[/color] Preferences.ShadingRenderingStyleOption.FullyShaded  

 [COLOR=green]'place the view in the center of the sheet[/color]
        [COLOR=blue]Dim[/color] point1 [COLOR=blue]As[/color] Point3d [COLOR=blue]=[/color] [COLOR=blue]New[/color] Point3d(sheet.Length [COLOR=blue]/[/color] 2, sheet.Height [COLOR=blue]/[/color] 2, 0.0)  
        baseViewBuilder1.Placement.Placement.SetValue(Nothing, workPart.Views.WorkView, point1)  

        [COLOR=blue]Dim[/color] baseView1 [COLOR=blue]As[/color] Drawings.BaseView  
        baseView1 [COLOR=blue]=[/color] baseViewBuilder1.Commit()  

 [COLOR=green]'theSession.SetUndoMarkName(markId3, "Base View")[/color]

        [COLOR=blue]Dim[/color] viewSize(3) [COLOR=blue]As[/color] [COLOR=blue]Double[/color]  
 [COLOR=green]'retrieve the size of the view[/color]
        ufs.Draw.AskViewBorders(baseView1.Tag, viewSize)  
        [COLOR=blue]Dim[/color] viewLength [COLOR=blue]As[/color] [COLOR=blue]Double[/color] [COLOR=blue]=[/color] viewSize(2) [COLOR=blue]-[/color] viewSize(0)  
        [COLOR=blue]Dim[/color] viewHeight [COLOR=blue]As[/color] [COLOR=blue]Double[/color] [COLOR=blue]=[/color] viewSize(3) [COLOR=blue]-[/color] viewSize(1)  

 [COLOR=green]'change scale of view so that it fits on 90% of the selected sheet size[/color]
        baseView1.Style.General.Scale [COLOR=blue]=[/color] Math.Min((sheet.Length [COLOR=blue]*[/color] 0.9) [COLOR=blue]/[/color] viewLength, (sheet.Height [COLOR=blue]*[/color] 0.9) [COLOR=blue]/[/color] viewHeight)  

        baseView1.Commit()  

        baseViewBuilder1.Destroy()  

    End [COLOR=blue]Sub[/color]  

    [COLOR=blue]Public[/color] [COLOR=blue]Sub[/color] CreatePDF(ByVal outputFile [COLOR=blue]As[/color] [COLOR=blue]String[/color])  
        [COLOR=blue]Dim[/color] printPDFBuilder1 [COLOR=blue]As[/color] PrintPDFBuilder  

        printPDFBuilder1 [COLOR=blue]=[/color] workPart.PlotManager.CreatePrintPdfbuilder()  
        printPDFBuilder1.Scale [COLOR=blue]=[/color] 1.0  
        printPDFBuilder1.Action [COLOR=blue]=[/color] PrintPDFBuilder.ActionOption.Native  
        printPDFBuilder1.Colors [COLOR=blue]=[/color] PrintPDFBuilder.Color.BlackOnWhite  
        printPDFBuilder1.Size [COLOR=blue]=[/color] PrintPDFBuilder.SizeOption.ScaleFactor  
        printPDFBuilder1.Units [COLOR=blue]=[/color] workPart.PartUnits  
 [COLOR=green]'If units = 0 Then[/color]
 [COLOR=green]'    printPDFBuilder1.Units = PrintPDFBuilder.UnitsOption.English[/color]
 [COLOR=green]'Else[/color]
 [COLOR=green]'    printPDFBuilder1.Units = PrintPDFBuilder.UnitsOption.Metric[/color]
 [COLOR=green]'End If[/color]
        printPDFBuilder1.XDimension [COLOR=blue]=[/color] pdfSheets.Item(1).Height  
        printPDFBuilder1.YDimension [COLOR=blue]=[/color] pdfSheets.Item(1).Length  
        printPDFBuilder1.OutputText [COLOR=blue]=[/color] PrintPDFBuilder.OutputTextOption.Polylines  
        printPDFBuilder1.RasterImages [COLOR=blue]=[/color] [COLOR=blue]True[/color]  
        printPDFBuilder1.ImageResolution [COLOR=blue]=[/color] PrintPDFBuilder.ImageResolutionOption.Medium  
        printPDFBuilder1.Append [COLOR=blue]=[/color] [COLOR=blue]True[/color]  
        printPDFBuilder1.AddWatermark [COLOR=blue]=[/color] [COLOR=blue]False[/color]  

        [COLOR=blue]Dim[/color] sheets1(pdfSheets.Count [COLOR=blue]-[/color] 1) [COLOR=blue]As[/color] NXObject  
 [COLOR=green]'Dim drawingSheet1 As Drawings.DrawingSheet = CType(dwg, Drawings.DrawingSheet)[/color]
        [COLOR=blue]For[/color] i [COLOR=blue]As[/color] [COLOR=blue]Integer[/color] [COLOR=blue]=[/color] 0 [COLOR=blue]To[/color] pdfSheets.Count [COLOR=blue]-[/color] 1  
            sheets1(i) [COLOR=blue]=[/color] pdfSheets.Item(i)  
        [COLOR=blue]Next[/color]  

 [COLOR=green]'sheets1(0) = drawingSheet1[/color]
        printPDFBuilder1.SourceBuilder.SetSheets(sheets1)  

        printPDFBuilder1.Filename [COLOR=blue]=[/color] outputFile  
 [COLOR=green]'printPDFBuilder1.Filename = "C:\Temp\test.pdf"[/color]

        [COLOR=blue]Dim[/color] nXObject1 [COLOR=blue]As[/color] NXObject  
        nXObject1 [COLOR=blue]=[/color] printPDFBuilder1.Commit()  

        printPDFBuilder1.Destroy()  

    End [COLOR=blue]Sub[/color]  

    [COLOR=blue]Function[/color] OutputPath()  
 [COLOR=green]'Requires:[/color]
 [COLOR=green]'    Imports System.IO[/color]
 [COLOR=green]'    Imports System.Windows.Forms[/color]
 [COLOR=green]'if the user presses OK on the dialog box, the chosen path is returned[/color]
 [COLOR=green]'if the user presses cancel on the dialog box, 0 is returned[/color]

        [COLOR=blue]Dim[/color] strLastPath [COLOR=blue]As[/color] [COLOR=blue]String[/color]  
        [COLOR=blue]Dim[/color] strOutputPath [COLOR=blue]As[/color] [COLOR=blue]String[/color]  

 [COLOR=green]'Key will show up in HKEY_CURRENT_USER\Software\VB and VBA Program Settings[/color]
        [COLOR=blue]Try[/color]  
 [COLOR=green]'Get the last path used from the registry[/color]
            strLastPath [COLOR=blue]=[/color] GetSetting("NX journal", "Export pdf", "ExportPath")  
 [COLOR=green]'msgbox("Last Path: " & strLastPath)[/color]
        [COLOR=blue]Catch[/color] e [COLOR=blue]As[/color] ArgumentException  
        [COLOR=blue]Catch[/color] e [COLOR=blue]As[/color] Exception  
            msgbox(e.GetType.ToString)  
        [COLOR=blue]Finally[/color]  
        End [COLOR=blue]Try[/color]  

        [COLOR=blue]Dim[/color] FolderBrowserDialog1 [COLOR=blue]As[/color] [COLOR=blue]New[/color] FolderBrowserDialog  

 [COLOR=green]' Then use the following code to create the Dialog window[/color]
 [COLOR=green]' Change the .SelectedPath property to the default location[/color]
        [COLOR=blue]With[/color] FolderBrowserDialog1  
 [COLOR=green]' Desktop is the root folder in the dialog.[/color]
            .RootFolder [COLOR=blue]=[/color] Environment.SpecialFolder.Desktop  
 [COLOR=green]' Select the D:\home directory on entry.[/color]
            [COLOR=blue]If[/color] Directory.Exists(strLastPath) [COLOR=blue]Then[/color]  
                .SelectedPath [COLOR=blue]=[/color] strLastPath  
            [COLOR=blue]Else[/color]  
                .SelectedPath [COLOR=blue]=[/color] Environment.SpecialFolder.MyDocuments  
            End [COLOR=blue]If[/color]  
 [COLOR=green]' Prompt the user with a custom message.[/color]
            .Description [COLOR=blue]=[/color] "Select the directory to export .pdf file"  
            [COLOR=blue]If[/color] .ShowDialog [COLOR=blue]=[/color] DialogResult.OK [COLOR=blue]Then[/color]  
 [COLOR=green]' Display the selected folder if the user clicked on the OK button.[/color]
                OutputPath [COLOR=blue]=[/color] .SelectedPath  
 [COLOR=green]' save the output folder path in the registry for use on next run[/color]
                SaveSetting("NX journal", "Export pdf", "ExportPath", .SelectedPath)  
            [COLOR=blue]Else[/color]  
 [COLOR=green]'user pressed 'cancel', exit the subroutine[/color]
                OutputPath [COLOR=blue]=[/color] 0  
            End [COLOR=blue]If[/color]  
        End [COLOR=blue]With[/color]  

    End [COLOR=blue]Function[/color]  


    [COLOR=blue]Public[/color] [COLOR=blue]Function[/color] GetUnloadOption(ByVal dummy [COLOR=blue]As[/color] [COLOR=blue]String[/color]) [COLOR=blue]As[/color] [COLOR=blue]Integer[/color]  

 [COLOR=green]'Unloads the image when the NX session terminates[/color]
        GetUnloadOption [COLOR=blue]=[/color] NXOpen.Session.LibraryUnloadOption.AtTermination  

    End [COLOR=blue]Function[/color]  

End [COLOR=blue]Module[/color]


www.nxjournaling.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor