From eec407dcc237feeffbc7a5d62ff5fc0b6d47871f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eugen=20H=C3=B6glinger?= Date: Thu, 27 Feb 2020 15:01:19 +0100 Subject: [PATCH] Projekt neu angelegt. --- .gitignore | 32 ++++ NXOpen WinForm ApplicationTest.sln | 25 +++ NXOpen WinForm ApplicationTest/MyProgram.vb | 10 ++ .../NXOpen WinForm ApplicationTest.vbproj | 152 ++++++++++++++++++ .../NXOpenWinForm.Designer.vb | 44 +++++ .../NXOpenWinForm.resx | 120 ++++++++++++++ .../NXOpenWinForm.vb | 5 + NXOpen WinForm ApplicationTest/Test.vb | 40 +++++ NXOpen WinForm ApplicationTest/Unload.vb | 14 ++ 9 files changed, 442 insertions(+) create mode 100644 .gitignore create mode 100644 NXOpen WinForm ApplicationTest.sln create mode 100644 NXOpen WinForm ApplicationTest/MyProgram.vb create mode 100644 NXOpen WinForm ApplicationTest/NXOpen WinForm ApplicationTest.vbproj create mode 100644 NXOpen WinForm ApplicationTest/NXOpenWinForm.Designer.vb create mode 100644 NXOpen WinForm ApplicationTest/NXOpenWinForm.resx create mode 100644 NXOpen WinForm ApplicationTest/NXOpenWinForm.vb create mode 100644 NXOpen WinForm ApplicationTest/Test.vb create mode 100644 NXOpen WinForm ApplicationTest/Unload.vb diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5a5f80a --- /dev/null +++ b/.gitignore @@ -0,0 +1,32 @@ + +#Ignore thumbnails created by Windows +Thumbs.db +#Ignore files built by Visual Studio +*.obj +*.exe +*.pdb +*.user +*.aps +*.pch +*.vspscc +*_i.c +*_p.c +*.ncb +*.suo +*.tlb +*.tlh +*.bak +*.cache +*.ilk +*.log +[Bb]in +[Dd]ebug*/ +*.lib +*.sbr +obj/ +[Rr]elease*/ +_ReSharper*/ +[Tt]est[Rr]esult* +.vs/ +#Nuget packages folder +packages/ diff --git a/NXOpen WinForm ApplicationTest.sln b/NXOpen WinForm ApplicationTest.sln new file mode 100644 index 0000000..7cf016d --- /dev/null +++ b/NXOpen WinForm ApplicationTest.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.489 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "NXOpen WinForm ApplicationTest", "NXOpen WinForm ApplicationTest\NXOpen WinForm ApplicationTest.vbproj", "{990C9A9E-9130-4BA9-8585-636A906E7724}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {990C9A9E-9130-4BA9-8585-636A906E7724}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {990C9A9E-9130-4BA9-8585-636A906E7724}.Debug|Any CPU.Build.0 = Debug|Any CPU + {990C9A9E-9130-4BA9-8585-636A906E7724}.Release|Any CPU.ActiveCfg = Release|Any CPU + {990C9A9E-9130-4BA9-8585-636A906E7724}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {B8110203-339D-4B46-8CC0-3D3F7EA20EFB} + EndGlobalSection +EndGlobal diff --git a/NXOpen WinForm ApplicationTest/MyProgram.vb b/NXOpen WinForm ApplicationTest/MyProgram.vb new file mode 100644 index 0000000..b9fadd8 --- /dev/null +++ b/NXOpen WinForm ApplicationTest/MyProgram.vb @@ -0,0 +1,10 @@ +Public Class MyProgram + + Public Shared Sub Main() + + Dim form As New NXOpenWinForm() + form.ShowDialog() + + End Sub + +End Class diff --git a/NXOpen WinForm ApplicationTest/NXOpen WinForm ApplicationTest.vbproj b/NXOpen WinForm ApplicationTest/NXOpen WinForm ApplicationTest.vbproj new file mode 100644 index 0000000..843423b --- /dev/null +++ b/NXOpen WinForm ApplicationTest/NXOpen WinForm ApplicationTest.vbproj @@ -0,0 +1,152 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {990C9A9E-9130-4BA9-8585-636A906E7724} + Library + + + NXOpen_WinForm_ApplicationTest + $(PROJECT_NAME) + Windows + + + 3.5 + On + Binary + Off + On + + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + v4.5.1 + + + + true + full + true + true + bin\Debug\ + $(PROJECT_NAME).xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + false + + + pdbonly + false + true + true + bin\Release\ + $(PROJECT_NAME).xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + false + + + false + + + + D:\workdir\refunits\nx11.13\out\ugac\NXOpen.dll + + + D:\workdir\refunits\nx11.13\out\ugac\NXOpen.Guide.dll + + + D:\workdir\refunits\nx11.13\out\ugac\NXOpen.UF.dll + + + D:\workdir\refunits\nx11.13\out\ugac\NXOpen.Utilities.dll + + + D:\workdir\refunits\nx11.13\out\ugac\NXOpenUI.dll + + + + + + + + + + + + + + + + + + + False + .NET Framework Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + false + + + + + + NXOpenWinForm.vb + + + Form + + + + + + + + + + NXOpenWinForm.vb + + + + + \ No newline at end of file diff --git a/NXOpen WinForm ApplicationTest/NXOpenWinForm.Designer.vb b/NXOpen WinForm ApplicationTest/NXOpenWinForm.Designer.vb new file mode 100644 index 0000000..229737f --- /dev/null +++ b/NXOpen WinForm ApplicationTest/NXOpenWinForm.Designer.vb @@ -0,0 +1,44 @@ + _ +Partial Class NXOpenWinForm + Inherits System.Windows.Forms.Form + + Public Sub New() + InitializeComponent() + NXOpenUI.FormUtilities.SetApplicationIcon(Me) + NXOpenUI.FormUtilities.ReparentForm(Me) + End Sub + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.SuspendLayout() + ' + 'SnapWinForm + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(275, 142) + Me.Name = "NXOpenWinForm" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent + Me.Text = "NX Open WinForm" + Me.ResumeLayout(False) + + End Sub +End Class diff --git a/NXOpen WinForm ApplicationTest/NXOpenWinForm.resx b/NXOpen WinForm ApplicationTest/NXOpenWinForm.resx new file mode 100644 index 0000000..d58980a --- /dev/null +++ b/NXOpen WinForm ApplicationTest/NXOpenWinForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/NXOpen WinForm ApplicationTest/NXOpenWinForm.vb b/NXOpen WinForm ApplicationTest/NXOpenWinForm.vb new file mode 100644 index 0000000..34ef5d8 --- /dev/null +++ b/NXOpen WinForm ApplicationTest/NXOpenWinForm.vb @@ -0,0 +1,5 @@ +Imports NXOpen + +Public Class NXOpenWinForm + +End Class \ No newline at end of file diff --git a/NXOpen WinForm ApplicationTest/Test.vb b/NXOpen WinForm ApplicationTest/Test.vb new file mode 100644 index 0000000..70807c8 --- /dev/null +++ b/NXOpen WinForm ApplicationTest/Test.vb @@ -0,0 +1,40 @@ +Public Class Test + ' NX 9.0.3.4 + 'Journal zum + + Option Strict Off + Imports System + Imports NXOpen + + Module NXJournal + Sub Main(ByVal args() As String) + + Dim theSession As Session = Session.GetSession() + Dim workPart As Part = theSession.Parts.Work + + Dim displayPart As Part = theSession.Parts.Display + + 'theSession.Preferences.Modeling.UpdatePending = False + + 'Dim markId1 As Session.UndoMarkId + 'markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Expression") + + Dim expModified1 As Boolean + Dim errorMessages1() As String + + + 'workPart.Expressions.ImportFromFile("M:\UG\NX12_NXTC\global\06_ENGEL_NX_CUSTOMIZING\Blech\blech - Vorschlag_Eugen.exp", ExpressionCollection.ImportMode.Replace, expModified1, errorMessages1) + + Dim sheetMetalExpressionsValue As String + sheetMetalExpressionsValue = theSession.GetEnvironmentVariableValue("NX_SERVER_DIR") + "\global\06_ENGEL_NX_CUSTOMIZING\Blech\blech_Vorschlag_Eugen.exp" + System.Windows.Forms.MessageBox.Show("Expressions Value: " + sheetMetalExpressionsValue) + workPart.Expressions.ImportFromFile(sheetMetalExpressionsValue, ExpressionCollection.ImportMode.Replace, expModified1, errorMessages1) + + theSession.Preferences.Modeling.UpdatePending = False + + 'Dim nErrs1 As Integer + 'nErrs1 = theSession.UpdateManager.DoUpdate(markId1) + + End Sub + End Module +End Class diff --git a/NXOpen WinForm ApplicationTest/Unload.vb b/NXOpen WinForm ApplicationTest/Unload.vb new file mode 100644 index 0000000..b953424 --- /dev/null +++ b/NXOpen WinForm ApplicationTest/Unload.vb @@ -0,0 +1,14 @@ +Public Class Unload + + Public Shared Function GetUnloadOption(ByVal dummy As String) As Integer + Dim unloadOption As Integer + + unloadOption = NXOpen.Session.LibraryUnloadOption.Immediately ' After executing + 'unloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination ' When NX session terminates + 'unloadOption = NXOpen.Session.LibraryUnloadOption.Explicitly ' Using File-->Unload + + Return unloadOption + + End Function + +End Class \ No newline at end of file