cancel
Showing results for 
Search instead for 
Did you mean: 

Create Addins in Nx7.5 using Visual Studio 2013

Builder
Builder

Hi,

 

I am beginning to start customization on NX 7.5. I went through the Help files and documentation. I am still confused to get started with. I am good in VB and C#, and little Ok with C++ programming.

 

Based on some of the posts in this forum i am trying to create a project using NX Open Wizard. I am unable to find the template in my Visual Studio 2013. Both the products are licensed. I also tried to copy the VB/VC#Wizards to (Install Location)\Microsoft Visual Studio 12.0\VC# and (Install Location)\Microsoft Visual Studio 12.0\VB.

But still i am unable to find the template. Is there any other way to start.

 

Any links or youtube videos would be helpful, to point me in right direction.

 

Just for info: I have done customization for Autodesk products earlier.

 

Regards,
Santosh
33 REPLIES

Re: Create Addins in Nx7.5 using Visual Studio 2013

Esteemed Contributor
Esteemed Contributor

VS 2013 is not certified for NX 7.5 Smiley Sad

 

You can find the certified version of VS in the NX documentation under Release Notes => Caveats and Product Notes => Programming Tools => Product Notes.

 

Only the certified VS release is supported, therefor I use SharpDevelop for my C# and VB.NET projects, which doesn't have this restriction.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX12.0

How to Get the Most from Your Signature in the Community

Re: Create Addins in Nx7.5 using Visual Studio 2013

Builder
Builder

Ok. I am going through the below link to check which version is suitable for me.

https://support.industrysoftware.automation.siemens.com/docs/nx/

 

Once i sort this compatibility issue out, what should be my next move.

Regards,
Santosh

Re: Create Addins in Nx7.5 using Visual Studio 2013

Siemens Phenom Siemens Phenom
Siemens Phenom

This is all well documented in the online help.

 

VS_Wizard.png

Re: Create Addins in Nx7.5 using Visual Studio 2013

Honored Contributor
Honored Contributor

While it is documented in the NX help, I think it refers to an older version of VS. I have only been able to get the wizards to work with VS 2010. I tried the demo of VS 2012 (or 2013?) when it came out, but the folder structure called out in the NX help simply didn't exist in the VS install. Perhaps this was because I had installed a time limited "evaluation" copy of VS, but I don't think so.

 

The good news is: you don't need the wizards to create a project; you can make your own templates as a starting point. Add references to the NX dll's:

  • NXOpen.dll
  • NXOpen.UF.dll
  • NXOpen.Utilities.dll
  • NXOpenUI.dll

all of which can be found in the {NX install directory}\UGII\managed folder.

 

And the starting code would look something like this (VB.net shown, modify it to your needs):

Option Strict Off
Imports System
Imports NXOpen

Module Module1

    '  Explicit Activation
    '      This entry point is used to activate the application explicitly
    Sub Main()

        Dim theSession As Session = Session.GetSession()
        If IsNothing(theSession.Parts.Work) Then
			'active part required
            Return
        End If

        Dim workPart As Part = theSession.Parts.Work
        Dim lw As ListingWindow = theSession.ListingWindow
        lw.Open()
		
        Const undoMarkName As String = "journal template"
        Dim markId1 As Session.UndoMarkId
        markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, undoMarkName)

		Try
			' TODO: Add your application code here 
			
			
		Catch ex As NXException
			theSession.UndoToMark(markId1, undoMarkName)
			MsgBox(ex.Message)
			
		Finally
		
		End Try
		
		lw.Close()
		
    End Sub


    Public Function GetUnloadOption(ByVal dummy As String) As Integer

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

        '----Other unload options-------
        'Unloads the image immediately after execution within NX
        'GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately

        'Unloads the image explicitly, via an unload dialog
        'GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Explicitly
        '-------------------------------

    End Function

End Module

 

 

Re: Create Addins in Nx7.5 using Visual Studio 2013

Siemens Phenom Siemens Phenom
Siemens Phenom

 

As Jim pointed out, this is explained in the docs, but we really only expect the instructions in the docs to work when you use the supported version of the Studio for the version of NX you are working with.

 

We have had anecdotal reports from some customers that they were able to tweak the .Net Wizards to get them to work with newer versions of the Studio, but we don't have any instructions available to tell you how to do that.

 

If you are working with C or C++, we do not expect that any programs you build will run properly if you use an unsupported version of the Studio to build them, even if you can get the Wizards to work.  This is primarily due to changes in the way memory is managed between versions of the Studio.

 

 

So the best thing we can suggest is to try to get a copy of the supported version of the Studio.

 

For NX7.5 that is the 2008 version, with SP1.

Re: Create Addins in Nx7.5 using Visual Studio 2013

Builder
Builder

Hi cowski1/JimB/SteveLabout,

 

Thank you for your guidance. I shall try out on tuesday and post the reply back, This will help me get started.

Regards,
Santosh

Re: Create Addins in Nx7.5 using Visual Studio 2013

Pioneer
Pioneer

Stefan_Pendl wrote:

VS 2013 is not certified for NX 7.5 Smiley Sad

....

Only the certified VS release is supported, therefor I use SharpDevelop for my C# and VB.NET projects, which doesn't have this restriction.


[ refers to NX10 documentation : Doc# NX10 Caveats and Product Notes #Programming Tools]

My understanding of the documentation is that anything except the certified VisualStudio is unsupported ( for .NET there is only a reference to the .NET framework, not to a apecific compiler ).

Also documentation says that in case of NX upgrades you have to create a new project using the VS wizard and then you need to merge your existing code into it.

You can not do this without VS ...

I do not know developers doing so as well ...

Thomas Zwatz, CADadmin, PÖTTINGER Landtechnik GmbH
Production: NX10.0.3.5 MP11 + TC10.1.7.1
Testing: NX10.0.3.5 MP17, NX11.0.2.7 MP02 + TC10.1.7.1
Development: C#

Re: Create Addins in Nx7.5 using Visual Studio 2013

Esteemed Contributor
Esteemed Contributor

I don't need the VS templates, if I don't use VS.

 

I never had any problems using SharpDevelop for .NET projects.

Now that I mostly create block styler based projects, the initial framework is created by the NX block styler, so nothing to care about either.

 

The problem with VS is all those dependencies to runtime files and much more.

For me the dependence to .NET Framework is more than enough.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX12.0

How to Get the Most from Your Signature in the Community

Re: Create Addins in Nx7.5 using Visual Studio 2013

Builder
Builder

Hi,

 

I found Visual Studio 2008 for NX 7.5.

 

I am trying to use the sample example shown in the NX Programming help ("Executing Common API Programs").

 

As per the documentation, it says "The menu file must be placed in the "startup" folder.  After compiling and linking the sample programs (my_cpp_program.cpp and my_vb_program.vb) the executables (my_cpp_program.dll, and my_vb_program.dll) need to be placed in the "application" folder."

 

So based on that i have placed my

.men(Menu File) file at "<NX_INSTALL_LOCATION>\UGII\menus" and

.dll &.cs at "<NX_INSTALL_LOCATION>\UGII\".

 

Am i placing the file in the wrong startup and application folder ?

 

Regards,
Santosh