Clean up and small fixes

This commit is contained in:
Anton 2021-04-29 14:16:03 +02:00
parent 9c07c563a8
commit 5e386c6bf0
20 changed files with 177 additions and 429 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -33,7 +33,8 @@
Each data row contains a name, and value. The row also contains a Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture. text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the Classes that don
t support this are serialized and stored with the
mimetype set. mimetype set.
The mimetype is used for serialized objects, and tells the The mimetype is used for serialized objects, and tells the

View File

@ -24,6 +24,8 @@ Partial Class Individual
Private Sub InitializeComponent() Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Individual)) Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Individual))
Me.Panel_Data = New System.Windows.Forms.Panel() Me.Panel_Data = New System.Windows.Forms.Panel()
Me.Label8 = New System.Windows.Forms.Label()
Me.ComboBox_Frame = New System.Windows.Forms.ComboBox()
Me.CheckBox_3DModel = New System.Windows.Forms.CheckBox() Me.CheckBox_3DModel = New System.Windows.Forms.CheckBox()
Me.CheckBox_FrameDrawing = New System.Windows.Forms.CheckBox() Me.CheckBox_FrameDrawing = New System.Windows.Forms.CheckBox()
Me.CheckBox_GratingDrawing = New System.Windows.Forms.CheckBox() Me.CheckBox_GratingDrawing = New System.Windows.Forms.CheckBox()
@ -64,8 +66,6 @@ Partial Class Individual
Me.Panel_Grating = New System.Windows.Forms.Panel() Me.Panel_Grating = New System.Windows.Forms.Panel()
Me.Label2 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label()
Me.Label1 = New System.Windows.Forms.Label() Me.Label1 = New System.Windows.Forms.Label()
Me.ComboBox_Frame = New System.Windows.Forms.ComboBox()
Me.Label8 = New System.Windows.Forms.Label()
Me.Panel_Data.SuspendLayout() Me.Panel_Data.SuspendLayout()
Me.Panel_Recesses.SuspendLayout() Me.Panel_Recesses.SuspendLayout()
Me.Panel_Grating.SuspendLayout() Me.Panel_Grating.SuspendLayout()
@ -111,12 +111,33 @@ Partial Class Individual
Me.Panel_Data.Size = New System.Drawing.Size(420, 950) Me.Panel_Data.Size = New System.Drawing.Size(420, 950)
Me.Panel_Data.TabIndex = 0 Me.Panel_Data.TabIndex = 0
' '
'Label8
'
Me.Label8.AutoSize = True
Me.Label8.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label8.Location = New System.Drawing.Point(53, 656)
Me.Label8.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label8.Name = "Label8"
Me.Label8.Size = New System.Drawing.Size(99, 20)
Me.Label8.TabIndex = 34
Me.Label8.Text = "Frame WxH"
'
'ComboBox_Frame
'
Me.ComboBox_Frame.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.ComboBox_Frame.FormattingEnabled = True
Me.ComboBox_Frame.Location = New System.Drawing.Point(147, 656)
Me.ComboBox_Frame.Margin = New System.Windows.Forms.Padding(4)
Me.ComboBox_Frame.Name = "ComboBox_Frame"
Me.ComboBox_Frame.Size = New System.Drawing.Size(205, 24)
Me.ComboBox_Frame.TabIndex = 33
'
'CheckBox_3DModel 'CheckBox_3DModel
' '
Me.CheckBox_3DModel.AutoSize = True Me.CheckBox_3DModel.AutoSize = True
Me.CheckBox_3DModel.Location = New System.Drawing.Point(235, 727) Me.CheckBox_3DModel.Location = New System.Drawing.Point(235, 727)
Me.CheckBox_3DModel.Name = "CheckBox_3DModel" Me.CheckBox_3DModel.Name = "CheckBox_3DModel"
Me.CheckBox_3DModel.Size = New System.Drawing.Size(131, 20) Me.CheckBox_3DModel.Size = New System.Drawing.Size(141, 21)
Me.CheckBox_3DModel.TabIndex = 32 Me.CheckBox_3DModel.TabIndex = 32
Me.CheckBox_3DModel.Text = "3D Grating Model" Me.CheckBox_3DModel.Text = "3D Grating Model"
Me.CheckBox_3DModel.UseVisualStyleBackColor = True Me.CheckBox_3DModel.UseVisualStyleBackColor = True
@ -127,7 +148,7 @@ Partial Class Individual
Me.CheckBox_FrameDrawing.Enabled = False Me.CheckBox_FrameDrawing.Enabled = False
Me.CheckBox_FrameDrawing.Location = New System.Drawing.Point(235, 808) Me.CheckBox_FrameDrawing.Location = New System.Drawing.Point(235, 808)
Me.CheckBox_FrameDrawing.Name = "CheckBox_FrameDrawing" Me.CheckBox_FrameDrawing.Name = "CheckBox_FrameDrawing"
Me.CheckBox_FrameDrawing.Size = New System.Drawing.Size(118, 20) Me.CheckBox_FrameDrawing.Size = New System.Drawing.Size(125, 21)
Me.CheckBox_FrameDrawing.TabIndex = 31 Me.CheckBox_FrameDrawing.TabIndex = 31
Me.CheckBox_FrameDrawing.Text = "Frame Drawing" Me.CheckBox_FrameDrawing.Text = "Frame Drawing"
Me.CheckBox_FrameDrawing.UseVisualStyleBackColor = True Me.CheckBox_FrameDrawing.UseVisualStyleBackColor = True
@ -137,7 +158,7 @@ Partial Class Individual
Me.CheckBox_GratingDrawing.AutoSize = True Me.CheckBox_GratingDrawing.AutoSize = True
Me.CheckBox_GratingDrawing.Location = New System.Drawing.Point(235, 754) Me.CheckBox_GratingDrawing.Location = New System.Drawing.Point(235, 754)
Me.CheckBox_GratingDrawing.Name = "CheckBox_GratingDrawing" Me.CheckBox_GratingDrawing.Name = "CheckBox_GratingDrawing"
Me.CheckBox_GratingDrawing.Size = New System.Drawing.Size(122, 20) Me.CheckBox_GratingDrawing.Size = New System.Drawing.Size(132, 21)
Me.CheckBox_GratingDrawing.TabIndex = 30 Me.CheckBox_GratingDrawing.TabIndex = 30
Me.CheckBox_GratingDrawing.Text = "Grating Drawing" Me.CheckBox_GratingDrawing.Text = "Grating Drawing"
Me.CheckBox_GratingDrawing.UseVisualStyleBackColor = True Me.CheckBox_GratingDrawing.UseVisualStyleBackColor = True
@ -147,7 +168,7 @@ Partial Class Individual
Me.CheckBox_Frames.AutoSize = True Me.CheckBox_Frames.AutoSize = True
Me.CheckBox_Frames.Location = New System.Drawing.Point(235, 781) Me.CheckBox_Frames.Location = New System.Drawing.Point(235, 781)
Me.CheckBox_Frames.Name = "CheckBox_Frames" Me.CheckBox_Frames.Name = "CheckBox_Frames"
Me.CheckBox_Frames.Size = New System.Drawing.Size(101, 20) Me.CheckBox_Frames.Size = New System.Drawing.Size(106, 21)
Me.CheckBox_Frames.TabIndex = 29 Me.CheckBox_Frames.TabIndex = 29
Me.CheckBox_Frames.Text = "Add Frames" Me.CheckBox_Frames.Text = "Add Frames"
Me.CheckBox_Frames.UseVisualStyleBackColor = True Me.CheckBox_Frames.UseVisualStyleBackColor = True
@ -157,7 +178,7 @@ Partial Class Individual
Me.CheckBox_Instructions.AutoSize = True Me.CheckBox_Instructions.AutoSize = True
Me.CheckBox_Instructions.Location = New System.Drawing.Point(235, 835) Me.CheckBox_Instructions.Location = New System.Drawing.Point(235, 835)
Me.CheckBox_Instructions.Name = "CheckBox_Instructions" Me.CheckBox_Instructions.Name = "CheckBox_Instructions"
Me.CheckBox_Instructions.Size = New System.Drawing.Size(156, 20) Me.CheckBox_Instructions.Size = New System.Drawing.Size(166, 21)
Me.CheckBox_Instructions.TabIndex = 28 Me.CheckBox_Instructions.TabIndex = 28
Me.CheckBox_Instructions.Text = "Assembly Instructions" Me.CheckBox_Instructions.Text = "Assembly Instructions"
Me.CheckBox_Instructions.UseVisualStyleBackColor = True Me.CheckBox_Instructions.UseVisualStyleBackColor = True
@ -197,7 +218,7 @@ Partial Class Individual
Me.Label7.Location = New System.Drawing.Point(359, 495) Me.Label7.Location = New System.Drawing.Point(359, 495)
Me.Label7.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label7.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label7.Name = "Label7" Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(23, 13) Me.Label7.Size = New System.Drawing.Size(30, 17)
Me.Label7.TabIndex = 24 Me.Label7.TabIndex = 24
Me.Label7.Text = "mm" Me.Label7.Text = "mm"
' '
@ -208,7 +229,7 @@ Partial Class Individual
Me.Label6.Location = New System.Drawing.Point(359, 576) Me.Label6.Location = New System.Drawing.Point(359, 576)
Me.Label6.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label6.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label6.Name = "Label6" Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(23, 13) Me.Label6.Size = New System.Drawing.Size(30, 17)
Me.Label6.TabIndex = 23 Me.Label6.TabIndex = 23
Me.Label6.Text = "mm" Me.Label6.Text = "mm"
' '
@ -219,7 +240,7 @@ Partial Class Individual
Me.Label5.Location = New System.Drawing.Point(359, 404) Me.Label5.Location = New System.Drawing.Point(359, 404)
Me.Label5.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label5.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label5.Name = "Label5" Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(23, 13) Me.Label5.Size = New System.Drawing.Size(30, 17)
Me.Label5.TabIndex = 22 Me.Label5.TabIndex = 22
Me.Label5.Text = "mm" Me.Label5.Text = "mm"
' '
@ -230,7 +251,7 @@ Partial Class Individual
Me.Label4.Location = New System.Drawing.Point(359, 346) Me.Label4.Location = New System.Drawing.Point(359, 346)
Me.Label4.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label4.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label4.Name = "Label4" Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(23, 13) Me.Label4.Size = New System.Drawing.Size(30, 17)
Me.Label4.TabIndex = 21 Me.Label4.TabIndex = 21
Me.Label4.Text = "mm" Me.Label4.Text = "mm"
' '
@ -241,7 +262,7 @@ Partial Class Individual
Me.Label3.Location = New System.Drawing.Point(359, 292) Me.Label3.Location = New System.Drawing.Point(359, 292)
Me.Label3.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label3.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label3.Name = "Label3" Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(23, 13) Me.Label3.Size = New System.Drawing.Size(30, 17)
Me.Label3.TabIndex = 20 Me.Label3.TabIndex = 20
Me.Label3.Text = "mm" Me.Label3.Text = "mm"
' '
@ -274,7 +295,7 @@ Partial Class Individual
Me.Label_Heading.Location = New System.Drawing.Point(93, 46) Me.Label_Heading.Location = New System.Drawing.Point(93, 46)
Me.Label_Heading.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label_Heading.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label_Heading.Name = "Label_Heading" Me.Label_Heading.Name = "Label_Heading"
Me.Label_Heading.Size = New System.Drawing.Size(166, 20) Me.Label_Heading.Size = New System.Drawing.Size(198, 25)
Me.Label_Heading.TabIndex = 15 Me.Label_Heading.TabIndex = 15
Me.Label_Heading.Text = "Grating Parameters" Me.Label_Heading.Text = "Grating Parameters"
' '
@ -285,7 +306,7 @@ Partial Class Individual
Me.Label_Material.Location = New System.Drawing.Point(61, 176) Me.Label_Material.Location = New System.Drawing.Point(61, 176)
Me.Label_Material.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label_Material.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label_Material.Name = "Label_Material" Me.Label_Material.Name = "Label_Material"
Me.Label_Material.Size = New System.Drawing.Size(58, 17) Me.Label_Material.Size = New System.Drawing.Size(69, 20)
Me.Label_Material.TabIndex = 14 Me.Label_Material.TabIndex = 14
Me.Label_Material.Text = "Material" Me.Label_Material.Text = "Material"
' '
@ -296,7 +317,7 @@ Partial Class Individual
Me.Label_Mesh.Location = New System.Drawing.Point(41, 287) Me.Label_Mesh.Location = New System.Drawing.Point(41, 287)
Me.Label_Mesh.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label_Mesh.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label_Mesh.Name = "Label_Mesh" Me.Label_Mesh.Name = "Label_Mesh"
Me.Label_Mesh.Size = New System.Drawing.Size(73, 17) Me.Label_Mesh.Size = New System.Drawing.Size(88, 20)
Me.Label_Mesh.TabIndex = 13 Me.Label_Mesh.TabIndex = 13
Me.Label_Mesh.Text = "Mesh Size" Me.Label_Mesh.Text = "Mesh Size"
' '
@ -307,7 +328,7 @@ Partial Class Individual
Me.Label_Height.Location = New System.Drawing.Point(73, 343) Me.Label_Height.Location = New System.Drawing.Point(73, 343)
Me.Label_Height.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label_Height.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label_Height.Name = "Label_Height" Me.Label_Height.Name = "Label_Height"
Me.Label_Height.Size = New System.Drawing.Size(49, 17) Me.Label_Height.Size = New System.Drawing.Size(58, 20)
Me.Label_Height.TabIndex = 12 Me.Label_Height.TabIndex = 12
Me.Label_Height.Text = "Height" Me.Label_Height.Text = "Height"
' '
@ -318,7 +339,7 @@ Partial Class Individual
Me.Label_Thickness.Location = New System.Drawing.Point(43, 399) Me.Label_Thickness.Location = New System.Drawing.Point(43, 399)
Me.Label_Thickness.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label_Thickness.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label_Thickness.Name = "Label_Thickness" Me.Label_Thickness.Name = "Label_Thickness"
Me.Label_Thickness.Size = New System.Drawing.Size(72, 17) Me.Label_Thickness.Size = New System.Drawing.Size(85, 20)
Me.Label_Thickness.TabIndex = 11 Me.Label_Thickness.TabIndex = 11
Me.Label_Thickness.Text = "Thickness" Me.Label_Thickness.Text = "Thickness"
' '
@ -329,7 +350,7 @@ Partial Class Individual
Me.Label_Width.Location = New System.Drawing.Point(80, 572) Me.Label_Width.Location = New System.Drawing.Point(80, 572)
Me.Label_Width.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label_Width.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label_Width.Name = "Label_Width" Me.Label_Width.Name = "Label_Width"
Me.Label_Width.Size = New System.Drawing.Size(44, 17) Me.Label_Width.Size = New System.Drawing.Size(52, 20)
Me.Label_Width.TabIndex = 10 Me.Label_Width.TabIndex = 10
Me.Label_Width.Text = "Width" Me.Label_Width.Text = "Width"
' '
@ -340,7 +361,7 @@ Partial Class Individual
Me.Label_Length.Location = New System.Drawing.Point(69, 490) Me.Label_Length.Location = New System.Drawing.Point(69, 490)
Me.Label_Length.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label_Length.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label_Length.Name = "Label_Length" Me.Label_Length.Name = "Label_Length"
Me.Label_Length.Size = New System.Drawing.Size(52, 17) Me.Label_Length.Size = New System.Drawing.Size(60, 20)
Me.Label_Length.TabIndex = 9 Me.Label_Length.TabIndex = 9
Me.Label_Length.Text = "Length" Me.Label_Length.Text = "Length"
' '
@ -351,7 +372,7 @@ Partial Class Individual
Me.Label_Type.Location = New System.Drawing.Point(85, 124) Me.Label_Type.Location = New System.Drawing.Point(85, 124)
Me.Label_Type.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label_Type.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label_Type.Name = "Label_Type" Me.Label_Type.Name = "Label_Type"
Me.Label_Type.Size = New System.Drawing.Size(40, 16) Me.Label_Type.Size = New System.Drawing.Size(45, 20)
Me.Label_Type.TabIndex = 8 Me.Label_Type.TabIndex = 8
Me.Label_Type.Text = "Type" Me.Label_Type.Text = "Type"
' '
@ -521,7 +542,7 @@ Partial Class Individual
Me.Label_Recesses.Location = New System.Drawing.Point(439, 44) Me.Label_Recesses.Location = New System.Drawing.Point(439, 44)
Me.Label_Recesses.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label_Recesses.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label_Recesses.Name = "Label_Recesses" Me.Label_Recesses.Name = "Label_Recesses"
Me.Label_Recesses.Size = New System.Drawing.Size(88, 20) Me.Label_Recesses.Size = New System.Drawing.Size(106, 25)
Me.Label_Recesses.TabIndex = 16 Me.Label_Recesses.TabIndex = 16
Me.Label_Recesses.Text = "Recesses" Me.Label_Recesses.Text = "Recesses"
' '
@ -543,7 +564,7 @@ Partial Class Individual
Me.Label2.Location = New System.Drawing.Point(85, 769) Me.Label2.Location = New System.Drawing.Point(85, 769)
Me.Label2.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label2.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label2.Name = "Label2" Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(13, 13) Me.Label2.Size = New System.Drawing.Size(16, 17)
Me.Label2.TabIndex = 1 Me.Label2.TabIndex = 1
Me.Label2.Text = "L" Me.Label2.Text = "L"
' '
@ -554,31 +575,10 @@ Partial Class Individual
Me.Label1.Location = New System.Drawing.Point(17, 708) Me.Label1.Location = New System.Drawing.Point(17, 708)
Me.Label1.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.Label1.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label1.Name = "Label1" Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(18, 13) Me.Label1.Size = New System.Drawing.Size(21, 17)
Me.Label1.TabIndex = 0 Me.Label1.TabIndex = 0
Me.Label1.Text = "W" Me.Label1.Text = "W"
' '
'ComboBox_Frame
'
Me.ComboBox_Frame.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.ComboBox_Frame.FormattingEnabled = True
Me.ComboBox_Frame.Location = New System.Drawing.Point(147, 656)
Me.ComboBox_Frame.Margin = New System.Windows.Forms.Padding(4)
Me.ComboBox_Frame.Name = "ComboBox_Frame"
Me.ComboBox_Frame.Size = New System.Drawing.Size(205, 24)
Me.ComboBox_Frame.TabIndex = 33
'
'Label8
'
Me.Label8.AutoSize = True
Me.Label8.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label8.Location = New System.Drawing.Point(53, 656)
Me.Label8.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
Me.Label8.Name = "Label8"
Me.Label8.Size = New System.Drawing.Size(81, 17)
Me.Label8.TabIndex = 34
Me.Label8.Text = "Frame WxH"
'
'Individual 'Individual
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!)

View File

@ -65,6 +65,7 @@ Public Class Individual
Me.Panel_Data.BackColor = Color.Salmon Me.Panel_Data.BackColor = Color.Salmon
Me.Panel_Recesses.BackColor = Color.LightPink Me.Panel_Recesses.BackColor = Color.LightPink
' --- Max Load ---
Dim LabelTemp As New Label With { Dim LabelTemp As New Label With {
.Name = "Label_Max_Load", .Name = "Label_Max_Load",
.Text = "Max Load", .Text = "Max Load",
@ -96,6 +97,38 @@ Public Class Individual
} }
Me.Panel_Data.Controls.Add(LabelTemp2) Me.Panel_Data.Controls.Add(LabelTemp2)
' --- Max Grating weight ---
Dim LabelTemp3 As New Label With {
.Name = "Label_Max_Weight",
.Text = "Max Grating Weight",
.Left = 20,
.Top = 550,
.AutoSize = True,
.Font = New Font("Microsoft Sans Serif", 10)
}
Me.Panel_Data.Controls.Add(LabelTemp3)
Dim textBoxTemp2 As New TextBox With {
.Name = "TextBox_Max_Weight",
.Text = "70",
.Left = 110,
.Top = 550,
.Width = 155,
.Font = New Font("Microsoft Sans Serif", 8),
.Enabled = False
}
AddHandler textBoxTemp2.KeyPress, AddressOf TextBox_Max_Load_KeyPress
Me.Panel_Data.Controls.Add(textBoxTemp2)
Dim LabelTemp4 As New Label With {
.Name = "Label_Max_Weight_Unit",
.Text = "kg",
.Left = 269,
.Top = 554,
.Font = New Font("Microsoft Sans Serif", 8)
}
Me.Panel_Data.Controls.Add(LabelTemp4)
Dim calculateButton As New Button With { Dim calculateButton As New Button With {
.Name = "Button_Calculate", .Name = "Button_Calculate",
.Text = "Calculate", .Text = "Calculate",
@ -208,6 +241,22 @@ Public Class Individual
User_Input.Check_IfNumber(e) User_Input.Check_IfNumber(e)
End Sub End Sub
Private Sub TextBox_Length_Leave(sender As Object, e As EventArgs) Handles TextBox_Length.Leave
If TextBox_Length.Text <> "" Then
If AppForm.fillMode Then
If CInt(TextBox_Length.Text) < 300 Then
MessageBox.Show("Length must be at least 300 [mm]")
TextBox_Length.Focus()
End If
Else
If CInt(TextBox_Length.Text) < 300 OrElse CInt(TextBox_Length.Text) > 6000 Then
MessageBox.Show("Length must be at least 300 [mm] and max 6000 [mm]")
TextBox_Length.Focus()
End If
End If
End If
End Sub
' --- Check if max laod is a number --- ' --- Check if max laod is a number ---
Public Sub TextBox_Max_Load_KeyPress(sender As Object, e As KeyPressEventArgs) Public Sub TextBox_Max_Load_KeyPress(sender As Object, e As KeyPressEventArgs)
User_Input.Check_IfNumber(e) User_Input.Check_IfNumber(e)
@ -398,5 +447,4 @@ Public Class Individual
Main_Menu.Show() Main_Menu.Show()
End Sub End Sub
End Class End Class

View File

@ -3,51 +3,51 @@
Public Class Main_Menu Public Class Main_Menu
Private Sub Generate_Folders() Private Sub Generate_Folders()
Settings.folderPaths.Add("object_" & Data.objectNum, Settings.folderPaths("order") & "\Object " & Data.objectNum) 'FIXA Settings.folderPaths.Add("object_" & Data.objectNum, Settings.folderPaths("order") & "\Object " & Data.objectNum)
System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum)) System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum))
' 3D-Models ' 3D-Models
Settings.folderPaths.Add("object_" & Data.objectNum & "_models3D", Settings.folderPaths("object_" & Data.objectNum) & "\3D-Models") 'FIXA Settings.folderPaths.Add("object_" & Data.objectNum & "_models3D", Settings.folderPaths("object_" & Data.objectNum) & "\3D-Models")
System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_models3D")) System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_models3D"))
Settings.folderPaths.Add("object_" & Data.objectNum & "_models3D_gratings", Settings.folderPaths("object_" & Data.objectNum & "_models3D") & "\Floor Gratings") 'FIXA Settings.folderPaths.Add("object_" & Data.objectNum & "_models3D_gratings", Settings.folderPaths("object_" & Data.objectNum & "_models3D") & "\Floor Gratings")
System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings")) System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings"))
Settings.folderPaths.Add("object_" & Data.objectNum & "_models3D_gratings_sw", Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings") & "\SLD") 'FIXA Settings.folderPaths.Add("object_" & Data.objectNum & "_models3D_gratings_sw", Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings") & "\SLD")
System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw")) System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw"))
Settings.folderPaths.Add("object_" & Data.objectNum & "_models3D_gratings_sw_support", Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw") & "\Support Models") 'FIXA Settings.folderPaths.Add("object_" & Data.objectNum & "_models3D_gratings_sw_support", Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw") & "\Support Models")
System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support")) System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support"))
Settings.folderPaths.Add("object_" & Data.objectNum & "_models3D_gratings_stp", Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings") & "\STP") 'FIXA Settings.folderPaths.Add("object_" & Data.objectNum & "_models3D_gratings_stp", Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings") & "\STP")
System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_stp")) System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_stp"))
Settings.folderPaths.Add("object_" & Data.objectNum & "_models3D_frames", Settings.folderPaths("object_" & Data.objectNum & "_models3D") & "\Frames") 'FIXA Settings.folderPaths.Add("object_" & Data.objectNum & "_models3D_frames", Settings.folderPaths("object_" & Data.objectNum & "_models3D") & "\Frames")
System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames")) System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames"))
Settings.folderPaths.Add("object_" & Data.objectNum & "_models3D_frames_sw", Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames") & "\SLD") 'FIXA Settings.folderPaths.Add("object_" & Data.objectNum & "_models3D_frames_sw", Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames") & "\SLD")
System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw")) System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw"))
Settings.folderPaths.Add("object_" & Data.objectNum & "_models3D_frames_sw_support", Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw") & "\Support Models") 'FIXA Settings.folderPaths.Add("object_" & Data.objectNum & "_models3D_frames_sw_support", Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw") & "\Support Models")
System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw_support")) System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw_support"))
Settings.folderPaths.Add("object_" & Data.objectNum & "_models3D_frames_stp", Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames") & "\STP") 'FIXA Settings.folderPaths.Add("object_" & Data.objectNum & "_models3D_frames_stp", Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames") & "\STP")
System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames_stp")) System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames_stp"))
' Drawings ' Drawings
Settings.folderPaths.Add("object_" & Data.objectNum & "_drawings", Settings.folderPaths("object_" & Data.objectNum) & "\Drawings") 'FIXA Settings.folderPaths.Add("object_" & Data.objectNum & "_drawings", Settings.folderPaths("object_" & Data.objectNum) & "\Drawings")
System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_drawings")) System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_drawings"))
Settings.folderPaths.Add("object_" & Data.objectNum & "_drawings_gratings", Settings.folderPaths("object_" & Data.objectNum & "_drawings") & "\Floor Gratings") 'FIXA Settings.folderPaths.Add("object_" & Data.objectNum & "_drawings_gratings", Settings.folderPaths("object_" & Data.objectNum & "_drawings") & "\Floor Gratings")
System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_drawings_gratings")) System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_drawings_gratings"))
Settings.folderPaths.Add("object_" & Data.objectNum & "_drawings_gratings_sw", Settings.folderPaths("object_" & Data.objectNum & "_drawings_gratings") & "\SLD") 'FIXA Settings.folderPaths.Add("object_" & Data.objectNum & "_drawings_gratings_sw", Settings.folderPaths("object_" & Data.objectNum & "_drawings_gratings") & "\SLD")
System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_drawings_gratings_sw")) System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_drawings_gratings_sw"))
Settings.folderPaths.Add("object_" & Data.objectNum & "_drawings_gratings_pdf", Settings.folderPaths("object_" & Data.objectNum & "_drawings_gratings") & "\PDF") 'FIXA Settings.folderPaths.Add("object_" & Data.objectNum & "_drawings_gratings_pdf", Settings.folderPaths("object_" & Data.objectNum & "_drawings_gratings") & "\PDF")
System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_drawings_gratings_pdf")) System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_drawings_gratings_pdf"))
Settings.folderPaths.Add("object_" & Data.objectNum & "_drawings_frames", Settings.folderPaths("object_" & Data.objectNum & "_drawings") & "\Frames") 'FIXA Settings.folderPaths.Add("object_" & Data.objectNum & "_drawings_frames", Settings.folderPaths("object_" & Data.objectNum & "_drawings") & "\Frames")
System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_drawings_frames")) System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_drawings_frames"))
Settings.folderPaths.Add("object_" & Data.objectNum & "_drawings_frames_sw", Settings.folderPaths("object_" & Data.objectNum & "_drawings_frames") & "\SLD") 'FIXA Settings.folderPaths.Add("object_" & Data.objectNum & "_drawings_frames_sw", Settings.folderPaths("object_" & Data.objectNum & "_drawings_frames") & "\SLD")
System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_drawings_frames_sw")) System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_drawings_frames_sw"))
Settings.folderPaths.Add("object_" & Data.objectNum & "_drawings_frames_pdf", Settings.folderPaths("object_" & Data.objectNum & "_drawings_frames") & "\PDF") 'FIXA Settings.folderPaths.Add("object_" & Data.objectNum & "_drawings_frames_pdf", Settings.folderPaths("object_" & Data.objectNum & "_drawings_frames") & "\PDF")
System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_drawings_frames_pdf")) System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_drawings_frames_pdf"))
' Quote ' Quote
Settings.folderPaths.Add("object_" & Data.objectNum & "_quote", Settings.folderPaths("object_" & Data.objectNum) & "\Quote") 'FIXA Settings.folderPaths.Add("object_" & Data.objectNum & "_quote", Settings.folderPaths("object_" & Data.objectNum) & "\Quote")
System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_quote")) System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_quote"))
' Placement Guides ' Placement Guides
Settings.folderPaths.Add("object_" & Data.objectNum & "_guide", Settings.folderPaths("object_" & Data.objectNum) & "\Placement Guides") 'FIXA Settings.folderPaths.Add("object_" & Data.objectNum & "_guide", Settings.folderPaths("object_" & Data.objectNum) & "\Placement Guides")
System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_guide")) System.IO.Directory.CreateDirectory(Settings.folderPaths("object_" & Data.objectNum & "_guide"))
End Sub End Sub
Private Sub Button_Individual_Click(sender As Object, e As EventArgs) Handles Button_Individual.Click Private Sub Button_Individual_Click(sender As Object, e As EventArgs) Handles Button_Individual.Click
@ -56,6 +56,12 @@ Public Class Main_Menu
RemoveHandler Individual.Panel_Data.Controls("TextBox_Max_Load").KeyPress, AddressOf Individual.TextBox_Max_Load_KeyPress RemoveHandler Individual.Panel_Data.Controls("TextBox_Max_Load").KeyPress, AddressOf Individual.TextBox_Max_Load_KeyPress
Individual.Panel_Data.Controls.RemoveByKey("TextBox_Max_Load") Individual.Panel_Data.Controls.RemoveByKey("TextBox_Max_Load")
Individual.Panel_Data.Controls.RemoveByKey("Label_Max_Load_Unit") Individual.Panel_Data.Controls.RemoveByKey("Label_Max_Load_Unit")
Individual.Panel_Data.Controls.RemoveByKey("Label_Max_Weight")
RemoveHandler Individual.Panel_Data.Controls("TextBox_Max_Weight").KeyPress, AddressOf Individual.TextBox_Max_Load_KeyPress
Individual.Panel_Data.Controls.RemoveByKey("TextBox_Max_Weight")
Individual.Panel_Data.Controls.RemoveByKey("Label_Max_Weight_Unit")
RemoveHandler Individual.Panel_Data.Controls("Button_Calculate").Click, AddressOf Individual.Button_Calculate_Click RemoveHandler Individual.Panel_Data.Controls("Button_Calculate").Click, AddressOf Individual.Button_Calculate_Click
Individual.Panel_Data.Controls.RemoveByKey("Button_Calculate") Individual.Panel_Data.Controls.RemoveByKey("Button_Calculate")
End If End If

View File

@ -34,23 +34,30 @@
Return Data.gratingW Return Data.gratingW
End Function End Function
Private Shared Function Get_Max_Length(gratingMaxWidth As Integer) Private Shared Function Get_Max_Length(gratingMaxWidth As Integer)
' Funkar just nu bara för pressure welded (ty diameter) Dim maxWeight As Double = CDbl(Individual.Panel_Data.Controls("TextBox_Max_Weight").Text)
Dim loadBarHeight As Integer = 25 Dim loadBarHeight As Integer = 25
Dim loadBarThickness As Integer = 2 Dim loadBarThickness As Integer = 2
Dim crossBarDiameter As Integer = 5
Dim loadBarWeight As Double = 0.385 ' För 1x1 m Dim loadBarWeight As Double = 0
Dim crossBarWeight As Double = 0.153 ' För 1x1 m Dim crossBarWeight As Double = 0
Dim maxWeight As Double = 70 ' FIXA: Sätta i GUI? If User_Input.gratingType = "Pressure Welded" Then
loadBarWeight = 0.385 ' För 1x1 m
If User_Input.CBDiameter = 5 Then
crossBarWeight = 0.153 ' För 1x1 m
Else
crossBarWeight = 0.259 ' För 1x1 m
End If
Else ' Type-A
crossBarWeight = 0.312 ' För 1x1 m
loadBarWeight = 0.337 ' För 1x1 m
End If
Dim LBHdiff As Double = 1 + (User_Input.gratingHeight - loadBarHeight) / loadBarHeight Dim LBHdiff As Double = 1 + (User_Input.gratingHeight - loadBarHeight) / loadBarHeight
loadBarWeight *= LBHdiff loadBarWeight *= LBHdiff
Dim LBTdiff As Double = 1 + (User_Input.loadBarThickness - loadBarThickness) / loadBarThickness Dim LBTdiff As Double = 1 + (User_Input.loadBarThickness - loadBarThickness) / loadBarThickness
loadBarWeight *= LBTdiff loadBarWeight *= LBTdiff
Dim CBDdiff As Double = 1 + (User_Input.CBDiameter - crossBarDiameter) / crossBarDiameter
crossBarWeight *= CBDdiff
Dim numOfLB As Integer = 1 + Math.Floor((1000 - User_Input.loadBarSpacing) / User_Input.loadBarSpacing) Dim numOfLB As Integer = 1 + Math.Floor((1000 - User_Input.loadBarSpacing) / User_Input.loadBarSpacing)
Dim numOfCB As Integer = 1 + Math.Floor((1000 - User_Input.crossBarSpacing) / User_Input.crossBarSpacing) Dim numOfCB As Integer = 1 + Math.Floor((1000 - User_Input.crossBarSpacing) / User_Input.crossBarSpacing)
@ -151,9 +158,6 @@
Dim loadName As String = User_Input.gratingName.Substring(0, 1) Dim loadName As String = User_Input.gratingName.Substring(0, 1)
If User_Input.gratingName.Substring(User_Input.gratingName.Length - 1, 1) = "T" Then If User_Input.gratingName.Substring(User_Input.gratingName.Length - 1, 1) = "T" Then
loadName += "-T" loadName += "-T"
If loadName = "F-T" Then
loadName = "H-T" ' Fixa: Tillfällig det inte finns load data för F-T
End If
ElseIf loadName = "A" Then ElseIf loadName = "A" Then
loadName += User_Input.gratingMesh.Split(" ")(0) loadName += User_Input.gratingMesh.Split(" ")(0)
End If End If

