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

Do someone know how to use this method without using visual studio

Do someone know how to use this method without using visual studio

Do someone know how to use this method without using visual studio

Do someone know how to use this method without using visual studio ?
using only nx journal

Thank you.

CODE -->

'In Visual Studio, you basically include this module in your project. You also include the
' .dlx file in your project and set the build action for the .dlx to "Embedded Resource".
' You make a small modification to the definition of the .dlx filename
' in your block styler code and the tool take care of the rest.
'The function writeDlxResourceToTemp() loops through all of the resources
' in your project looking for a .dlx. When it finds it, it writes a copy
' to UGII_TMP_DIR, then returns the path to the file that it just wrote.
'File is attached. Full instructions are commented in the file and copied
' in the code block below (note that EmbedddedDLX_BS should be
' replaced with the name of your Block Styler Dialog):
'Embedded_DLX.vb - Embed DLX file into application .dll
'  History: 
'    18-Oct-2014 / Jim Bernard / created / NX 8.5
'  Description:
'    This function will write a .dlx file contained in a project as an embedded
'    resource to a temporary directory. The resulting filename is set as a
'    global variable to be used when a .dll loads a block styler dialog.
'    This provides a custom fully qualified name for the .dlx file on any
'    machine that the NX Open .dll is executed on, regardless of the location
'    (pathname) of the .dll. This removes the requirement that the .dlx file
'    be distributed with the .dll and that the .dlx file must reside in a
'    UGII application folder.
'  Instructions:
'    1) Add Embedded_DLX.vb to your Visual Studio project
'    2) Add the .dlx file to your Visual Studio project
'         - Set the Build Action to "Embedded Resource"
'    3) Modify the dlx filename definition in your block styler code
'             theDlxFileName = "xyz_BS.dlx"
'             If IO.File.Exists(tempDlxFile) Then theDlxFileName = tempDlxFile
'    4) Add the following lines to your application code to write the temporary
'         .dlx file prior to launching the dialog and to delete the temporary
'         .dlx file prior to termination
'             Sub Main()
'                 tempDlxFile = writeDlxResourceToTemp()
'                 EmbeddedDLX_BS.Main()
'                 IO.File.Delete(tempDlxFile)
'             End Sub
'  Known Issues:
Option Strict Off
Imports System
Imports System.IO
Imports System.Reflection

Imports NXOpen

Module Embedded_DLX

    Public tempDlxFile As String = Nothing

    Function writeDlxResourceToTemp() As String


            Dim dlxResourceName As String = Nothing

            For Each resourceItem As String In Assembly.GetExecutingAssembly.GetManifestResourceNames
                If resourceItem.ToLower.EndsWith(".dlx") Then
                    dlxResourceName = resourceItem
                End If
            Next resourceItem

            Dim tempSysPath As String = IO.Path.GetTempPath
            Dim tempNxPath As String = theSession.GetEnvironmentVariableValue("UGII_TMP_DIR")
            Dim tempDlxFile As String = IO.Path.Combine(tempNxPath, dlxResourceName)

            Using DLXStream As Stream = New FileStream(tempDlxFile, FileMode.Create)


            End Using

            Return tempDlxFile

        Catch ex As Exception
            theNXMessageBox.Show("writeDlxResourceToTemp", NXMessageBox.DialogType.Error, ex.ToString)
        End Try

        Return Nothing

    End Function

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! Already a Member? Login


White Paper - Strategies to Secure Connected Cars with Firewalls
White-hat hackers have demonstrated gaining remote access to dashboard functions and transmissions of connected vehicles. That makes a firewall a vital component of a multilayered approach to vehicle security as well as overall vehicle safety and reliability. Learn strategies to secure with firewalls. Download Now
White Paper - Model Based Engineering for Wire Harness Manufacturing
As complexity rises, current harness manufacturing methods are struggling to keep pace due to manual data exchanges and the inability to capture tribal knowledge. A model-based wire harness manufacturing engineering flow automates data exchange and captures tribal knowledge through design rules to help harness manufacturers improve harness quality and boost efficiency. Download Now
White Paper - What is Generative Design and Why Do You Need It?
Engineers are being asked to produce more sophisticated designs under a perfect storm of complexity, cost, and change management pressures. Generative design empowers automotive design teams to navigate this storm by employing automation, data re-use and synchronization, and framing design in the context of a full vehicle platform. Download Now
eBook - Simulation-Driven Design with SOLIDWORKS
Simulation-driven design can reduce the time and cost of product development. In this engineering.com eBook, we’ll explore how SOLIDWORKS users can access simulation-driven design through the SOLIDWORKS Simulation suite of analysis tools. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close