Support beams added i Gui
This commit is contained in:
parent
bd3bbf2609
commit
6ebfdf707b
Binary file not shown.
Binary file not shown.
|
|
@ -295,6 +295,17 @@
|
|||
Dim x2 As Integer = Data.grossAreaPoints.Rows(1)("GUI X")
|
||||
g.DrawLine(dashPen, x1, y, x2, y)
|
||||
Next
|
||||
|
||||
'Support beams
|
||||
Dim supportPen As Pen = New Pen(Color.LightPink, 4)
|
||||
For i = 0 To Calculate_Fill_Grid.supportBeamsDT.Rows.Count - 1
|
||||
Dim x As Integer = Data.grossAreaPoints.Rows(0)("GUI X") + Calculate_Fill_Grid.supportBeamsDT.Rows(i)("GLOBAL_OFFSET") / Data.scaleDiff
|
||||
Dim y1 As Integer = Data.grossAreaPoints.Rows(0)("GUI Y")
|
||||
Dim y2 As Integer = Data.grossAreaPoints.Rows(3)("GUI Y")
|
||||
g.DrawLine(supportPen, x, y1, x, y2)
|
||||
Next
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
|
|
|||
|
|
@ -3,7 +3,9 @@
|
|||
Public Shared numOfHorizontal, numOfVertical As Integer
|
||||
Public Shared gratingLength, gratingWidth As Integer
|
||||
|
||||
Public Shared gratingDimensions As New DataTable
|
||||
Public Shared gratingDimensionsDT As New DataTable
|
||||
Public Shared supportBeamsDT As New DataTable
|
||||
Public Shared withSupportBeam As Boolean = False
|
||||
|
||||
Public Shared Sub Calculate_Grid()
|
||||
maxGratingWidth = Get_Max_Width()
|
||||
|
|
@ -12,45 +14,14 @@
|
|||
Get_NumOf_Vertical(maxGratingWidth)
|
||||
Get_NumOf_Horizontal(maxGratingLength)
|
||||
|
||||
Fill_Dimension_DT()
|
||||
|
||||
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))
|
||||
|
||||
gratingLength = Calculate_Grating_Length(maxGratingLength, 100)
|
||||
|
||||
For i = 0 To numOfHorizontal * numOfVertical - 1
|
||||
Dim tempDR As DataRow = gratingDimensions.NewRow
|
||||
tempDR("INDEX") = i
|
||||
tempDR("ROW") = Math.Floor((i + 0.5) / numOfHorizontal)
|
||||
tempDR("COLUMN") = i Mod numOfHorizontal
|
||||
|
||||
If tempDR("ROW") + 1 < numOfVertical Then
|
||||
tempDR("WIDTH") = 1000
|
||||
Else
|
||||
If Data.gratingW Mod 1000 <= 200 Then
|
||||
tempDR("WIDTH") = maxGratingWidth
|
||||
Else
|
||||
tempDR("WIDTH") = Data.gratingW Mod 1000
|
||||
End If
|
||||
End If
|
||||
|
||||
If tempDR("COLUMN") + 1 < numOfHorizontal Then
|
||||
tempDR("LENGTH") = gratingLength
|
||||
Else
|
||||
tempDR("LENGTH") = Data.gratingL - gratingLength * (numOfHorizontal - 1)
|
||||
End If
|
||||
|
||||
gratingDimensions.Rows.Add(tempDR)
|
||||
Next
|
||||
Calculate_Support_Beams()
|
||||
|
||||
Individual.Panel_Grating.Refresh()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Shared Function Get_Max_Width()
|
||||
If Data.gratingW >= 1000 Then
|
||||
If Data.gratingW Mod 1000 > 0 AndAlso Data.gratingW Mod 1000 <= 200 Then
|
||||
|
|
@ -129,4 +100,127 @@
|
|||
Return gLength
|
||||
End Function
|
||||
|
||||
Private Shared Sub Fill_Dimension_DT()
|
||||
gratingDimensionsDT.Clear()
|
||||
gratingDimensionsDT.Columns.Clear()
|
||||
gratingDimensionsDT.Columns.Add("INDEX", GetType(Integer))
|
||||
gratingDimensionsDT.Columns.Add("ROW", GetType(Integer))
|
||||
gratingDimensionsDT.Columns.Add("COLUMN", GetType(Integer))
|
||||
gratingDimensionsDT.Columns.Add("WIDTH", GetType(Integer))
|
||||
gratingDimensionsDT.Columns.Add("LENGTH", GetType(Integer))
|
||||
|
||||
gratingLength = Calculate_Grating_Length(maxGratingLength, 100)
|
||||
|
||||
For i = 0 To numOfHorizontal * numOfVertical - 1
|
||||
Dim tempDR As DataRow = gratingDimensionsDT.NewRow
|
||||
tempDR("INDEX") = i
|
||||
tempDR("ROW") = Math.Floor((i + 0.5) / numOfHorizontal)
|
||||
tempDR("COLUMN") = i Mod numOfHorizontal
|
||||
|
||||
If tempDR("ROW") + 1 < numOfVertical Then
|
||||
tempDR("WIDTH") = 1000
|
||||
Else
|
||||
If Data.gratingW Mod 1000 <= 200 Then
|
||||
tempDR("WIDTH") = maxGratingWidth
|
||||
Else
|
||||
tempDR("WIDTH") = Data.gratingW Mod 1000
|
||||
End If
|
||||
End If
|
||||
|
||||
If tempDR("COLUMN") + 1 < numOfHorizontal Then
|
||||
tempDR("LENGTH") = gratingLength
|
||||
Else
|
||||
tempDR("LENGTH") = Data.gratingL - gratingLength * (numOfHorizontal - 1)
|
||||
End If
|
||||
|
||||
gratingDimensionsDT.Rows.Add(tempDR)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Shared Sub Calculate_Support_Beams()
|
||||
' Hämta belastning från gui
|
||||
Dim maxLoad As Double = CDbl(Individual.Panel_Data.Controls("TextBox_Max_Load").Text)
|
||||
' Kolla mot load tables och hitta max längd
|
||||
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 då det inte finns load data för F-T
|
||||
End If
|
||||
ElseIf loadName = "A" Then
|
||||
loadName += User_Input.gratingMesh.Split(" ")(0)
|
||||
End If
|
||||
|
||||
Dim maxUnsupportedLenght As Integer
|
||||
For i = 0 To loadDT.Rows.Count - 1
|
||||
If loadName = nameInDT AndAlso User_Input.gratingHeight = LBHeightInDT _
|
||||
AndAlso User_Input.loadBarThickness = LBThicknessInDT Then
|
||||
If loadDT.Rows(i)("300") < maxLoad Then
|
||||
MessageBox.Show("Max supported load for chosen grating parameters is: " & loadDT.Rows(i)("300") & " [kN/m^2]")
|
||||
Return
|
||||
End If
|
||||
For j = loadDT.Columns.Count - 1 To 0 Step -1
|
||||
If loadDT.Rows(i)(j) >= maxLoad Then
|
||||
maxUnsupportedLenght = 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
|
||||
|
||||
' Jämför med längd
|
||||
If Math.Floor((gratingLength + 1) / maxUnsupportedLenght) < 1 Then '+1 för att floor inte kan hantera jämna tal
|
||||
withSupportBeam = False
|
||||
Return
|
||||
End If
|
||||
|
||||
withSupportBeam = True
|
||||
' Definera support beams
|
||||
supportBeamsDT.Clear()
|
||||
supportBeamsDT.Columns.Clear()
|
||||
supportBeamsDT.Columns.Add("COLUMN", GetType(Integer))
|
||||
supportBeamsDT.Columns.Add("COLUMN_OFFSET", GetType(Integer))
|
||||
supportBeamsDT.Columns.Add("GLOBAL_OFFSET", GetType(Integer))
|
||||
supportBeamsDT.Columns.Add("LENGTH", GetType(Integer))
|
||||
supportBeamsDT.Columns.Add("OFFSET_TOP", GetType(Integer))
|
||||
supportBeamsDT.Columns.Add("OFFSET_BOTTOM", GetType(Integer))
|
||||
For i = 0 To numOfHorizontal - 1
|
||||
Dim gratingL As Integer = gratingDimensionsDT.Rows(i)("LENGTH")
|
||||
Dim numOfBeamsNeeded As Integer = Math.Floor((gratingL + 1) / maxUnsupportedLenght)
|
||||
If numOfBeamsNeeded > 0 Then
|
||||
Dim beamSpacing As Integer = (Math.Floor(((gratingL + 1) / (numOfBeamsNeeded + 1)) / 10)) * 10
|
||||
|
||||
For j = 1 To numOfBeamsNeeded
|
||||
Dim tempDR As DataRow = supportBeamsDT.NewRow
|
||||
tempDR("COLUMN") = i
|
||||
tempDR("COLUMN_OFFSET") = j * beamSpacing
|
||||
tempDR("GLOBAL_OFFSET") = gratingLength * i + tempDR("COLUMN_OFFSET")
|
||||
tempDR("LENGTH") = Data.gratingW
|
||||
tempDR("OFFSET_TOP") = 0
|
||||
tempDR("OFFSET_BOTTOM") = 0
|
||||
|
||||
supportBeamsDT.Rows.Add(tempDR)
|
||||
Next
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Next
|
||||
End Sub
|
||||
End Class
|
||||
|
|
|
|||
|
|
@ -7,19 +7,19 @@ Public Class Frame_Drawing
|
|||
Dim model As ModelDoc2
|
||||
Dim assembly As IAssemblyDoc
|
||||
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
|
||||
'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
|
||||
|
||||
|
||||
|
||||
|
|
@ -44,8 +44,8 @@ Public Class Frame_Drawing
|
|||
Dim coordNames(numOfParts) As String
|
||||
Dim transMatrix As Object = Nothing
|
||||
For j = 0 To compNames.Count - 2 + endPieceExist
|
||||
Dim frameID = Frame_3D.cuttingList.ElementAt(i).Value(j) - 1
|
||||
compNames(j) = Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw") & "\" & frameComponents(frameID)("partName") & ".SLDPRT"
|
||||
Dim frameID = Frame_3D.cuttingList.ElementAt(i).Value(j)
|
||||
compNames(j) = Settings.folderPaths("object_" & Data.objectNum & "_models3D_frames_sw") & "\" & "FRAME_L_STRAIGHT_" & frameID & ".SLDPRT"
|
||||
coordNames(j) = ""
|
||||
Next
|
||||
|
||||
|
|
@ -130,9 +130,9 @@ Public Class Frame_Drawing
|
|||
For j = 0 To components.Length - 1
|
||||
Dim frameComponentName As String
|
||||
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
|
||||
frameComponentName = frameComponents(Frame_3D.cuttingList.ElementAt(i).Value(j) - 1)("partName")
|
||||
frameComponentName = "FRAME_L_STRAIGHT_" & Frame_3D.cuttingList.ElementAt(i).Value(j) 'frameComponents(Frame_3D.cuttingList.ElementAt(i).Value(j) - 1)("partName")
|
||||
End If
|
||||
|
||||
Dim plane1Name As String = "OffPlane1@" & CompName & "@" & myView.GetName2 & "/" & frameComponentName & "-1@" & CompName.Split("-")(0)
|
||||
|
|
|
|||
|
|
@ -97,8 +97,16 @@ Public Class Individual_3D_Simplified
|
|||
|
||||
'status = swExtensions.SaveAs2(newName, 0, 4, Nothing, "", True, Errors, Warnings)
|
||||
|
||||
Assembly.EditAssembly
|
||||
Dim Errors As Integer
|
||||
Dim Warnings As Integer
|
||||
|
||||
Dim components = Assembly.GetComponents(True)
|
||||
For i = 0 To UBound(components)
|
||||
Dim partDoc = components(i).GetModelDoc2()
|
||||
status = partDoc.Save3(4, Errors, Warnings)
|
||||
Next
|
||||
|
||||
Dim model As IModelDoc2
|
||||
model = Assembly
|
||||
status = model.Save3(4, Errors, Warnings)
|
||||
|
|
|
|||
|
|
@ -272,11 +272,59 @@ Public Class Instructions
|
|||
Dim note = iDrawing.CreateText2("Load Bearing Direction", (swSheetWidth - 0.072), (swSheetHeight / 2 + 0.012), 0, 0.003, 0)
|
||||
|
||||
|
||||
If Calculate_Fill_Grid.withSupportBeam = True Then
|
||||
status = iDrawing.NewSheet3("Support Beams", 12, 12, 1, 10, False, Settings.HLCtFolder & "\Files Needed\A3 Part.slddrt",
|
||||
swSheetWidth, swSheetHeight, "Same as sheet specified in Document Properties")
|
||||
status = layMgr.SetCurrentLayer("Svenska")
|
||||
|
||||
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.UseSheetScale() = True
|
||||
myView.SetDisplayTangentEdges2(2)
|
||||
|
||||
status = myView.SetDisplayMode3(False, 1, False, False)
|
||||
|
||||
|
||||
status = False
|
||||
Dim counter = 0
|
||||
While status = False
|
||||
gratingName = "SIMPLIFIED_FLOOR_GRATING_" & counter * Calculate_Fill_Grid.numOfHorizontal + 1 'modelsDT.Rows(counter * Calculate_Fill_Grid.numOfHorizontal)("partName")
|
||||
iDrawing.ClearSelection2(True)
|
||||
plane1Name = "Point1@SL1@" & CompName & "@" & myView.GetName2 & "/" & gratingName & "-1@" & CompName.Split("-")(0)
|
||||
status = swExtensions.SelectByID2(plane1Name, "EXTSKETCHSEGMENT", 0, 0, 0, False, 0, Nothing, 0)
|
||||
counter += 1
|
||||
End While
|
||||
|
||||
status = False
|
||||
counter = 0
|
||||
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")
|
||||
plane2Name = "Point1@SL2@" & CompName & "@" & myView.GetName2 & "/" & gratingName & "-1@" & CompName.Split("-")(0)
|
||||
status = swExtensions.SelectByID2(plane2Name, "EXTSKETCHSEGMENT", 0, 0, 0, True, 0, Nothing, 0)
|
||||
counter += 1
|
||||
End While
|
||||
|
||||
measurement = iDrawing.AddHorizontalDimension2(0, mesOffsets(0), 0)
|
||||
iDrawing.ClearSelection2(True)
|
||||
|
||||
Set_MeasurementProperties(measurement)
|
||||
measurement.ShowParenthesis = True
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Dim newName As String
|
||||
newName = Settings.folderPaths("object_" & Data.objectNum & "_guide") & "\assembly_instructions.SLDDRW"
|
||||
|
||||
status = iDrawing.SaveAs3(newName, 0, 0)
|
||||
status = iDrawing.SaveAs3(newName, 0, 2)
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ Public Class Multiple_3D
|
|||
Dim parentID As Integer = 0
|
||||
gratingParameters = exportTable.Rows(0)
|
||||
|
||||
For i = 0 To Calculate_Fill_Grid.gratingDimensions.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?
|
||||
ExternalClass.modify_parameter_value("DP_LOADBAR_THICKNESS", inst_, gratingParameters("LOADBAR_THICKNESS"))
|
||||
ExternalClass.modify_parameter_value("DP_LOADBAR_HEIGHT", inst_, gratingParameters("LOADBAR_HEIGHT"))
|
||||
|
|
@ -36,20 +36,20 @@ Public Class Multiple_3D
|
|||
ExternalClass.modify_parameter_value("DP_CROSSBAR_HEIGHT", inst_, gratingParameters("CROSSBAR_HEIGHT"))
|
||||
End If
|
||||
|
||||
ExternalClass.modify_parameter_value("DP_GRATING_WIDTH", inst_, Calculate_Fill_Grid.gratingDimensions.Rows(i)("WIDTH"))
|
||||
ExternalClass.modify_parameter_value("DP_GRATING_LENGTH", inst_, Calculate_Fill_Grid.gratingDimensions.Rows(i)("LENGTH"))
|
||||
ExternalClass.modify_parameter_value("DP_GRATING_WIDTH", inst_, Calculate_Fill_Grid.gratingDimensionsDT.Rows(i)("WIDTH"))
|
||||
ExternalClass.modify_parameter_value("DP_GRATING_LENGTH", inst_, Calculate_Fill_Grid.gratingDimensionsDT.Rows(i)("LENGTH"))
|
||||
Dim offsetX As Integer = 0
|
||||
For j = 1 To Calculate_Fill_Grid.gratingDimensions.Rows(i)("COLUMN")
|
||||
offsetX += Calculate_Fill_Grid.gratingDimensions.Rows(i - j)("LENGTH")
|
||||
For j = 1 To Calculate_Fill_Grid.gratingDimensionsDT.Rows(i)("COLUMN")
|
||||
offsetX += Calculate_Fill_Grid.gratingDimensionsDT.Rows(i - j)("LENGTH")
|
||||
Next
|
||||
|
||||
Dim offsetY As Integer = 0
|
||||
For j = 1 To Calculate_Fill_Grid.gratingDimensions.Rows(i)("ROW")
|
||||
offsetY += Calculate_Fill_Grid.gratingDimensions.Rows(i - Calculate_Fill_Grid.numOfHorizontal * j)("WIDTH")
|
||||
For j = 1 To Calculate_Fill_Grid.gratingDimensionsDT.Rows(i)("ROW")
|
||||
offsetY += Calculate_Fill_Grid.gratingDimensionsDT.Rows(i - Calculate_Fill_Grid.numOfHorizontal * j)("WIDTH")
|
||||
Next
|
||||
|
||||
ExternalClass.modify_parameter_value("DP_OFFSET_X", inst_, (Calculate_Fill_Grid.gratingDimensions.Rows(i)("LENGTH") / 2) + offsetX)
|
||||
ExternalClass.modify_parameter_value("DP_OFFSET_Y", inst_, (Calculate_Fill_Grid.gratingDimensions.Rows(i)("WIDTH") / 2) + offsetY)
|
||||
ExternalClass.modify_parameter_value("DP_OFFSET_X", inst_, (Calculate_Fill_Grid.gratingDimensionsDT.Rows(i)("LENGTH") / 2) + offsetX)
|
||||
ExternalClass.modify_parameter_value("DP_OFFSET_Y", inst_, (Calculate_Fill_Grid.gratingDimensionsDT.Rows(i)("WIDTH") / 2) + offsetY)
|
||||
Next
|
||||
|
||||
parentID = Calculate_Fill_Grid.numOfHorizontal * (Calculate_Fill_Grid.numOfVertical - 1) + 1
|
||||
|
|
@ -88,9 +88,17 @@ Public Class Multiple_3D
|
|||
'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
|
||||
Dim Errors As Integer
|
||||
Dim Warnings As Integer
|
||||
|
||||
Dim components = Assembly.GetComponents(True)
|
||||
For i = 0 To UBound(components)
|
||||
Dim partDoc = components(i).GetModelDoc2()
|
||||
status = partDoc.Save3(4, Errors, Warnings)
|
||||
Next
|
||||
|
||||
|
||||
Dim model As IModelDoc2
|
||||
model = Assembly
|
||||
status = model.Save3(4, Errors, Warnings)
|
||||
|
|
@ -517,7 +525,7 @@ Public Class Multiple_3D
|
|||
Dim listOfObsolete As New List(Of Integer)
|
||||
|
||||
For i = 0 To Calculate_Fill_Grid.numOfVertical * Calculate_Fill_Grid.numOfHorizontal - 1
|
||||
Dim gratingDR As DataRow = Calculate_Fill_Grid.gratingDimensions.Rows(i)
|
||||
Dim gratingDR As DataRow = Calculate_Fill_Grid.gratingDimensionsDT.Rows(i)
|
||||
Dim origo(2) As Integer
|
||||
origo(0) = Data.gratingL / 2
|
||||
origo(1) = Data.gratingW / 2
|
||||
|
|
@ -527,14 +535,14 @@ Public Class Multiple_3D
|
|||
p1(0) = -origo(0)
|
||||
p2(0) = -origo(0) + gratingDR("LENGTH")
|
||||
For j = 1 To gratingDR("COLUMN")
|
||||
p1(0) += Calculate_Fill_Grid.gratingDimensions.Rows(i - j)("LENGTH")
|
||||
p2(0) += Calculate_Fill_Grid.gratingDimensions.Rows(i - j)("LENGTH")
|
||||
p1(0) += Calculate_Fill_Grid.gratingDimensionsDT.Rows(i - j)("LENGTH")
|
||||
p2(0) += Calculate_Fill_Grid.gratingDimensionsDT.Rows(i - j)("LENGTH")
|
||||
Next
|
||||
p1(1) = origo(1)
|
||||
p3(1) = origo(1) - gratingDR("WIDTH")
|
||||
For j = 1 To gratingDR("ROW")
|
||||
p1(1) -= Calculate_Fill_Grid.gratingDimensions.Rows(i - Calculate_Fill_Grid.numOfHorizontal * j)("WIDTH")
|
||||
p3(1) -= Calculate_Fill_Grid.gratingDimensions.Rows(i - Calculate_Fill_Grid.numOfHorizontal * j)("WIDTH")
|
||||
p1(1) -= Calculate_Fill_Grid.gratingDimensionsDT.Rows(i - Calculate_Fill_Grid.numOfHorizontal * j)("WIDTH")
|
||||
p3(1) -= Calculate_Fill_Grid.gratingDimensionsDT.Rows(i - Calculate_Fill_Grid.numOfHorizontal * j)("WIDTH")
|
||||
Next
|
||||
|
||||
p2(1) = p1(1)
|
||||
|
|
|
|||
|
|
@ -17,23 +17,23 @@ Public Class Multiple_3D_Simplified
|
|||
Dim parentID As Integer = 0
|
||||
gratingParameters = exportTable.Rows(0)
|
||||
|
||||
For i = 0 To Calculate_Fill_Grid.gratingDimensions.Rows.Count - 1
|
||||
For i = 0 To Calculate_Fill_Grid.gratingDimensionsDT.Rows.Count - 1
|
||||
inst_ = ExternalClass.instantiate_parts(parentID, "simplified_floor_grating", "")
|
||||
ExternalClass.modify_parameter_value("DP_LOADBAR_HEIGHT", inst_, gratingParameters("LOADBAR_HEIGHT"))
|
||||
ExternalClass.modify_parameter_value("DP_GRATING_WIDTH", inst_, Calculate_Fill_Grid.gratingDimensions.Rows(i)("WIDTH"))
|
||||
ExternalClass.modify_parameter_value("DP_GRATING_LENGTH", inst_, Calculate_Fill_Grid.gratingDimensions.Rows(i)("LENGTH"))
|
||||
ExternalClass.modify_parameter_value("DP_GRATING_WIDTH", inst_, Calculate_Fill_Grid.gratingDimensionsDT.Rows(i)("WIDTH"))
|
||||
ExternalClass.modify_parameter_value("DP_GRATING_LENGTH", inst_, Calculate_Fill_Grid.gratingDimensionsDT.Rows(i)("LENGTH"))
|
||||
Dim offsetX As Integer = 0
|
||||
For j = 1 To Calculate_Fill_Grid.gratingDimensions.Rows(i)("COLUMN")
|
||||
offsetX += Calculate_Fill_Grid.gratingDimensions.Rows(i - j)("LENGTH")
|
||||
For j = 1 To Calculate_Fill_Grid.gratingDimensionsDT.Rows(i)("COLUMN")
|
||||
offsetX += Calculate_Fill_Grid.gratingDimensionsDT.Rows(i - j)("LENGTH")
|
||||
Next
|
||||
|
||||
Dim offsetY As Integer = 0
|
||||
For j = 1 To Calculate_Fill_Grid.gratingDimensions.Rows(i)("ROW")
|
||||
offsetY += Calculate_Fill_Grid.gratingDimensions.Rows(i - Calculate_Fill_Grid.numOfHorizontal * j)("WIDTH")
|
||||
For j = 1 To Calculate_Fill_Grid.gratingDimensionsDT.Rows(i)("ROW")
|
||||
offsetY += Calculate_Fill_Grid.gratingDimensionsDT.Rows(i - Calculate_Fill_Grid.numOfHorizontal * j)("WIDTH")
|
||||
Next
|
||||
|
||||
ExternalClass.modify_parameter_value("DP_OFFSET_X", inst_, (Calculate_Fill_Grid.gratingDimensions.Rows(i)("LENGTH") / 2) + offsetX)
|
||||
ExternalClass.modify_parameter_value("DP_OFFSET_Y", inst_, (Calculate_Fill_Grid.gratingDimensions.Rows(i)("WIDTH") / 2) + offsetY)
|
||||
ExternalClass.modify_parameter_value("DP_OFFSET_X", inst_, (Calculate_Fill_Grid.gratingDimensionsDT.Rows(i)("LENGTH") / 2) + offsetX)
|
||||
ExternalClass.modify_parameter_value("DP_OFFSET_Y", inst_, (Calculate_Fill_Grid.gratingDimensionsDT.Rows(i)("WIDTH") / 2) + offsetY)
|
||||
Next
|
||||
|
||||
parentID = Calculate_Fill_Grid.numOfHorizontal * (Calculate_Fill_Grid.numOfVertical - 1) + 1
|
||||
|
|
@ -45,6 +45,17 @@ Public Class Multiple_3D_Simplified
|
|||
Frame_3D.Build_Frame(gratingParameters, parentID)
|
||||
End If
|
||||
|
||||
If Calculate_Fill_Grid.withSupportBeam = True Then
|
||||
For i = 0 To Calculate_Fill_Grid.supportBeamsDT.Rows.Count - 1
|
||||
inst_ = ExternalClass.instantiate_parts(parentID, "support_beam", "")
|
||||
ExternalClass.modify_parameter_value("DP_HEIGHT_OFFSET", inst_, gratingParameters("LOADBAR_HEIGHT"))
|
||||
ExternalClass.modify_parameter_value("DP_LENGTH", inst_, Calculate_Fill_Grid.supportBeamsDT.Rows(i)("LENGTH"))
|
||||
ExternalClass.modify_parameter_value("DP_OFFSET_X", inst_, Calculate_Fill_Grid.supportBeamsDT.Rows(i)("GLOBAL_OFFSET"))
|
||||
ExternalClass.modify_parameter_value("DP_OFFSET_TOP", inst_, Calculate_Fill_Grid.supportBeamsDT.Rows(i)("OFFSET_TOP"))
|
||||
ExternalClass.modify_parameter_value("DP_OFFSET_BOTTOM", inst_, Calculate_Fill_Grid.supportBeamsDT.Rows(i)("OFFSET_BOTTOM"))
|
||||
Next
|
||||
End If
|
||||
|
||||
importClass.copyGroupsByDataSet(ExternalClass.groupds_new)
|
||||
Dim grNr = groupClass.NewGroupID
|
||||
Dim designTable = designModel.selectDesign("*")
|
||||
|
|
@ -159,8 +170,15 @@ Public Class Multiple_3D_Simplified
|
|||
|
||||
'status = swExtensions.SaveAs2(newName, 0, 4, Nothing, "", True, Errors, Warnings)
|
||||
|
||||
assembly.EditAssembly
|
||||
Dim Errors As Integer
|
||||
Dim Warnings As Integer
|
||||
|
||||
Dim components = assembly.GetComponents(True)
|
||||
For i = 0 To UBound(components)
|
||||
Dim partDoc = components(i).GetModelDoc2()
|
||||
status = partDoc.Save3(4, Errors, Warnings)
|
||||
Next
|
||||
Dim model As IModelDoc2
|
||||
model = assembly
|
||||
status = model.Save3(4, Errors, Warnings)
|
||||
|
|
@ -480,7 +498,7 @@ Public Class Multiple_3D_Simplified
|
|||
Dim listOfObsolete As New List(Of Integer)
|
||||
|
||||
For i = 0 To Calculate_Fill_Grid.numOfVertical * Calculate_Fill_Grid.numOfHorizontal - 1
|
||||
Dim gratingDR As DataRow = Calculate_Fill_Grid.gratingDimensions.Rows(i)
|
||||
Dim gratingDR As DataRow = Calculate_Fill_Grid.gratingDimensionsDT.Rows(i)
|
||||
Dim origo(2) As Integer
|
||||
origo(0) = Data.gratingL / 2
|
||||
origo(1) = Data.gratingW / 2
|
||||
|
|
@ -490,14 +508,14 @@ Public Class Multiple_3D_Simplified
|
|||
p1(0) = -origo(0)
|
||||
p2(0) = -origo(0) + gratingDR("LENGTH")
|
||||
For j = 1 To gratingDR("COLUMN")
|
||||
p1(0) += Calculate_Fill_Grid.gratingDimensions.Rows(i - j)("LENGTH")
|
||||
p2(0) += Calculate_Fill_Grid.gratingDimensions.Rows(i - j)("LENGTH")
|
||||
p1(0) += Calculate_Fill_Grid.gratingDimensionsDT.Rows(i - j)("LENGTH")
|
||||
p2(0) += Calculate_Fill_Grid.gratingDimensionsDT.Rows(i - j)("LENGTH")
|
||||
Next
|
||||
p1(1) = origo(1)
|
||||
p3(1) = origo(1) - gratingDR("WIDTH")
|
||||
For j = 1 To gratingDR("ROW")
|
||||
p1(1) -= Calculate_Fill_Grid.gratingDimensions.Rows(i - Calculate_Fill_Grid.numOfHorizontal * j)("WIDTH")
|
||||
p3(1) -= Calculate_Fill_Grid.gratingDimensions.Rows(i - Calculate_Fill_Grid.numOfHorizontal * j)("WIDTH")
|
||||
p1(1) -= Calculate_Fill_Grid.gratingDimensionsDT.Rows(i - Calculate_Fill_Grid.numOfHorizontal * j)("WIDTH")
|
||||
p3(1) -= Calculate_Fill_Grid.gratingDimensionsDT.Rows(i - Calculate_Fill_Grid.numOfHorizontal * j)("WIDTH")
|
||||
Next
|
||||
|
||||
p2(1) = p1(1)
|
||||
|
|
|
|||
|
|
@ -273,13 +273,13 @@ Public Class Multiple_Drawing
|
|||
Next
|
||||
|
||||
' -- Loop Horizontal --
|
||||
For i = 0 To Calculate_Fill_Grid.numOfHorizontal - 1
|
||||
For i = 1 To Calculate_Fill_Grid.numOfHorizontal
|
||||
status = False
|
||||
counter = 0
|
||||
While status = False
|
||||
gratingName = modelsDT.Rows(i + counter * Calculate_Fill_Grid.numOfHorizontal)("partName")
|
||||
gratingName = "SIMPLIFIED_FLOOR_GRATING_" & i + counter * Calculate_Fill_Grid.numOfHorizontal 'modelsDT.Rows(i + counter * Calculate_Fill_Grid.numOfHorizontal)("partName")
|
||||
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) 'Fixa gratingname
|
||||
status = swExtensions.SelectByID2(plane1Name, "EXTSKETCHSEGMENT", 0, 0, 0, False, 0, Nothing, 0)
|
||||
plane2Name = "Point1@SL2@" & CompName & "@" & myView.GetName2 & "/" & gratingName & "-1@" & CompName.Split("-")(0)
|
||||
status = swExtensions.SelectByID2(plane2Name, "EXTSKETCHSEGMENT", 0, 0, 0, True, 0, Nothing, 0)
|
||||
|
|
@ -296,7 +296,7 @@ Public Class Multiple_Drawing
|
|||
status = False
|
||||
counter = 0
|
||||
While status = False
|
||||
gratingName = modelsDT.Rows(counter * Calculate_Fill_Grid.numOfHorizontal)("partName")
|
||||
gratingName = "SIMPLIFIED_FLOOR_GRATING_" & counter * Calculate_Fill_Grid.numOfHorizontal + 1 'modelsDT.Rows(counter * Calculate_Fill_Grid.numOfHorizontal)("partName")
|
||||
iDrawing.ClearSelection2(True)
|
||||
plane1Name = "Point1@SL1@" & CompName & "@" & myView.GetName2 & "/" & gratingName & "-1@" & CompName.Split("-")(0)
|
||||
status = swExtensions.SelectByID2(plane1Name, "EXTSKETCHSEGMENT", 0, 0, 0, False, 0, Nothing, 0)
|
||||
|
|
@ -306,7 +306,7 @@ Public Class Multiple_Drawing
|
|||
status = False
|
||||
counter = 0
|
||||
While status = False
|
||||
gratingName = 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 'modelsDT.Rows(Calculate_Fill_Grid.numOfHorizontal - 1 + counter * Calculate_Fill_Grid.numOfHorizontal)("partName")
|
||||
plane2Name = "Point1@SL2@" & CompName & "@" & myView.GetName2 & "/" & gratingName & "-1@" & CompName.Split("-")(0)
|
||||
status = swExtensions.SelectByID2(plane2Name, "EXTSKETCHSEGMENT", 0, 0, 0, True, 0, Nothing, 0)
|
||||
counter += 1
|
||||
|
|
@ -321,9 +321,9 @@ Public Class Multiple_Drawing
|
|||
' -- Loop Vertical --
|
||||
For i = 0 To Calculate_Fill_Grid.numOfVertical - 1
|
||||
status = False
|
||||
counter = 0
|
||||
counter = 1
|
||||
While status = False
|
||||
gratingName = modelsDT.Rows(i * Calculate_Fill_Grid.numOfHorizontal + counter)("partName")
|
||||
gratingName = "SIMPLIFIED_FLOOR_GRATING_" & i * Calculate_Fill_Grid.numOfHorizontal + counter 'modelsDT.Rows(i * Calculate_Fill_Grid.numOfHorizontal + counter)("partName")
|
||||
iDrawing.ClearSelection2(True)
|
||||
plane1Name = "Point1@SW1@" & CompName & "@" & myView.GetName2 & "/" & gratingName & "-1@" & CompName.Split("-")(0)
|
||||
status = swExtensions.SelectByID2(plane1Name, "EXTSKETCHSEGMENT", 0, 0, 0, False, 0, Nothing, 0)
|
||||
|
|
@ -340,9 +340,9 @@ Public Class Multiple_Drawing
|
|||
mesOffsets(3) -= 0.01
|
||||
|
||||
status = False
|
||||
counter = 0
|
||||
counter = 1
|
||||
While status = False
|
||||
gratingName = modelsDT.Rows(counter)("partName")
|
||||
gratingName = "SIMPLIFIED_FLOOR_GRATING_" & counter 'modelsDT.Rows(counter)("partName")
|
||||
iDrawing.ClearSelection2(True)
|
||||
plane1Name = "Point1@SW1@" & CompName & "@" & myView.GetName2 & "/" & gratingName & "-1@" & CompName.Split("-")(0)
|
||||
status = swExtensions.SelectByID2(plane1Name, "EXTSKETCHSEGMENT", 0, 0, 0, False, 0, Nothing, 0)
|
||||
|
|
@ -350,9 +350,9 @@ Public Class Multiple_Drawing
|
|||
End While
|
||||
|
||||
status = False
|
||||
counter = 0
|
||||
counter = 1
|
||||
While status = False
|
||||
gratingName = 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 'modelsDT.Rows(Calculate_Fill_Grid.numOfHorizontal * (Calculate_Fill_Grid.numOfVertical - 1) + counter)("partName")
|
||||
plane2Name = "Point1@SW2@" & CompName & "@" & myView.GetName2 & "/" & gratingName & "-1@" & CompName.Split("-")(0)
|
||||
status = swExtensions.SelectByID2(plane2Name, "EXTSKETCHSEGMENT", 0, 0, 0, True, 0, Nothing, 0)
|
||||
counter += 1
|
||||
|
|
|
|||
Loading…
Reference in New Issue