diff --git a/HLCt/Parts/START.SLDPRT b/HLCt/Parts/START.SLDPRT index da2847a..9e155b4 100644 Binary files a/HLCt/Parts/START.SLDPRT and b/HLCt/Parts/START.SLDPRT differ diff --git a/HLCt/START/new_design.SLDASM b/HLCt/START/new_design.SLDASM index 53fba08..a03547f 100644 Binary files a/HLCt/START/new_design.SLDASM and b/HLCt/START/new_design.SLDASM differ diff --git a/HLCt/pressure_welded.SLDPRT b/HLCt/pressure_welded.SLDPRT index 831e117..7132552 100644 Binary files a/HLCt/pressure_welded.SLDPRT and b/HLCt/pressure_welded.SLDPRT differ diff --git a/HLCt/test.SLDPRT b/HLCt/test.SLDPRT new file mode 100644 index 0000000..65dd7b8 Binary files /dev/null and b/HLCt/test.SLDPRT differ diff --git a/Wardrobe/GUI.vb b/Wardrobe/GUI.vb index 3047d9f..8380df2 100644 --- a/Wardrobe/GUI.vb +++ b/Wardrobe/GUI.vb @@ -1,12 +1,15 @@ Imports XCCLibrary Public Class GUI + Public Shared filesFolder As String = "C:\Users\Anton\Documents\Exjobb" + Public Shared HLCtFolder As String = "C:\Users\Anton\Documents\Exjobb\X2021" + Dim containerPanel As Panel Dim containerX, containerY, containerW, containerH, containerMidX, containerMidY As Integer Dim gratingMaxW, gratingMaxH As Decimal Dim drawW, drawH As Integer Dim drawAspect, gratingAspect As Decimal - Dim scaleDiff As Decimal + Dim scaleDiff As Decimal = 1 Public pCon1(3) As Decimal 'pCon(0) = pixel X, pCon(2) = SW X, etc. Public pCon2(3) As Decimal @@ -31,6 +34,8 @@ Public Class GUI Set_ContainerPointsY() Create_StartPoints() + + Program.Load_XCC(filesFolder, HLCtFolder) End Sub ' --- Retrive parameters for the drawing box --- @@ -253,6 +258,11 @@ Public Class GUI ' --- When export to SW button is pressed --- Private Sub ExportSWButton_Click(sender As Object, e As EventArgs) Handles ExportSWButton.Click + Program.Update_KB() + + Program.Build_Grating() + + 'Test för att SW API Dim pointTable As New DataTable pointTable = Create_PointTable() diff --git a/Wardrobe/My Project/Resources.Designer.vb b/Wardrobe/My Project/Resources.Designer.vb index bfc5066..c53197b 100644 --- a/Wardrobe/My Project/Resources.Designer.vb +++ b/Wardrobe/My Project/Resources.Designer.vb @@ -59,25 +59,5 @@ Namespace My.Resources resourceCulture = value End Set End Property - - ''' - ''' Looks up a localized resource of type System.Drawing.Bitmap. - ''' - Friend ReadOnly Property add_b() As System.Drawing.Bitmap - Get - Dim obj As Object = ResourceManager.GetObject("add-b", resourceCulture) - Return CType(obj,System.Drawing.Bitmap) - End Get - End Property - - ''' - ''' Looks up a localized resource of type System.Drawing.Bitmap. - ''' - Friend ReadOnly Property remove_b() As System.Drawing.Bitmap - Get - Dim obj As Object = ResourceManager.GetObject("remove-b", resourceCulture) - Return CType(obj,System.Drawing.Bitmap) - End Get - End Property End Module End Namespace diff --git a/Wardrobe/My Project/Resources.resx b/Wardrobe/My Project/Resources.resx index 053accf..2f96abe 100644 --- a/Wardrobe/My Project/Resources.resx +++ b/Wardrobe/My Project/Resources.resx @@ -118,10 +118,4 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\Resources\add-b.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\remove-b.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - \ No newline at end of file diff --git a/Wardrobe/Program.vb b/Wardrobe/Program.vb index 029707b..075254a 100644 --- a/Wardrobe/Program.vb +++ b/Wardrobe/Program.vb @@ -1,6 +1,32 @@ Imports XCCLibrary Imports SldWorks Public Class Program + + Public Shared Sub Load_XCC(fFolder As String, hFolder As String) + adminClass.loadSettings(fFolder, hFolder, "SolidWorks") + End Sub + + Public Shared Sub Update_KB() + adminClass.updateDatabase() + End Sub + + Public Shared Sub Build_Grating() + XCCBaseClass.newDesign() + ExternalClass.PopulateTamplateXMLGroup() + + Dim inst_ As Integer = 0 + Dim parentID As Integer = 0 + inst_ = ExternalClass.instantiate_parts(parentID, "pressure_welded", "") + ExternalClass.modify_parameter_value("DP_GRATING_WIDTH", inst_, 1000) + ExternalClass.modify_parameter_value("DP_GRATING_LENGTH", inst_, 500) + + importClass.copyGroupsByDataSet(ExternalClass.groupds_new) + Dim grNr = groupClass.NewGroupID + Dim designTable = designModel.selectDesign("*") + Dim designName = designTable.rows(0)("designName") + groupClass.InstantiateGroup(designName, grNr, "START") + End Sub + Public Shared Sub Export_SW(pointTable As DataTable) Dim swApp As SldWorks.SldWorks swApp = CType(System.Runtime.InteropServices.Marshal.GetActiveObject("SldWorks.Application"), SldWorks.SldWorks)