Instantiate part through XCC

This commit is contained in:
Anton 2021-01-29 13:56:20 +01:00
parent ac9c04439a
commit 8a7f9468c8
8 changed files with 37 additions and 27 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
HLCt/test.SLDPRT Normal file

Binary file not shown.

View File

@ -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()

View File

@ -59,25 +59,5 @@ Namespace My.Resources
resourceCulture = value
End Set
End Property
'''<summary>
''' Looks up a localized resource of type System.Drawing.Bitmap.
'''</summary>
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
'''<summary>
''' Looks up a localized resource of type System.Drawing.Bitmap.
'''</summary>
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

View File

@ -118,10 +118,4 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="add-b" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\add-b.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="remove-b" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\remove-b.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@ -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)