More work on drawings for frames

This commit is contained in:
Anton 2021-03-26 15:11:32 +01:00
parent 1fc3cd7cab
commit ad7dbf49ff
3 changed files with 41 additions and 13 deletions

Binary file not shown.

View File

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

View File

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