More work on drawings for frames
This commit is contained in:
parent
1fc3cd7cab
commit
ad7dbf49ff
Binary file not shown.
|
|
@ -1,9 +1,11 @@
|
||||||
Imports XCCLibrary
|
Imports XCCLibrary
|
||||||
Imports SldWorks
|
Imports SldWorks
|
||||||
Public Class Individual_Frame_3D
|
Public Class Individual_Frame_3D
|
||||||
Public Shared cuttingList As New Dictionary(Of Integer, Integer())
|
|
||||||
Private Shared designName As String
|
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)
|
Public Shared Sub Build_Frame(gratingParameters As DataRow, parentID As Integer)
|
||||||
Dim frameDT As New DataTable
|
Dim frameDT As New DataTable
|
||||||
frameDT = Generate_FrameData(gratingParameters)
|
frameDT = Generate_FrameData(gratingParameters)
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ Public Class Individual_Frame_Drawing
|
||||||
swSheet.SetProperties2(12, 12, 1, 1, False, swSheetWidth, swSheetHeight, True)
|
swSheet.SetProperties2(12, 12, 1, 1, False, swSheetWidth, swSheetHeight, True)
|
||||||
swSheet.SetTemplateName(Individual.filepath & "\X2021\Weland ritningsmallar\A3 Part.slddrt")
|
swSheet.SetTemplateName(Individual.filepath & "\X2021\Weland ritningsmallar\A3 Part.slddrt")
|
||||||
swSheet.ReloadTemplate(True)
|
swSheet.ReloadTemplate(True)
|
||||||
|
swSheet.SetScale(1, 10, False, False)
|
||||||
|
|
||||||
Dim layMgr As LayerMgr
|
Dim layMgr As LayerMgr
|
||||||
layMgr = iDrawing.GetLayerManager()
|
layMgr = iDrawing.GetLayerManager()
|
||||||
|
|
@ -70,19 +71,44 @@ Public Class Individual_Frame_Drawing
|
||||||
Dim RootComp = myView.RootDrawingComponent
|
Dim RootComp = myView.RootDrawingComponent
|
||||||
Dim CompName = RootComp.Name
|
Dim CompName = RootComp.Name
|
||||||
|
|
||||||
Dim plane1Name As String = "OffPlane1@" & CompName & "@" & myView.GetName2 & "/" & frameComponents(0)("partName") & "-1@" & CompName.Split("-")(0)
|
Dim OutLine = myView.GetOutline
|
||||||
Dim plane2Name As String = "OffPlane2@" & CompName & "@" & myView.GetName2 & "/" & frameComponents(0)("partName") & "-1@" & CompName.Split("-")(0)
|
|
||||||
|
|
||||||
iDrawing.ClearSelection2(True)
|
For i = 0 To Individual_Frame_3D.cuttingList.ElementAt(0).Value.Count
|
||||||
Dim measurement As IDisplayDimension
|
Dim frameComponentName As String
|
||||||
swExtensions.SelectByID2(plane1Name, "PLANE", 0, 0, 0, True, 0, Nothing, 0)
|
If i = Individual_Frame_3D.cuttingList.ElementAt(0).Value.Count Then
|
||||||
swExtensions.SelectByID2(plane2Name, "PLANE", 0, 0, 0, True, 0, Nothing, 0)
|
frameComponentName = "frame_l_end_piece" & i + 1
|
||||||
measurement = iDrawing.AddHorizontalDimension2(0.005, 0, 0)
|
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
|
End Sub
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue