diff --git a/HLCt/Parts/START.SLDPRT b/HLCt/Parts/START.SLDPRT index 523a096..5656b7f 100644 Binary files a/HLCt/Parts/START.SLDPRT and b/HLCt/Parts/START.SLDPRT differ diff --git a/Wardrobe/SolidWorks/Individual_Frame_3D.vb b/Wardrobe/SolidWorks/Individual_Frame_3D.vb index 430e6d4..61e57bb 100644 --- a/Wardrobe/SolidWorks/Individual_Frame_3D.vb +++ b/Wardrobe/SolidWorks/Individual_Frame_3D.vb @@ -1,9 +1,11 @@ Imports XCCLibrary Imports SldWorks Public Class Individual_Frame_3D - Public Shared cuttingList As New Dictionary(Of Integer, Integer()) Private Shared designName As String - Private Shared sideFrameLengths As New Dictionary(Of String, Integer) + + Public Shared cuttingList As New Dictionary(Of Integer, Integer()) + Public Shared sideFrameLengths As New Dictionary(Of String, Integer) + Public Shared Sub Build_Frame(gratingParameters As DataRow, parentID As Integer) Dim frameDT As New DataTable frameDT = Generate_FrameData(gratingParameters) diff --git a/Wardrobe/SolidWorks/Individual_Frame_Drawing.vb b/Wardrobe/SolidWorks/Individual_Frame_Drawing.vb index 1fa4c67..1479694 100644 --- a/Wardrobe/SolidWorks/Individual_Frame_Drawing.vb +++ b/Wardrobe/SolidWorks/Individual_Frame_Drawing.vb @@ -54,6 +54,7 @@ Public Class Individual_Frame_Drawing swSheet.SetProperties2(12, 12, 1, 1, False, swSheetWidth, swSheetHeight, True) swSheet.SetTemplateName(Individual.filepath & "\X2021\Weland ritningsmallar\A3 Part.slddrt") swSheet.ReloadTemplate(True) + swSheet.SetScale(1, 10, False, False) Dim layMgr As LayerMgr layMgr = iDrawing.GetLayerManager() @@ -70,19 +71,44 @@ Public Class Individual_Frame_Drawing Dim RootComp = myView.RootDrawingComponent Dim CompName = RootComp.Name - Dim plane1Name As String = "OffPlane1@" & CompName & "@" & myView.GetName2 & "/" & frameComponents(0)("partName") & "-1@" & CompName.Split("-")(0) - Dim plane2Name As String = "OffPlane2@" & CompName & "@" & myView.GetName2 & "/" & frameComponents(0)("partName") & "-1@" & CompName.Split("-")(0) + Dim OutLine = myView.GetOutline - iDrawing.ClearSelection2(True) - Dim measurement As IDisplayDimension - swExtensions.SelectByID2(plane1Name, "PLANE", 0, 0, 0, True, 0, Nothing, 0) - swExtensions.SelectByID2(plane2Name, "PLANE", 0, 0, 0, True, 0, Nothing, 0) - measurement = iDrawing.AddHorizontalDimension2(0.005, 0, 0) + For i = 0 To Individual_Frame_3D.cuttingList.ElementAt(0).Value.Count + Dim frameComponentName As String + If i = Individual_Frame_3D.cuttingList.ElementAt(0).Value.Count Then + frameComponentName = "frame_l_end_piece" & i + 1 + Else + frameComponentName = frameComponents(i)("partName") + End If + + Dim plane1Name As String = "OffPlane1@" & CompName & "@" & myView.GetName2 & "/" & frameComponentName & "-1@" & CompName.Split("-")(0) + Dim plane2Name As String = "OffPlane2@" & CompName & "@" & myView.GetName2 & "/" & frameComponentName & "-1@" & CompName.Split("-")(0) + + Dim xOffset As Integer = 0 + For j = 0 To i + If j = Individual_Frame_3D.cuttingList.ElementAt(0).Value.Count Then + xOffset += (200 - xOffset) / 2 + ElseIf j = i Then + xOffset += (Individual_Frame_3D.sideFrameLengths("Frame " & Individual_Frame_3D.cuttingList.ElementAt(0).Value(j)) / 10) / 2 + Else + xOffset += Individual_Frame_3D.sideFrameLengths("Frame " & Individual_Frame_3D.cuttingList.ElementAt(0).Value(j)) / 10 + End If + Next + xOffset = xOffset / 1000 + Dim X_Mid = OutLine(2) - 0.005 - xOffset + + iDrawing.ClearSelection2(True) + Dim measurement As IDisplayDimension + swExtensions.SelectByID2(plane1Name, "PLANE", 0, 0, 0, True, 0, Nothing, 0) + swExtensions.SelectByID2(plane2Name, "PLANE", 0, 0, 0, True, 0, Nothing, 0) + measurement = iDrawing.AddHorizontalDimension2(X_Mid, OutLine(3) + 0.005, 0) + + iDrawing.ClearSelection2(True) + measurement.SetUnits2(False, 0, 1, 0, True, 12) + measurement.CenterText = True + measurement.SetPrecision3(0, 0, 0, 0) + Next - iDrawing.ClearSelection2(True) - measurement.SetUnits2(False, 0, 1, 0, True, 12) - measurement.CenterText = True - measurement.SetPrecision3(0, 0, 0, 0) End Sub