Instantiate part through XCC
This commit is contained in:
parent
ac9c04439a
commit
8a7f9468c8
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,12 +1,15 @@
|
||||||
Imports XCCLibrary
|
Imports XCCLibrary
|
||||||
|
|
||||||
Public Class GUI
|
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 containerPanel As Panel
|
||||||
Dim containerX, containerY, containerW, containerH, containerMidX, containerMidY As Integer
|
Dim containerX, containerY, containerW, containerH, containerMidX, containerMidY As Integer
|
||||||
Dim gratingMaxW, gratingMaxH As Decimal
|
Dim gratingMaxW, gratingMaxH As Decimal
|
||||||
Dim drawW, drawH As Integer
|
Dim drawW, drawH As Integer
|
||||||
Dim drawAspect, gratingAspect As Decimal
|
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 pCon1(3) As Decimal 'pCon(0) = pixel X, pCon(2) = SW X, etc.
|
||||||
Public pCon2(3) As Decimal
|
Public pCon2(3) As Decimal
|
||||||
|
|
@ -31,6 +34,8 @@ Public Class GUI
|
||||||
Set_ContainerPointsY()
|
Set_ContainerPointsY()
|
||||||
|
|
||||||
Create_StartPoints()
|
Create_StartPoints()
|
||||||
|
|
||||||
|
Program.Load_XCC(filesFolder, HLCtFolder)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
' --- Retrive parameters for the drawing box ---
|
' --- Retrive parameters for the drawing box ---
|
||||||
|
|
@ -253,6 +258,11 @@ Public Class GUI
|
||||||
|
|
||||||
' --- When export to SW button is pressed ---
|
' --- When export to SW button is pressed ---
|
||||||
Private Sub ExportSWButton_Click(sender As Object, e As EventArgs) Handles ExportSWButton.Click
|
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
|
Dim pointTable As New DataTable
|
||||||
pointTable = Create_PointTable()
|
pointTable = Create_PointTable()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,25 +59,5 @@ Namespace My.Resources
|
||||||
resourceCulture = value
|
resourceCulture = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
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 Module
|
||||||
End Namespace
|
End Namespace
|
||||||
|
|
|
||||||
|
|
@ -118,10 +118,4 @@
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
<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>
|
</root>
|
||||||
|
|
@ -1,6 +1,32 @@
|
||||||
Imports XCCLibrary
|
Imports XCCLibrary
|
||||||
Imports SldWorks
|
Imports SldWorks
|
||||||
Public Class Program
|
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)
|
Public Shared Sub Export_SW(pointTable As DataTable)
|
||||||
Dim swApp As SldWorks.SldWorks
|
Dim swApp As SldWorks.SldWorks
|
||||||
swApp = CType(System.Runtime.InteropServices.Marshal.GetActiveObject("SldWorks.Application"), SldWorks.SldWorks)
|
swApp = CType(System.Runtime.InteropServices.Marshal.GetActiveObject("SldWorks.Application"), SldWorks.SldWorks)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue