Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

NX8 Journal Editor

Status
Not open for further replies.

NGMatt

Aerospace
Sep 11, 2013
21
Hello World,

I am new to NX journaling but not new to Visual Basic programming. Is it possible to use a different editor than the one provided? I am used to Catia and Microsoft Visual Basic for applications (VBA) and the editor provided doesn't provide stepping nor any syntax coloring of the text. Is it possible to edit code in a Microsoft Office application and invoke a "reference"? I've tried that it doesn't seem to like the "Imports System" procedure call. Any step editing outside of the journal editor would be a huge benefit. Any help would be appreciated. Thanks
 
Replies continue below

Recommended for you

Is it possible to use a different editor than the one provided?
It is not only possible, it is recommended. I suggest Microsoft's VB.net express 2010 edition because it is free and Siemens supplies 'code wizards' that work well with it. It is possible to use a more recent version but I have not been able to get Siemens' code wizards to work with them.

In the thread:
thread561-290183
FrankSwinks provides a method to enable 'stepping' through code.

Is it possible to edit code in a Microsoft Office application and invoke a "reference"?
No; MS office uses VBA, NX journaling uses VB.NET. They are different animals.



www.nxjournaling.com
 
true, vb.net is a different animal that I will have to learn. Specifically how to replicate the code I have for taking a jpg image file and creating a new powerpoint slide and inserting the picture. Its pretty basic functionality that should already exist but does not. Going from Catia to NX I'll have to learn how to make this work. I am able to create the .jpg file but now I have to figure out how to pop it into PowerPoint within the .Net framework.
 
I am still working on a function to create and save the NX current active 3D view into an image file (.jpg) that can be automatically placed into Powerpoint. But for now I still have to learn how to write the code for starting powerpoint, inserting a slide to either an open powerpoint or create a new powerpoint file, and insert the .jpg image file using VB.NET. Here is what i have so far:

Option Strict Off
Imports System
Imports System.IO
Imports NXOpen
Imports NXOpen.UF

Module Module1

Sub Main()

Dim theSession As Session = Session.GetSession()
Dim ufs As UFSession = UFSession.GetUFSession()
Dim workPart As Part = theSession.Parts.Work

Dim outputDirectory As String = "C:\temp"
Dim strPartJpg As String = ""

strPartJpg ="c:\temp\image.jpg"
ufs.Disp.CreateImage(strPartJpg, UFDisp.ImageFormat.Jpeg, UFDisp.BackgroundColor.White)

End Sub

Public Function GetUnloadOption(ByVal dummy As String) As Integer

'Unloads the image when the NX session terminates
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination

End Function

End Module

If anyone has this already written in VB.NET please let me know. Thanks

Here is the thread that has the code for the Catia version of this functionality.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor