Private Sub AddDimensionsPurlin(s As Sheet, purlinFile As String, pf_laenge As Long, isGen2WithSpringPlate As Boolean, moduleClampAdapter As Long, sparrensystem As Long, mitPfettenklaue As Boolean)
s.Activate
Dim va As DrawingView
Dim vb As DrawingView
Dim vy As DrawingView
Set vb = GetDrawingViewS(s, "B")
Set va = GetDrawingViewS(s, "A")
Set vy = GetDrawingViewS(s, "Y")
If moduleClampAdapter > 0 Or (sparrensystem And mitPfettenklaue) Then
vy.Delete
End If
Dim refDocA As PartDocument
Set refDocA = GetViewDocS(s, "A")
Dim refDocB As PartDocument
Set refDocB = GetViewDocS(s, "B")
Dim wpIdx As Integer
Dim yPos As Double
Dim wpPointsA As WorkPoints
Set wpPointsA = refDocA.ComponentDefinition.WorkPoints
Dim giPointsA() As GeometryIntent
Dim wpPointColA As New Collection
Dim dlIdx As Long
Dim ods As OrdinateDimensionSet
Dim od As OrdinateDimension
Dim ld As LinearGeneralDimension
For i = 1 To wpPointsA.count
If wpPointsA(i).Point.Y >= 0 Then
va.SetIncludeStatus wpPointsA(i), True
wpPointColA.Add wpPointsA(i)
End If
Next i
InitSheetSettingsS s, 2, 4, 1, 1, 1
CenterViewOnSheetHS s, "1"
AdjustViewScaleS s, "1", GetSheetContentWidthPaddingS(s), GetSheetContentHeightPaddingS(s), 5
vb.Label.Position = ThisApplication.TransientGeometry.CreatePoint2d(vb.Label.Position.X, vb.Position.Y + 2.8)
va.Label.Position = ThisApplication.TransientGeometry.CreatePoint2d(va.Label.Position.X, va.Position.Y + 2.8)
giPointsA = GetSortetGiList(s, wpPointColA)
yPos = -0.3
For wpIdx = 1 To UBound(giPointsA)
If wpIdx > 1 Then
Set ld = AddDimensionLineGi(s, giPointsA(wpIdx - 1), giPointsA(wpIdx), 1.2, False)
If wpIdx = UBound(giPointsA) Then
ld.Tolerance.SetToSymmetric 3 / 10
Else
ld.Tolerance.SetToSymmetric 1 / 10
End If
End If
Next
Set ods = AddOrdinateDimensionLineSetGi(s, giPointsA, -0.3, False)
For dlIdx = 1 To ods.Members.count
Set od = ods.Members(dlIdx)
If dlIdx = ods.Members.count Then
od.Tolerance.SetToSymmetric Ceiling(pf_laenge / 1000) / 2 / 10
ElseIf dlIdx > 1 And dlIdx < ods.Members.count Then
od.Tolerance.SetToReference
End If
Next dlIdx
'--
Dim wpPointsB As WorkPoints
Set wpPointsB = refDocB.ComponentDefinition.WorkPoints
Dim giPointsB() As GeometryIntent
Dim wpPointColB As New Collection
For i = 1 To wpPointsB.count
If wpPointsB(i).Point.Y <= 0 Then
vb.SetIncludeStatus wpPointsB(i), True
wpPointColB.Add wpPointsB(i)
End If
Next i
giPointsB = GetSortetGiList(s, wpPointColB)
yPos = -0.3
For wpIdx = 1 To UBound(giPointsB)
If wpIdx > 1 Then
Set ld = AddDimensionLineGi(s, giPointsB(wpIdx - 1), giPointsB(wpIdx), 1.3, False)
If wpIdx = UBound(giPointsB) Then
ld.Tolerance.SetToSymmetric 3 / 10
Else
ld.Tolerance.SetToSymmetric 1 / 10
End If
End If
Next
Set ods = AddOrdinateDimensionLineSetGi(s, giPointsB, -0.3, False)
For dlIdx = 1 To ods.Members.count
Set od = ods.Members(dlIdx)
If dlIdx = ods.Members.count Then
od.Tolerance.SetToSymmetric Ceiling(pf_laenge / 1000) / 2 / 10
ElseIf dlIdx > 1 And dlIdx < ods.Members.count Then
od.Tolerance.SetToReference
End If
Next dlIdx
'--
End Sub