View File

@ -8,32 +8,6 @@ Public Class Database
Dim excelApp As Excel.Application = New Excel.Application Dim excelApp As Excel.Application = New Excel.Application
Dim excelWB As Excel.Workbook Dim excelWB As Excel.Workbook
' --- READ EXCEL FILE DATA FROM .TXT FILES ---
'Dim excelData As String() = System.IO.File.ReadAllLines("C:\Users\Anton\Documents\Exjobb\Inspo\excelData.txt")
'excelWB = excelApp.Workbooks.Open("C:\Users\Anton\Documents\Exjobb\Inspo\loadData.xlsx")
'Dim activeSheet As Excel.Worksheet
'activeSheet = excelWB.Sheets(1)
'For i = 0 To excelData.Length - 1
' If i Mod 2 = 1 Then
' Dim words As String() = excelData(i).Split(" ")
' For j = 1 To words.Length - 1
' activeSheet.Cells(Math.Floor(i / 2) + 1, j).Value = words(j)
' Next
' End If
'Next
'excelWB.Save()
'excelWB.Close()
'excelApp.Quit()
'System.Runtime.InteropServices.Marshal.ReleaseComObject(excelWB)
'System.Runtime.InteropServices.Marshal.ReleaseComObject(excelApp)
' Make .csv files of each sheet in Excel ' Make .csv files of each sheet in Excel
excelApp.DisplayAlerts = False excelApp.DisplayAlerts = False
Dim wSNames As New List(Of String) Dim wSNames As New List(Of String)
@ -52,12 +26,6 @@ Public Class Database
System.Runtime.InteropServices.Marshal.ReleaseComObject(excelWB) System.Runtime.InteropServices.Marshal.ReleaseComObject(excelWB)
System.Runtime.InteropServices.Marshal.ReleaseComObject(excelApp) System.Runtime.InteropServices.Marshal.ReleaseComObject(excelApp)
' USe this when all sheets are to be read
'For Each WS In excelWB.Worksheets
' WS.SaveAs(GUI_Settings.HLCtFolder & ("\") & WS.Name, Excel.XlFileFormat.xlCSV)
'Next
' Read all .csv files to local database ' Read all .csv files to local database
For i = 0 To wSNames.Count - 1 For i = 0 To wSNames.Count - 1
Dim tempDT As New DataTable With { Dim tempDT As New DataTable With {

View File

@ -1,228 +0,0 @@

Public Class Grating_Fill2
Public Shared maxSingleWidth, maxSingleLength As Integer
Public Shared numOfHorizontal, numOfVertical As Integer
Public Shared widthRevNeeded, lengthRevNeeded As Boolean
Public Shared revLength, revWidth As Integer
Public Shared minLength As Integer
Public Shared gratingDimensions As New DataTable
Public Shared Sub Calculate_Grid()
Calculate_Fill_Grid.Calculate_Grid() 'FIXA: TA BORT
Get_SingleGratingMaxDimensions()
gratingDimensions.Clear()
gratingDimensions.Columns.Clear()
gratingDimensions.Columns.Add("INDEX", GetType(Integer))
gratingDimensions.Columns.Add("ROW", GetType(Integer))
gratingDimensions.Columns.Add("COLUMN", GetType(Integer))
gratingDimensions.Columns.Add("WIDTH", GetType(Integer))
gratingDimensions.Columns.Add("LENGTH", GetType(Integer))
If (Data.gratingL / maxSingleLength) Mod 1 = 0 Then
numOfHorizontal = Data.gratingL / maxSingleLength
Else
numOfHorizontal = Math.Floor(Data.gratingL / maxSingleLength) + 1
End If
If (Data.gratingW / maxSingleWidth) Mod 1 = 0 Then
numOfVertical = Data.gratingW / maxSingleWidth
Else
numOfVertical = Math.Floor(Data.gratingW / maxSingleWidth) + 1
End If
minLength = (Math.Floor((Data.gratingL / 100) / numOfHorizontal) + 1) * 100
If minLength > 1600 AndAlso (minLength / 100) Mod 2 = 1 Then
minLength += 100
End If
If minLength > maxSingleLength Then
minLength = maxSingleLength
End If
Dim endLength As Integer = Data.gratingL - (numOfHorizontal - 1) * minLength
'If Data.gratingL - (numOfHorizontal - 1) * maxSingleLength < 200 Then
' endLength = 200
' revLength = maxSingleLength - (endLength - (Data.gratingL - (numOfHorizontal - 1) * maxSingleLength))
' lengthRevNeeded = True
'Else
' endLength = Data.gratingL - (numOfHorizontal - 1) * maxSingleLength
' lengthRevNeeded = False
'End If
Dim endWidth As Integer
If Data.gratingW - (numOfVertical - 1) * maxSingleWidth < 200 Then
Dim neededLoadbars As Integer = Math.Floor((200 - (Data.gratingW - (numOfVertical - 1) * maxSingleWidth)) / User_Input.loadBarSpacing) + 1
endWidth = Data.gratingW - (numOfVertical - 1) * maxSingleWidth + neededLoadbars * User_Input.loadBarSpacing
revWidth = maxSingleWidth - (endWidth - (Data.gratingW - (numOfVertical - 1) * maxSingleWidth))
widthRevNeeded = True
Else
endWidth = Data.gratingW - (numOfVertical - 1) * maxSingleWidth
widthRevNeeded = False
End If
Dim row As Integer = 1
For i = 0 To numOfHorizontal * numOfVertical - 1
Dim tempDR As DataRow = gratingDimensions.NewRow
tempDR("INDEX") = i
tempDR("ROW") = row - 1
tempDR("COLUMN") = i - numOfHorizontal * (row - 1)
If CDbl((i + 1) / numOfHorizontal) = row Then
tempDR("LENGTH") = endLength
row += 1
'ElseIf CDbl((i + 2) / numOfHorizontal) = row AndAlso lengthRevNeeded Then
' tempDR("LENGTH") = revLength
Else
tempDR("LENGTH") = minLength
End If
If i > numOfHorizontal * numOfVertical - 1 - numOfHorizontal Then
tempDR("WIDTH") = endWidth
ElseIf i > numOfHorizontal * numOfVertical - 1 - 2 * numOfHorizontal AndAlso widthRevNeeded Then
tempDR("WIDTH") = revWidth
Else
tempDR("WIDTH") = maxSingleWidth
End If
gratingDimensions.Rows.Add(tempDR)
Next
'Individual.Panel_Grating.Refresh()
End Sub
Private Shared Sub Get_SingleGratingMaxDimensions()
maxSingleWidth = Database.database.Tables("Whole Meshes").Rows(0)(User_Input.wholeMeshesColumn)
Dim loadDT As DataTable = Database.database.Tables("LOAD")
Dim nameInDT As String = loadDT.Rows(0)("NAME")
Dim LBHeightInDT As Integer = loadDT.Rows(0)("LB-HEIGHT")
Dim LBThicknessInDT As Integer = loadDT.Rows(0)("LB-THICKNESS")
Dim loadName As String = User_Input.gratingName.Substring(0, 1)
If User_Input.gratingName.Substring(User_Input.gratingName.Length - 1, 1) = "T" Then
loadName += "-T"
If loadName = "F-T" Then
loadName = "H-T" ' Fixa: Tillfällig det inte finns load data för F-T
End If
ElseIf loadName = "A" Then
loadName += User_Input.gratingMesh.Split(" ")(0)
End If
For i = 0 To loadDT.Rows.Count - 1
If loadName = nameInDT AndAlso User_Input.gratingHeight = LBHeightInDT _
AndAlso User_Input.loadBarThickness = LBThicknessInDT Then
For j = loadDT.Columns.Count - 1 To 0 Step -1
If loadDT.Rows(i)(j) > CInt(Individual.Panel_Data.Controls("TextBox_Max_Load").Text) Then
maxSingleLength = CInt(loadDT.Columns(j).ColumnName)
Exit For
End If
Next
Exit For
End If
Try
nameInDT = loadDT.Rows(i + 1)("NAME")
LBHeightInDT = loadDT.Rows(i + 1)("LB-HEIGHT")
LBThicknessInDT = loadDT.Rows(i + 1)("LB-THICKNESS")
Catch ex As Exception
End Try
Next
End Sub
' Not used because of better method found
Public Shared Sub Calculate_Recesses()
Dim cornerAngleCounter As Integer = 0
For k = 0 To Data.recessData.Rows.Count - 1
If Data.recessData.Rows(k)("RECESS TYPE") = "ANGLE" Then
cornerAngleCounter += 1
For i = 1 To 2
Dim pX, pY As Integer
For Each gDR As DataRow In Data.gratingPoints.Rows
If gDR("NAME") = "CA" & cornerAngleCounter & "_" & i Then
pX = Data.gratingL / 2 + CInt(gDR("X") * 1000)
pY = Data.gratingW / 2 - CInt(gDR("Y") * 1000)
Exit For
End If
Next
Dim colIndex As Integer
For j = 0 To numOfHorizontal - 1
If pX >= j * minLength AndAlso pX <= (j + 1) * minLength Then
colIndex = j
Exit For
End If
Next
Dim rowIndex As Integer
For j = 0 To numOfVertical - 1
If widthRevNeeded AndAlso j = numOfVertical - 2 AndAlso pY >= j * maxSingleWidth AndAlso pY <= j * maxSingleWidth + revWidth Then
rowIndex = j
Exit For
ElseIf widthRevNeeded AndAlso j = numOfVertical - 1 Then
rowIndex = j
Exit For
ElseIf widthRevNeeded = False AndAlso pY >= j * maxSingleWidth AndAlso pY <= (j + 1) * maxSingleWidth Then
rowIndex = j
Exit For
End If
Next
Dim gratingIndex As Integer = rowIndex * numOfHorizontal + colIndex
Dim tempList As New List(Of Integer)
Try
tempList = Data.recessData.Rows(k)("GRATINGS")
Catch ex As Exception
End Try
Dim indexNotAdded As Boolean = True
For j = 0 To tempList.Count - 1
If gratingIndex = tempList(j) Then
indexNotAdded = False
Exit For
End If
Next
If indexNotAdded Then
tempList.Add(gratingIndex)
End If
Data.recessData.Rows(k)("GRATINGS") = tempList
Next
Dim tempList2 As New List(Of Integer)
Try
tempList2 = Data.recessData.Rows(k)("GRATINGS")
Catch ex As Exception
End Try
Dim gratingIndex2 As Integer
If Data.recessData.Rows(k)("CORNER") = 1 Then
gratingIndex2 = 0
ElseIf Data.recessData.Rows(k)("CORNER") = 2 Then
gratingIndex2 = numOfHorizontal - 1
ElseIf Data.recessData.Rows(k)("CORNER") = 3 Then
gratingIndex2 = numOfHorizontal * numOfVertical - 1
Else
gratingIndex2 = numOfHorizontal * (numOfVertical - 1)
End If
Dim indexNotAdded2 As Boolean = True
For j = 0 To tempList2.Count - 1
If gratingIndex2 = tempList2(j) Then
indexNotAdded2 = False
Exit For
End If
Next
If indexNotAdded2 Then
tempList2.Add(gratingIndex2)
End If
Data.recessData.Rows(k)("GRATINGS") = tempList2
End If
Next
End Sub
End Class

View File

@ -108,7 +108,6 @@
gratingLacquered = False gratingLacquered = False
End If End If
' Untreated finns för alla som är varmförzinkade enligt Jakob Teams
Update_AvalaibleMeshes() Update_AvalaibleMeshes()
End Sub End Sub
@ -123,8 +122,6 @@
End Sub End Sub
Private Shared Sub CheckBox_Lacquered_CheckedChanged(sender As Object, e As EventArgs) Private Shared Sub CheckBox_Lacquered_CheckedChanged(sender As Object, e As EventArgs)
'Här hanterar vi om den är lackad eller inte
'påverkar ej övrig kod (förutom kommentar att det är special order)
If sender.Checked Then If sender.Checked Then
gratingLacquered = True gratingLacquered = True
Else Else
@ -407,21 +404,17 @@
Public Shared Sub LengthChanged(sender As Object, e As EventArgs) Public Shared Sub LengthChanged(sender As Object, e As EventArgs)
If Individual.TextBox_Length.Text <> "" Then If Individual.TextBox_Length.Text <> "" Then
If AppForm.fillMode Then If AppForm.fillMode Then
If CInt(Individual.TextBox_Length.Text) >= 200 Then If CInt(Individual.TextBox_Length.Text) >= 300 Then
Data.gratingL = CInt(Individual.TextBox_Length.Text) Data.gratingL = CInt(Individual.TextBox_Length.Text)
Draw_Grating.Update_GratingPoints() Draw_Grating.Update_GratingPoints()
Else Enable_Buttons()
'Message: Out of boundary
End If End If
Enable_Buttons()
Else Else
If CInt(Individual.TextBox_Length.Text) >= 200 AndAlso CInt(Individual.TextBox_Length.Text) <= 6000 Then If CInt(Individual.TextBox_Length.Text) >= 300 AndAlso CInt(Individual.TextBox_Length.Text) <= 6000 Then
Data.gratingL = CInt(Individual.TextBox_Length.Text) Data.gratingL = CInt(Individual.TextBox_Length.Text)
Draw_Grating.Update_GratingPoints() Draw_Grating.Update_GratingPoints()
Else Enable_Buttons()
'Message: Out of boundary
End If End If
Enable_Buttons()
End If End If
End If End If
End Sub End Sub
@ -446,6 +439,7 @@
Individual.Button_Square_Middle.Enabled = True Individual.Button_Square_Middle.Enabled = True
Individual.Panel_Data.Controls("TextBox_Max_Load").Enabled = True Individual.Panel_Data.Controls("TextBox_Max_Load").Enabled = True
Individual.Panel_Data.Controls("TextBox_Max_Weight").Enabled = True
End If End If
Else Else
If Individual.ComboBox_Width.Text <> "" AndAlso Individual.TextBox_Length.Text <> "" Then If Individual.ComboBox_Width.Text <> "" AndAlso Individual.TextBox_Length.Text <> "" Then
@ -514,8 +508,8 @@
gratingTable.Rows(0)("TYPE") = "type_a" gratingTable.Rows(0)("TYPE") = "type_a"
End If End If
gratingTable.Rows(0)("CROSSBAR_DIAMETER") = 0 gratingTable.Rows(0)("CROSSBAR_DIAMETER") = 0
gratingTable.Rows(0)("CROSSBAR_THICKNESS") = 2 'CBThickness FIXA gratingTable.Rows(0)("CROSSBAR_THICKNESS") = CBThickness
gratingTable.Rows(0)("CROSSBAR_HEIGHT") = 20 'CBHeight FIXA gratingTable.Rows(0)("CROSSBAR_HEIGHT") = CBHeight
End If End If
Return gratingTable Return gratingTable

View File

@ -256,7 +256,7 @@ Public Class GUI_Export
End Sub End Sub
Public Shared Function Get_RandomNumber(Min As Integer, Max As Integer) As Integer ' Public Shared Function Get_RandomNumber(Min As Integer, Max As Integer) As Integer
Static Generator As System.Random = New System.Random() Static Generator As System.Random = New System.Random()
Return Generator.Next(Min, Max) Return Generator.Next(Min, Max)
End Function End Function

View File

@ -7,21 +7,6 @@ Public Class Frame_Drawing
Dim model As ModelDoc2 Dim model As ModelDoc2
Dim assembly As IAssemblyDoc Dim assembly As IAssemblyDoc
Dim longstatus As Integer Dim longstatus As Integer
'If AppForm.fillMode = True Then
' If User_Input.add3DGrating = True Then
' frameComponents = Multiple_3D.partDT.Select("partType = 'frame_l_straight'")
' Else
' frameComponents = Multiple_3D_Simplified.partDT.Select("partType = 'frame_l_straight'")
' End If
'Else
' If User_Input.add3DGrating = True Then
' frameComponents = Individual_3D.partDT.Select("partType = 'frame_l_straight'")
' Else
' frameComponents = Individual_3D_Simplified.partDT.Select("partType = 'frame_l_straight'")
' End If
'End If
For i = 0 To Frame_3D.cuttingList.Count - 1 For i = 0 To Frame_3D.cuttingList.Count - 1
model = swApp.NewDocument("C:\ProgramData\SolidWorks\SOLIDWORKS 2020\templates\Assembly.asmdot", 0, 0, 0) model = swApp.NewDocument("C:\ProgramData\SolidWorks\SOLIDWORKS 2020\templates\Assembly.asmdot", 0, 0, 0)
@ -132,7 +117,7 @@ Public Class Frame_Drawing
If j = Frame_3D.cuttingList.ElementAt(i).Value.Count Then If j = Frame_3D.cuttingList.ElementAt(i).Value.Count Then
frameComponentName = "FRAME_L_END_PIECE" & i + 1 frameComponentName = "FRAME_L_END_PIECE" & i + 1
Else Else
frameComponentName = "FRAME_L_STRAIGHT_" & Frame_3D.cuttingList.ElementAt(i).Value(j) 'frameComponents(Frame_3D.cuttingList.ElementAt(i).Value(j) - 1)("partName") frameComponentName = "FRAME_L_STRAIGHT_" & Frame_3D.cuttingList.ElementAt(i).Value(j)
End If End If
Dim plane1Name As String = "OffPlane1@" & CompName & "@" & myView.GetName2 & "/" & frameComponentName & "-1@" & CompName.Split("-")(0) Dim plane1Name As String = "OffPlane1@" & CompName & "@" & myView.GetName2 & "/" & frameComponentName & "-1@" & CompName.Split("-")(0)

View File

@ -73,7 +73,6 @@ Public Class Individual_Drawing
swSkMgr.InsertSketch(True) swSkMgr.InsertSketch(True)
Model.ClearSelection2(True) Model.ClearSelection2(True)
'For Each DR As DataRow In Data.gratingMiddlePoints.Rows
For j = 0 To 3 For j = 0 To 3
Dim skPoint As SketchPoint Dim skPoint As SketchPoint
Dim pX = Data.gratingMiddlePoints.Rows(i * 4 + j)("X") Dim pX = Data.gratingMiddlePoints.Rows(i * 4 + j)("X")
@ -81,7 +80,6 @@ Public Class Individual_Drawing
skPoint = swSkMgr.CreatePoint(pX, pY, 0) skPoint = swSkMgr.CreatePoint(pX, pY, 0)
Next Next
'For Each DR1 As DataRow In Data.gratingMiddlePoints.Rows
For j = 0 To 3 For j = 0 To 3
Dim skLine As SketchLine Dim skLine As SketchLine
Dim pX1 = Data.gratingMiddlePoints.Rows(i * 4 + j)("X") Dim pX1 = Data.gratingMiddlePoints.Rows(i * 4 + j)("X")
@ -111,9 +109,6 @@ Public Class Individual_Drawing
boolstatus = Model.Extension.SelectByID2("Front Plane", "PLANE", 0, 0, 0, False, 0, Nothing, 0) boolstatus = Model.Extension.SelectByID2("Front Plane", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
Model.FeatureManager.InsertRefPlane(8, gratingHeight, 0, 0, 0, 0) Model.FeatureManager.InsertRefPlane(8, gratingHeight, 0, 0, 0, 0)
'boolstatus = Model.Extension.SelectByID2("Front Plane", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
'Model.ClearSelection2(True)
Dim iPart As PartDoc Dim iPart As PartDoc
iPart = swApp.ActiveDoc iPart = swApp.ActiveDoc
Dim newName As String Dim newName As String

View File

@ -18,7 +18,7 @@ Public Class Instructions
swSheet.SetProperties2(12, 12, 1, 1, False, swSheetWidth, swSheetHeight, True) swSheet.SetProperties2(12, 12, 1, 1, False, swSheetWidth, swSheetHeight, True)
swSheet.SetTemplateName(Settings.HLCtFolder & "\Files Needed\A3 Part.slddrt") swSheet.SetTemplateName(Settings.HLCtFolder & "\Files Needed\A3 Part.slddrt")
swSheet.ReloadTemplate(True) swSheet.ReloadTemplate(True)
swSheet.SetScale(1, 10, False, False) ' FIXA swSheet.SetScale(1, 10, False, False)
swSheet.SetName("Instructions") swSheet.SetName("Instructions")
Dim layMgr As LayerMgr Dim layMgr As LayerMgr
@ -40,9 +40,10 @@ Public Class Instructions
End If End If
End If End If
Dim adjustedHeightPosInSheet As Double = swSheetHeight / 2 + 0.02
Dim myView As View Dim myView As View
myView = iDrawing.CreateDrawViewFromModelView3(drawName, "*Front", swSheetWidth / 2, swSheetHeight / 2, 0) myView = iDrawing.CreateDrawViewFromModelView3(drawName, "*Front", swSheetWidth / 2, adjustedHeightPosInSheet, 0)
myView.UseSheetScale() = True myView.UseSheetScale() = True
myView.SetDisplayTangentEdges2(2) myView.SetDisplayTangentEdges2(2)
@ -142,22 +143,22 @@ Public Class Instructions
Dim length As Double = straightFramesDT.Rows(i)("LENGTH") / 1000 Dim length As Double = straightFramesDT.Rows(i)("LENGTH") / 1000
If straightFramesDT.Rows(i)("SIDE") = 1 Then If straightFramesDT.Rows(i)("SIDE") = 1 Then
worldX = swSheetWidth / 2 + (-(Data.gratingL / 1000) / 2 + offsetL - length / 2) * scale worldX = swSheetWidth / 2 + (-(Data.gratingL / 1000) / 2 + offsetL - length / 2) * scale
worldY = swSheetHeight / 2 + ((Data.gratingW / 1000) / 2 + 0.001) * scale worldY = adjustedHeightPosInSheet + ((Data.gratingW / 1000) / 2 + 0.001) * scale
offsetX = worldX - 0.01 - 0.0045 offsetX = worldX - 0.01 - 0.0045
offsetY = worldY + 0.02 + 0.0015 offsetY = worldY + 0.02 + 0.0015
ElseIf straightFramesDT.Rows(i)("SIDE") = 2 Then ElseIf straightFramesDT.Rows(i)("SIDE") = 2 Then
worldX = swSheetWidth / 2 + ((Data.gratingL / 1000) / 2 + 0.001) * scale worldX = swSheetWidth / 2 + ((Data.gratingL / 1000) / 2 + 0.001) * scale
worldY = swSheetHeight / 2 + (-(Data.gratingW / 1000) / 2 + offsetW + length / 2) * scale worldY = adjustedHeightPosInSheet + (-(Data.gratingW / 1000) / 2 + offsetW + length / 2) * scale
offsetX = worldX + 0.02 - 0.0045 offsetX = worldX + 0.02 - 0.0045
offsetY = worldY + 0.01 + 0.0015 offsetY = worldY + 0.01 + 0.0015
ElseIf straightFramesDT.Rows(i)("SIDE") = 3 Then ElseIf straightFramesDT.Rows(i)("SIDE") = 3 Then
worldX = swSheetWidth / 2 + (-(Data.gratingL / 1000) / 2 + offsetL + length / 2) * scale worldX = swSheetWidth / 2 + (-(Data.gratingL / 1000) / 2 + offsetL + length / 2) * scale
worldY = swSheetHeight / 2 - ((Data.gratingW / 1000) / 2 + 0.001) * scale worldY = adjustedHeightPosInSheet - ((Data.gratingW / 1000) / 2 + 0.001) * scale
offsetX = worldX + 0.01 - 0.0045 offsetX = worldX + 0.01 - 0.0045
offsetY = worldY - 0.02 + 0.0015 offsetY = worldY - 0.02 + 0.0015
Else Else
worldX = swSheetWidth / 2 - ((Data.gratingL / 1000) / 2 + 0.001) * scale worldX = swSheetWidth / 2 - ((Data.gratingL / 1000) / 2 + 0.001) * scale
worldY = swSheetHeight / 2 + (-(Data.gratingW / 1000) / 2 + offsetW - length / 2) * scale worldY = adjustedHeightPosInSheet + (-(Data.gratingW / 1000) / 2 + offsetW - length / 2) * scale
offsetX = worldX - 0.02 - 0.0045 offsetX = worldX - 0.02 - 0.0045
offsetY = worldY - 0.01 + 0.0015 offsetY = worldY - 0.01 + 0.0015
End If End If
@ -194,23 +195,23 @@ Public Class Instructions
For i = 0 To cornerFrames.Length - 1 For i = 0 To cornerFrames.Length - 1
If cornerFrames(i)("CORNER") = 1 Then If cornerFrames(i)("CORNER") = 1 Then
worldX = swSheetWidth / 2 - ((Data.gratingL / 1000) / 2 + 0.001) * scale worldX = swSheetWidth / 2 - ((Data.gratingL / 1000) / 2 + 0.001) * scale
worldY = swSheetHeight / 2 + ((Data.gratingW / 1000) / 2 + 0.001) * scale worldY = adjustedHeightPosInSheet + ((Data.gratingW / 1000) / 2 + 0.001) * scale
offsetX = worldX - 0.022 - 0.01 offsetX = worldX - 0.022 - 0.01
offsetY = worldY + 0.002 + 0.01 offsetY = worldY + 0.002 + 0.01
ElseIf cornerFrames(i)("CORNER") = 2 Then ElseIf cornerFrames(i)("CORNER") = 2 Then
worldX = swSheetWidth / 2 + ((Data.gratingL / 1000) / 2 + 0.001) * scale worldX = swSheetWidth / 2 + ((Data.gratingL / 1000) / 2 + 0.001) * scale
worldY = swSheetHeight / 2 + ((Data.gratingW / 1000) / 2 + 0.001) * scale worldY = adjustedHeightPosInSheet + ((Data.gratingW / 1000) / 2 + 0.001) * scale
offsetX = worldX + 0.01 offsetX = worldX + 0.01
offsetY = worldY + 0.002 + 0.01 offsetY = worldY + 0.002 + 0.01
ElseIf cornerFrames(i)("CORNER") = 3 Then ElseIf cornerFrames(i)("CORNER") = 3 Then
worldX = swSheetWidth / 2 + ((Data.gratingL / 1000) / 2 + 0.001) * scale worldX = swSheetWidth / 2 + ((Data.gratingL / 1000) / 2 + 0.001) * scale
worldY = swSheetHeight / 2 - ((Data.gratingW / 1000) / 2 + 0.001) * scale worldY = adjustedHeightPosInSheet - ((Data.gratingW / 1000) / 2 + 0.001) * scale
offsetX = worldX + 0.01 offsetX = worldX + 0.01
offsetY = worldY - 0.002 - 0.01 offsetY = worldY - 0.002 - 0.01
Else Else
worldX = swSheetWidth / 2 - ((Data.gratingL / 1000) / 2 + 0.001) * scale worldX = swSheetWidth / 2 - ((Data.gratingL / 1000) / 2 + 0.001) * scale
worldY = swSheetHeight / 2 - ((Data.gratingW / 1000) / 2 + 0.001) * scale worldY = adjustedHeightPosInSheet - ((Data.gratingW / 1000) / 2 + 0.001) * scale
offsetX = worldX - 0.022 - 0.01 offsetX = worldX - 0.022 - 0.01
offsetY = worldY - 0.002 - 0.01 offsetY = worldY - 0.002 - 0.01
End If End If
@ -276,7 +277,7 @@ Public Class Instructions
drawName = Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATINGS_ASSEMBLY_SIMPLIFIED.SLDASM" drawName = Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATINGS_ASSEMBLY_SIMPLIFIED.SLDASM"
myView = iDrawing.CreateDrawViewFromModelView3(drawName, "*Front", swSheetWidth / 2, swSheetHeight / 2, 0) myView = iDrawing.CreateDrawViewFromModelView3(drawName, "*Front", swSheetWidth / 2, adjustedHeightPosInSheet, 0)
myView.UseSheetScale() = True myView.UseSheetScale() = True
myView.SetDisplayTangentEdges2(2) myView.SetDisplayTangentEdges2(2)

View File

@ -23,7 +23,7 @@ Public Class Multiple_3D
gratingParameters = exportTable.Rows(0) gratingParameters = exportTable.Rows(0)
For i = 0 To Calculate_Fill_Grid.gratingDimensionsDT.Rows.Count - 1 For i = 0 To Calculate_Fill_Grid.gratingDimensionsDT.Rows.Count - 1
inst_ = ExternalClass.instantiate_parts(parentID, gratingParameters("TYPE"), "") ' Ange pressure_welded eller type A, Serrated? inst_ = ExternalClass.instantiate_parts(parentID, gratingParameters("TYPE"), "")
ExternalClass.modify_parameter_value("DP_LOADBAR_THICKNESS", inst_, gratingParameters("LOADBAR_THICKNESS")) ExternalClass.modify_parameter_value("DP_LOADBAR_THICKNESS", inst_, gratingParameters("LOADBAR_THICKNESS"))
ExternalClass.modify_parameter_value("DP_LOADBAR_HEIGHT", inst_, gratingParameters("LOADBAR_HEIGHT")) ExternalClass.modify_parameter_value("DP_LOADBAR_HEIGHT", inst_, gratingParameters("LOADBAR_HEIGHT"))
ExternalClass.modify_parameter_value("DP_LOADBAR_SPACING", inst_, gratingParameters("LOADBAR_SPACING")) ExternalClass.modify_parameter_value("DP_LOADBAR_SPACING", inst_, gratingParameters("LOADBAR_SPACING"))
@ -101,12 +101,7 @@ Public Class Multiple_3D
Dim status As Boolean Dim status As Boolean
Dim Assembly = swApp.ActiveDoc() Dim Assembly = swApp.ActiveDoc()
'Dim swExtensions As IModelDocExtension
'swExtensions = Assembly.Extension
'Dim Errors As Integer
'Dim Warnings As Integer
'status = swExtensions.SaveAs2(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw") & "\gratings_assembly.SLDASM",
' 0, 4, Nothing, "", True, Errors, Warnings) 'FIXA
Assembly.EditAssembly Assembly.EditAssembly
Dim Errors As Integer Dim Errors As Integer
Dim Warnings As Integer Dim Warnings As Integer
@ -317,7 +312,6 @@ Public Class Multiple_3D
Dim components = Assembly.GetComponents(True) Dim components = Assembly.GetComponents(True)
'Indent
Dim listOfBeams As New List(Of DataRow) Dim listOfBeams As New List(Of DataRow)
For i = 0 To partDT.Rows.Count - 1 For i = 0 To partDT.Rows.Count - 1
Dim partName As String Dim partName As String
@ -497,10 +491,7 @@ Public Class Multiple_3D
Next Next
Dim cutBody = gratingBodies(cutBodyIndex) Dim cutBody = gratingBodies(cutBodyIndex)
'recessBodies = components(indexRecess).GetBodies2(0)
For l = 0 To bodiesToCut.Length - 1 For l = 0 To bodiesToCut.Length - 1
' If recessBodies(l).Name <> "Cut-Body" AndAlso recessBodies(l).Name <> "Interference-Body" Then
Dim recessBody = bodiesToCut(l) Dim recessBody = bodiesToCut(l)
Assembly.ClearSelection2(True) Assembly.ClearSelection2(True)
@ -514,8 +505,6 @@ Public Class Multiple_3D
cutFace.Select4(True, sldata) cutFace.Select4(True, sldata)
Assembly.FeatureManager.InsertIndent(0.01, 0, False, True, True, False) Assembly.FeatureManager.InsertIndent(0.01, 0, False, True, True, False)
'End If
Next Next
Next Next
End If End If
@ -581,7 +570,6 @@ Public Class Multiple_3D
Dim components = Assembly.GetComponents(True) Dim components = Assembly.GetComponents(True)
'Indent
Dim listOfHorizBeams As New List(Of DataRow) Dim listOfHorizBeams As New List(Of DataRow)
Dim listOfVertBeams As New List(Of DataRow) Dim listOfVertBeams As New List(Of DataRow)
Dim counter As Integer = 1 Dim counter As Integer = 1

View File

@ -164,20 +164,6 @@ Public Class Multiple_3D_Simplified
status = swCustPropMgr.Add3("epdmid", 30, "", 1) status = swCustPropMgr.Add3("epdmid", 30, "", 1)
status = swCustPropMgr.Add3("Revision", 30, "", 1) status = swCustPropMgr.Add3("Revision", 30, "", 1)
'Dim Assebmly = swApp.ActiveDoc()
'Dim newName As String
'If withFrame = True Then
' newName = Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\gratings_assembly_simplified_with_frame.SLDASM"
'Else
' newName = Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\gratings_assembly_simplified.SLDASM"
'End If
'Dim swExtensions As IModelDocExtension
'swExtensions = assembly.Extension
'Dim Errors As Integer
'Dim Warnings As Integer
'status = swExtensions.SaveAs2(newName, 0, 4, Nothing, "", True, Errors, Warnings)
assembly.EditAssembly assembly.EditAssembly
Dim Errors As Integer Dim Errors As Integer
Dim Warnings As Integer Dim Warnings As Integer
@ -198,14 +184,15 @@ Public Class Multiple_3D_Simplified
sourcePath = Settings.filesFolder & "\Files\CADStart\" & designName & ".SLDASM" sourcePath = Settings.filesFolder & "\Files\CADStart\" & designName & ".SLDASM"
childrenSourcePaths.Add(Settings.HLCtFolder & "\HLCt\Parts\START.SLDPRT") childrenSourcePaths.Add(Settings.HLCtFolder & "\HLCt\Parts\START.SLDPRT")
Dim frameStr As String = ""
If withFrame = True Then If withFrame = True Then
destPath = Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATINGS_ASSEMBLY_SIMPLIFIED_WITH_FRAME.SLDASM" frameStr = "_WITH_FRAME"
childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\MASTER_SIMPLIFIED_WITH_FRAME.SLDPRT")
Else
destPath = Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATINGS_ASSEMBLY_SIMPLIFIED.SLDASM"
childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\MASTER_SIMPLIFIED.SLDPRT")
End If End If
destPath = Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATINGS_ASSEMBLY_SIMPLIFIED" & frameStr & ".SLDASM"
childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\MASTER_SIMPLIFIED" & frameStr & ".SLDPRT")
Dim instanceCounter As New Dictionary(Of String, Integer) Dim instanceCounter As New Dictionary(Of String, Integer)
For i = 0 To partDT.Rows.Count - 1 For i = 0 To partDT.Rows.Count - 1
childrenSourcePaths.Add(Settings.filesFolder & "\Files\CADStart\" & partDT.Rows(i)("partName") & ".SLDPRT") childrenSourcePaths.Add(Settings.filesFolder & "\Files\CADStart\" & partDT.Rows(i)("partName") & ".SLDPRT")
@ -225,10 +212,10 @@ Public Class Multiple_3D_Simplified
End Try End Try
If partNameArray(0) = "FRAME" Then If partNameArray(0) = "FRAME" Then
childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw") & "\" & newName & childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw") & "\" & newName & frameStr &
instanceCounter(newName.Substring(0, newName.Length - 1)) & ".SLDPRT") instanceCounter(newName.Substring(0, newName.Length - 1)) & ".SLDPRT")
Else Else
childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\" & newName & childrenDestPaths.Add(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\" & newName & frameStr &
instanceCounter(newName.Substring(0, newName.Length - 1)) & ".SLDPRT") instanceCounter(newName.Substring(0, newName.Length - 1)) & ".SLDPRT")
End If End If
Next Next
@ -393,8 +380,6 @@ Public Class Multiple_3D_Simplified
Dim components = Assembly.GetComponents(True) Dim components = Assembly.GetComponents(True)
'Indent
Dim listOfBeams As New List(Of DataRow) Dim listOfBeams As New List(Of DataRow)
For i = 0 To partDT.Rows.Count - 1 For i = 0 To partDT.Rows.Count - 1
Dim partName As String Dim partName As String
@ -542,7 +527,6 @@ Public Class Multiple_3D_Simplified
Dim components = Assembly.GetComponents(True) Dim components = Assembly.GetComponents(True)
'Indent
Dim listOfHorizBeams As New List(Of DataRow) Dim listOfHorizBeams As New List(Of DataRow)
Dim listOfVertBeams As New List(Of DataRow) Dim listOfVertBeams As New List(Of DataRow)
Dim counter As Integer = 1 Dim counter As Integer = 1

View File

@ -18,16 +18,18 @@ Public Class Multiple_Drawing
swSheet.SetProperties2(12, 12, 1, 1, False, swSheetWidth, swSheetHeight, True) swSheet.SetProperties2(12, 12, 1, 1, False, swSheetWidth, swSheetHeight, True)
swSheet.SetTemplateName(Settings.HLCtFolder & "\Files Needed\A3 Part.slddrt") swSheet.SetTemplateName(Settings.HLCtFolder & "\Files Needed\A3 Part.slddrt")
swSheet.ReloadTemplate(True) swSheet.ReloadTemplate(True)
swSheet.SetScale(1, 10, False, False) ' FIXA swSheet.SetScale(1, 10, False, False)
swSheet.SetName("Assembly") swSheet.SetName("Assembly")
Dim layMgr As LayerMgr Dim layMgr As LayerMgr
layMgr = iDrawing.GetLayerManager() layMgr = iDrawing.GetLayerManager()
status = layMgr.SetCurrentLayer("Svenska") status = layMgr.SetCurrentLayer("Svenska")
Dim adjustedHeightPosInSheet As Double = swSheetHeight / 2 + 0.02
Dim myView As View Dim myView As View
myView = iDrawing.CreateDrawViewFromModelView3(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATINGS_ASSEMBLY_SIMPLIFIED.SLDASM", myView = iDrawing.CreateDrawViewFromModelView3(Settings.folderPaths("object_" & Data.objectNum & "_models3D_gratings_sw_support") & "\GRATINGS_ASSEMBLY_SIMPLIFIED.SLDASM",
"*Front", swSheetWidth / 2, swSheetHeight / 2, 0) "*Front", swSheetWidth / 2, adjustedHeightPosInSheet, 0)
myView.UseSheetScale() = True myView.UseSheetScale() = True
myView.SetDisplayTangentEdges2(2) myView.SetDisplayTangentEdges2(2)
@ -277,9 +279,9 @@ Public Class Multiple_Drawing
status = False status = False
counter = 0 counter = 0
While status = False While status = False
gratingName = "SIMPLIFIED_FLOOR_GRATING_" & i + counter * Calculate_Fill_Grid.numOfHorizontal 'modelsDT.Rows(i + counter * Calculate_Fill_Grid.numOfHorizontal)("partName") gratingName = "SIMPLIFIED_FLOOR_GRATING_" & i + counter * Calculate_Fill_Grid.numOfHorizontal
iDrawing.ClearSelection2(True) iDrawing.ClearSelection2(True)
plane1Name = "Point1@SL1@" & CompName & "@" & myView.GetName2 & "/" & gratingName & "-1@" & CompName.Split("-")(0) 'Fixa gratingname plane1Name = "Point1@SL1@" & CompName & "@" & myView.GetName2 & "/" & gratingName & "-1@" & CompName.Split("-")(0)
status = swExtensions.SelectByID2(plane1Name, "EXTSKETCHPOINT", 0, 0, 0, False, 0, Nothing, 0) status = swExtensions.SelectByID2(plane1Name, "EXTSKETCHPOINT", 0, 0, 0, False, 0, Nothing, 0)
plane2Name = "Point1@SL2@" & CompName & "@" & myView.GetName2 & "/" & gratingName & "-1@" & CompName.Split("-")(0) plane2Name = "Point1@SL2@" & CompName & "@" & myView.GetName2 & "/" & gratingName & "-1@" & CompName.Split("-")(0)
status = swExtensions.SelectByID2(plane2Name, "EXTSKETCHPOINT", 0, 0, 0, True, 0, Nothing, 0) status = swExtensions.SelectByID2(plane2Name, "EXTSKETCHPOINT", 0, 0, 0, True, 0, Nothing, 0)
@ -296,7 +298,7 @@ Public Class Multiple_Drawing
status = False status = False
counter = 0 counter = 0
While status = False While status = False
gratingName = "SIMPLIFIED_FLOOR_GRATING_" & counter * Calculate_Fill_Grid.numOfHorizontal + 1 'modelsDT.Rows(counter * Calculate_Fill_Grid.numOfHorizontal)("partName") gratingName = "SIMPLIFIED_FLOOR_GRATING_" & counter * Calculate_Fill_Grid.numOfHorizontal + 1
iDrawing.ClearSelection2(True) iDrawing.ClearSelection2(True)
plane1Name = "Point1@SL1@" & CompName & "@" & myView.GetName2 & "/" & gratingName & "-1@" & CompName.Split("-")(0) plane1Name = "Point1@SL1@" & CompName & "@" & myView.GetName2 & "/" & gratingName & "-1@" & CompName.Split("-")(0)
status = swExtensions.SelectByID2(plane1Name, "EXTSKETCHPOINT", 0, 0, 0, False, 0, Nothing, 0) status = swExtensions.SelectByID2(plane1Name, "EXTSKETCHPOINT", 0, 0, 0, False, 0, Nothing, 0)
@ -306,7 +308,7 @@ Public Class Multiple_Drawing
status = False status = False
counter = 0 counter = 0
While status = False While status = False
gratingName = "SIMPLIFIED_FLOOR_GRATING_" & Calculate_Fill_Grid.numOfHorizontal + counter * Calculate_Fill_Grid.numOfHorizontal 'modelsDT.Rows(Calculate_Fill_Grid.numOfHorizontal - 1 + counter * Calculate_Fill_Grid.numOfHorizontal)("partName") gratingName = "SIMPLIFIED_FLOOR_GRATING_" & Calculate_Fill_Grid.numOfHorizontal + counter * Calculate_Fill_Grid.numOfHorizontal
plane2Name = "Point1@SL2@" & CompName & "@" & myView.GetName2 & "/" & gratingName & "-1@" & CompName.Split("-")(0) plane2Name = "Point1@SL2@" & CompName & "@" & myView.GetName2 & "/" & gratingName & "-1@" & CompName.Split("-")(0)
status = swExtensions.SelectByID2(plane2Name, "EXTSKETCHPOINT", 0, 0, 0, True, 0, Nothing, 0) status = swExtensions.SelectByID2(plane2Name, "EXTSKETCHPOINT", 0, 0, 0, True, 0, Nothing, 0)
counter += 1 counter += 1
@ -323,7 +325,7 @@ Public Class Multiple_Drawing
status = False status = False
counter = 1 counter = 1
While status = False While status = False
gratingName = "SIMPLIFIED_FLOOR_GRATING_" & i * Calculate_Fill_Grid.numOfHorizontal + counter 'modelsDT.Rows(i * Calculate_Fill_Grid.numOfHorizontal + counter)("partName") gratingName = "SIMPLIFIED_FLOOR_GRATING_" & i * Calculate_Fill_Grid.numOfHorizontal + counter
iDrawing.ClearSelection2(True) iDrawing.ClearSelection2(True)
plane1Name = "Point1@SW1@" & CompName & "@" & myView.GetName2 & "/" & gratingName & "-1@" & CompName.Split("-")(0) plane1Name = "Point1@SW1@" & CompName & "@" & myView.GetName2 & "/" & gratingName & "-1@" & CompName.Split("-")(0)
status = swExtensions.SelectByID2(plane1Name, "EXTSKETCHPOINT", 0, 0, 0, False, 0, Nothing, 0) status = swExtensions.SelectByID2(plane1Name, "EXTSKETCHPOINT", 0, 0, 0, False, 0, Nothing, 0)
@ -342,7 +344,7 @@ Public Class Multiple_Drawing
status = False status = False
counter = 1 counter = 1
While status = False While status = False
gratingName = "SIMPLIFIED_FLOOR_GRATING_" & counter 'modelsDT.Rows(counter)("partName") gratingName = "SIMPLIFIED_FLOOR_GRATING_" & counter
iDrawing.ClearSelection2(True) iDrawing.ClearSelection2(True)
plane1Name = "Point1@SW1@" & CompName & "@" & myView.GetName2 & "/" & gratingName & "-1@" & CompName.Split("-")(0) plane1Name = "Point1@SW1@" & CompName & "@" & myView.GetName2 & "/" & gratingName & "-1@" & CompName.Split("-")(0)
status = swExtensions.SelectByID2(plane1Name, "EXTSKETCHPOINT", 0, 0, 0, False, 0, Nothing, 0) status = swExtensions.SelectByID2(plane1Name, "EXTSKETCHPOINT", 0, 0, 0, False, 0, Nothing, 0)
@ -352,7 +354,7 @@ Public Class Multiple_Drawing
status = False status = False
counter = 1 counter = 1
While status = False While status = False
gratingName = "SIMPLIFIED_FLOOR_GRATING_" & Calculate_Fill_Grid.numOfHorizontal * (Calculate_Fill_Grid.numOfVertical - 1) + counter 'modelsDT.Rows(Calculate_Fill_Grid.numOfHorizontal * (Calculate_Fill_Grid.numOfVertical - 1) + counter)("partName") gratingName = "SIMPLIFIED_FLOOR_GRATING_" & Calculate_Fill_Grid.numOfHorizontal * (Calculate_Fill_Grid.numOfVertical - 1) + counter
plane2Name = "Point1@SW2@" & CompName & "@" & myView.GetName2 & "/" & gratingName & "-1@" & CompName.Split("-")(0) plane2Name = "Point1@SW2@" & CompName & "@" & myView.GetName2 & "/" & gratingName & "-1@" & CompName.Split("-")(0)
status = swExtensions.SelectByID2(plane2Name, "EXTSKETCHPOINT", 0, 0, 0, True, 0, Nothing, 0) status = swExtensions.SelectByID2(plane2Name, "EXTSKETCHPOINT", 0, 0, 0, True, 0, Nothing, 0)
counter += 1 counter += 1

View File

@ -77,7 +77,6 @@
<Compile Include="Gratings Data\Calculate_Fill_Grid.vb" /> <Compile Include="Gratings Data\Calculate_Fill_Grid.vb" />
<Compile Include="Gratings Data\Database.vb" /> <Compile Include="Gratings Data\Database.vb" />
<Compile Include="Gratings Data\Data.vb" /> <Compile Include="Gratings Data\Data.vb" />
<Compile Include="Gratings Data\Grating_Fill2.vb" />
<Compile Include="Gratings Data\User_Input.vb" /> <Compile Include="Gratings Data\User_Input.vb" />
<Compile Include="GUI\AppForm.Designer.vb"> <Compile Include="GUI\AppForm.Designer.vb">
<DependentUpon>AppForm.vb</DependentUpon> <DependentUpon>AppForm.vb</DependentUpon>
@ -133,6 +132,7 @@
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="GUI\AppForm.resx"> <EmbeddedResource Include="GUI\AppForm.resx">
<DependentUpon>AppForm.vb</DependentUpon> <DependentUpon>AppForm.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="GUI\Individual.resx"> <EmbeddedResource Include="GUI\Individual.resx">
<DependentUpon>Individual.vb</DependentUpon> <DependentUpon>Individual.vb</DependentUpon>