Added measurements for recesses and double recesses
This commit is contained in:
parent
105a342d95
commit
5ff9ac938f
|
|
@ -111,21 +111,47 @@
|
||||||
|
|
||||||
Dim numOfNewPoints As Integer
|
Dim numOfNewPoints As Integer
|
||||||
|
|
||||||
|
|
||||||
|
Dim mesNum As Integer = pointsMeasurements.Count - 1
|
||||||
If angleFunctionActive Then
|
If angleFunctionActive Then
|
||||||
|
|
||||||
|
|
||||||
|
For i = 2 To pointsMeasurements.Count - 1
|
||||||
|
Dim mesName As String = pointsMeasurements.Keys(i)
|
||||||
|
If index < pointsMeasurements(mesName)(0) Then
|
||||||
|
pointsMeasurements(mesName)(0) = pointsMeasurements(mesName)(0) + 1
|
||||||
|
pointsMeasurements(mesName)(1) = pointsMeasurements(mesName)(1) + 1
|
||||||
|
ElseIf index = pointsMeasurements(mesName)(0) OrElse index = pointsMeasurements(mesName)(1) Then
|
||||||
|
pointsMeasurements(mesName)(1) = pointsMeasurements(mesName)(1) + 1
|
||||||
|
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
If pXP < GUI_Drawing_Panel.containerMidX Then
|
If pXP < GUI_Drawing_Panel.containerMidX Then
|
||||||
If pYP > GUI_Drawing_Panel.containerMidY Then
|
If pYP > GUI_Drawing_Panel.containerMidY Then
|
||||||
'Kvadrant 4
|
'Kvadrant 4
|
||||||
GUI_Drawing_Panel.points.Add("pA" & pointCounter * 2 - 1, {pXP + d1P, pYP, pXSW + d1SW, pYSW})
|
GUI_Drawing_Panel.points.Add("pA" & pointCounter * 2 - 1, {pXP + d1P, pYP, pXSW + d1SW, pYSW})
|
||||||
GUI_Drawing_Panel.points.Add("pA" & pointCounter * 2, {pXP, pYP - d2P, pXSW, pYSW + d2SW})
|
GUI_Drawing_Panel.points.Add("pA" & pointCounter * 2, {pXP, pYP - d2P, pXSW, pYSW + d2SW})
|
||||||
|
|
||||||
|
'Recess measuements
|
||||||
|
pointsMeasurements.Add("A_" & mesNum, {index + 1, index + 2, 3})
|
||||||
|
pointsMeasurements.Add("A_" & mesNum + 1, {index + 1, index + 2, 4})
|
||||||
|
|
||||||
Else
|
Else
|
||||||
'Kvadrant 1
|
'Kvadrant 1
|
||||||
|
|
||||||
|
|
||||||
GUI_Drawing_Panel.points.Add("pA" & pointCounter * 2 - 1, {pXP, pYP + d2P, pXSW, pYSW - d2SW})
|
GUI_Drawing_Panel.points.Add("pA" & pointCounter * 2 - 1, {pXP, pYP + d2P, pXSW, pYSW - d2SW})
|
||||||
GUI_Drawing_Panel.points.Add("pA" & pointCounter * 2, {pXP + d1P, pYP, pXSW + d1SW, pYSW})
|
GUI_Drawing_Panel.points.Add("pA" & pointCounter * 2, {pXP + d1P, pYP, pXSW + d1SW, pYSW})
|
||||||
|
'Outer measuements
|
||||||
pointsMeasurements("Lmes")(1) = pointsMeasurements("Lmes")(1) + 1
|
pointsMeasurements("Lmes")(1) = pointsMeasurements("Lmes")(1) + 1
|
||||||
pointsMeasurements("Wmes")(0) = pointsMeasurements("Wmes")(0) + 1
|
pointsMeasurements("Wmes")(0) = pointsMeasurements("Wmes")(0) + 1
|
||||||
pointsMeasurements("Wmes")(1) = pointsMeasurements("Wmes")(1) + 1
|
pointsMeasurements("Wmes")(1) = pointsMeasurements("Wmes")(1) + 1
|
||||||
|
|
||||||
|
|
||||||
|
'Recess measuements
|
||||||
|
pointsMeasurements.Add("A_" & mesNum, {index + 1, index + 2, 1})
|
||||||
|
pointsMeasurements.Add("A_" & mesNum + 1, {index + 1, index + 2, 4})
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If pYP > GUI_Drawing_Panel.containerMidY Then
|
If pYP > GUI_Drawing_Panel.containerMidY Then
|
||||||
|
|
@ -134,6 +160,10 @@
|
||||||
GUI_Drawing_Panel.points.Add("pA" & pointCounter * 2, {pXP - d1P, pYP, pXSW - d1SW, pYSW})
|
GUI_Drawing_Panel.points.Add("pA" & pointCounter * 2, {pXP - d1P, pYP, pXSW - d1SW, pYSW})
|
||||||
|
|
||||||
pointsMeasurements("Wmes")(1) = pointsMeasurements("Wmes")(1) + 1
|
pointsMeasurements("Wmes")(1) = pointsMeasurements("Wmes")(1) + 1
|
||||||
|
|
||||||
|
'Recess measuements
|
||||||
|
pointsMeasurements.Add("A_" & mesNum, {index + 1, index + 2, 2})
|
||||||
|
pointsMeasurements.Add("A_" & mesNum + 1, {index + 1, index + 2, 3})
|
||||||
Else
|
Else
|
||||||
'Kvadrant 2
|
'Kvadrant 2
|
||||||
GUI_Drawing_Panel.points.Add("pA" & pointCounter * 2 - 1, {pXP - d1P, pYP, pXSW - d1SW, pYSW})
|
GUI_Drawing_Panel.points.Add("pA" & pointCounter * 2 - 1, {pXP - d1P, pYP, pXSW - d1SW, pYSW})
|
||||||
|
|
@ -141,6 +171,10 @@
|
||||||
|
|
||||||
pointsMeasurements("Lmes")(1) = pointsMeasurements("Lmes")(1) + 1
|
pointsMeasurements("Lmes")(1) = pointsMeasurements("Lmes")(1) + 1
|
||||||
pointsMeasurements("Wmes")(1) = pointsMeasurements("Wmes")(1) + 1
|
pointsMeasurements("Wmes")(1) = pointsMeasurements("Wmes")(1) + 1
|
||||||
|
|
||||||
|
'Recess measuements
|
||||||
|
pointsMeasurements.Add("A_" & mesNum, {index + 1, index + 2, 1})
|
||||||
|
pointsMeasurements.Add("A_" & mesNum + 1, {index + 1, index + 2, 2})
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
pointsFunc.Add("pA" & pointCounter * 2 - 1, False)
|
pointsFunc.Add("pA" & pointCounter * 2 - 1, False)
|
||||||
|
|
@ -153,13 +187,28 @@
|
||||||
numOfNewPoints = 2
|
numOfNewPoints = 2
|
||||||
angleFunctionActive = False
|
angleFunctionActive = False
|
||||||
|
|
||||||
Else
|
Else ' square
|
||||||
|
|
||||||
|
For i = 2 To pointsMeasurements.Count - 1
|
||||||
|
Dim mesName As String = pointsMeasurements.Keys(i)
|
||||||
|
If index < pointsMeasurements(mesName)(0) Then
|
||||||
|
pointsMeasurements(mesName)(0) = pointsMeasurements(mesName)(0) + 2
|
||||||
|
pointsMeasurements(mesName)(1) = pointsMeasurements(mesName)(1) + 2
|
||||||
|
ElseIf index = pointsMeasurements(mesName)(0) OrElse index = pointsMeasurements(mesName)(1) Then
|
||||||
|
pointsMeasurements(mesName)(1) = pointsMeasurements(mesName)(1) + 2
|
||||||
|
|
||||||
|
End If
|
||||||
|
Next
|
||||||
If pXP < GUI_Drawing_Panel.containerMidX Then
|
If pXP < GUI_Drawing_Panel.containerMidX Then
|
||||||
If pYP > GUI_Drawing_Panel.containerMidY Then
|
If pYP > GUI_Drawing_Panel.containerMidY Then
|
||||||
'Kvadrant 4
|
'Kvadrant 4
|
||||||
GUI_Drawing_Panel.points.Add("pS" & pointCounter * 3 - 2, {pXP + d1P, pYP, pXSW + d1SW, pYSW})
|
GUI_Drawing_Panel.points.Add("pS" & pointCounter * 3 - 2, {pXP + d1P, pYP, pXSW + d1SW, pYSW})
|
||||||
GUI_Drawing_Panel.points.Add("pS" & pointCounter * 3 - 1, {pXP + d1P, pYP - d2P, pXSW + d1SW, pYSW + d2SW})
|
GUI_Drawing_Panel.points.Add("pS" & pointCounter * 3 - 1, {pXP + d1P, pYP - d2P, pXSW + d1SW, pYSW + d2SW})
|
||||||
GUI_Drawing_Panel.points.Add("pS" & pointCounter * 3, {pXP, pYP - d2P, pXSW, pYSW + d2SW})
|
GUI_Drawing_Panel.points.Add("pS" & pointCounter * 3, {pXP, pYP - d2P, pXSW, pYSW + d2SW})
|
||||||
|
|
||||||
|
'Recess measuements
|
||||||
|
pointsMeasurements.Add("S_" & mesNum, {index + 1, index + 2, 4})
|
||||||
|
pointsMeasurements.Add("S_" & mesNum + 1, {index + 2, index + 3, 3})
|
||||||
Else
|
Else
|
||||||
'Kvadrant 1
|
'Kvadrant 1
|
||||||
GUI_Drawing_Panel.points.Add("pS" & pointCounter * 3 - 2, {pXP, pYP + d2P, pXSW, pYSW - d2SW})
|
GUI_Drawing_Panel.points.Add("pS" & pointCounter * 3 - 2, {pXP, pYP + d2P, pXSW, pYSW - d2SW})
|
||||||
|
|
@ -169,6 +218,10 @@
|
||||||
pointsMeasurements("Lmes")(1) = pointsMeasurements("Lmes")(1) + 2
|
pointsMeasurements("Lmes")(1) = pointsMeasurements("Lmes")(1) + 2
|
||||||
pointsMeasurements("Wmes")(0) = pointsMeasurements("Wmes")(0) + 2
|
pointsMeasurements("Wmes")(0) = pointsMeasurements("Wmes")(0) + 2
|
||||||
pointsMeasurements("Wmes")(1) = pointsMeasurements("Wmes")(1) + 2
|
pointsMeasurements("Wmes")(1) = pointsMeasurements("Wmes")(1) + 2
|
||||||
|
|
||||||
|
'Recess measuements
|
||||||
|
pointsMeasurements.Add("S_" & mesNum, {index + 1, index + 2, 1})
|
||||||
|
pointsMeasurements.Add("S_" & mesNum + 1, {index + 2, index + 3, 4})
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If pYP > GUI_Drawing_Panel.containerMidY Then
|
If pYP > GUI_Drawing_Panel.containerMidY Then
|
||||||
|
|
@ -178,6 +231,10 @@
|
||||||
GUI_Drawing_Panel.points.Add("pS" & pointCounter * 3, {pXP - d1P, pYP, pXSW - d1SW, pYSW})
|
GUI_Drawing_Panel.points.Add("pS" & pointCounter * 3, {pXP - d1P, pYP, pXSW - d1SW, pYSW})
|
||||||
|
|
||||||
pointsMeasurements("Wmes")(1) = pointsMeasurements("Wmes")(1) + 2
|
pointsMeasurements("Wmes")(1) = pointsMeasurements("Wmes")(1) + 2
|
||||||
|
|
||||||
|
'Recess measuements
|
||||||
|
pointsMeasurements.Add("S_" & mesNum, {index + 1, index + 2, 3})
|
||||||
|
pointsMeasurements.Add("S_" & mesNum + 1, {index + 2, index + 3, 2})
|
||||||
Else
|
Else
|
||||||
'Kvadrant 2
|
'Kvadrant 2
|
||||||
GUI_Drawing_Panel.points.Add("pS" & pointCounter * 3 - 2, {pXP - d1P, pYP, pXSW - d1SW, pYSW})
|
GUI_Drawing_Panel.points.Add("pS" & pointCounter * 3 - 2, {pXP - d1P, pYP, pXSW - d1SW, pYSW})
|
||||||
|
|
@ -186,6 +243,10 @@
|
||||||
|
|
||||||
pointsMeasurements("Lmes")(1) = pointsMeasurements("Lmes")(1) + 2
|
pointsMeasurements("Lmes")(1) = pointsMeasurements("Lmes")(1) + 2
|
||||||
pointsMeasurements("Wmes")(1) = pointsMeasurements("Wmes")(1) + 2
|
pointsMeasurements("Wmes")(1) = pointsMeasurements("Wmes")(1) + 2
|
||||||
|
|
||||||
|
'Recess measuements
|
||||||
|
pointsMeasurements.Add("S_" & mesNum, {index + 1, index + 2, 2})
|
||||||
|
pointsMeasurements.Add("S_" & mesNum + 1, {index + 2, index + 3, 1})
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
pointsFunc.Add("pS" & pointCounter * 3 - 2, True)
|
pointsFunc.Add("pS" & pointCounter * 3 - 2, True)
|
||||||
|
|
|
||||||
|
|
@ -109,13 +109,19 @@ Public Class SW_Drawing_Gratings
|
||||||
Dim RootComp = myView.RootDrawingComponent
|
Dim RootComp = myView.RootDrawingComponent
|
||||||
Dim CompName = RootComp.Name
|
Dim CompName = RootComp.Name
|
||||||
|
|
||||||
Dim measurement As IDisplayDimension
|
|
||||||
Dim OutLine = myView.GetOutline
|
Dim OutLine = myView.GetOutline
|
||||||
Dim X_Mid = (OutLine(2) - OutLine(0)) / 2 + OutLine(0)
|
Dim X_Mid = (OutLine(2) - OutLine(0)) / 2 + OutLine(0)
|
||||||
Dim Y_Mid = (OutLine(3) - OutLine(1)) / 2 + OutLine(1)
|
Dim Y_Mid = (OutLine(3) - OutLine(1)) / 2 + OutLine(1)
|
||||||
|
|
||||||
Add_Dimensions(GUI_Functions.pointsMeasurements("Lmes"), CompName, myView, iDrawing, swExtensions, measurement, X_Mid, OutLine, Y_Mid)
|
For i = 2 To GUI_Functions.pointsMeasurements.Count - 1
|
||||||
Add_Dimensions(GUI_Functions.pointsMeasurements("Wmes"), CompName, myView, iDrawing, swExtensions, measurement, X_Mid, OutLine, Y_Mid)
|
Dim mesName As String = GUI_Functions.pointsMeasurements.Keys(i)
|
||||||
|
Add_Dimensions(GUI_Functions.pointsMeasurements(mesName), CompName, myView, iDrawing, swExtensions, X_Mid, OutLine, Y_Mid)
|
||||||
|
|
||||||
|
Next
|
||||||
|
|
||||||
|
Add_Dimensions(GUI_Functions.pointsMeasurements("Lmes"), CompName, myView, iDrawing, swExtensions, X_Mid, OutLine, Y_Mid)
|
||||||
|
Add_Dimensions(GUI_Functions.pointsMeasurements("Wmes"), CompName, myView, iDrawing, swExtensions, X_Mid, OutLine, Y_Mid)
|
||||||
Dim myView2 As View
|
Dim myView2 As View
|
||||||
myView2 = iDrawing.CreateDrawViewFromModelView3(GUI.filepath & "\Temp\TESTPART1.SLDPRT", "*Bottom", swSheetWidth / 2, OutLine(3) + 0.03, 0)
|
myView2 = iDrawing.CreateDrawViewFromModelView3(GUI.filepath & "\Temp\TESTPART1.SLDPRT", "*Bottom", swSheetWidth / 2, OutLine(3) + 0.03, 0)
|
||||||
Dim OutLine2 = myView2.GetOutline
|
Dim OutLine2 = myView2.GetOutline
|
||||||
|
|
@ -124,7 +130,7 @@ Public Class SW_Drawing_Gratings
|
||||||
Dim point2Name As String = "Plane1@" & CompName & "@" & myView2.GetName2
|
Dim point2Name As String = "Plane1@" & CompName & "@" & myView2.GetName2
|
||||||
|
|
||||||
iDrawing.ClearSelection2(True)
|
iDrawing.ClearSelection2(True)
|
||||||
|
Dim measurement As IDisplayDimension
|
||||||
swExtensions.SelectByID2(point1Name, "PLANE", 0, 0, 0, True, 0, Nothing, 0)
|
swExtensions.SelectByID2(point1Name, "PLANE", 0, 0, 0, True, 0, Nothing, 0)
|
||||||
swExtensions.SelectByID2(point2Name, "PLANE", 0, 0, 0, True, 0, Nothing, 0)
|
swExtensions.SelectByID2(point2Name, "PLANE", 0, 0, 0, True, 0, Nothing, 0)
|
||||||
measurement = iDrawing.AddVerticalDimension2(OutLine2(2), OutLine2(1), 0)
|
measurement = iDrawing.AddVerticalDimension2(OutLine2(2), OutLine2(1), 0)
|
||||||
|
|
@ -144,9 +150,9 @@ Public Class SW_Drawing_Gratings
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Shared Sub Add_Dimensions(points() As Integer, CompName As String, myView As View, iDrawing As DrawingDoc, swExtensions As SldWorks.ModelDocExtension _
|
Private Shared Sub Add_Dimensions(points() As Integer, CompName As String, myView As View, iDrawing As DrawingDoc, swExtensions As SldWorks.ModelDocExtension _
|
||||||
, measurement As IDisplayDimension, X_Mid As Double, OutLine() As Double, Y_Mid As Double)
|
, X_Mid As Double, OutLine() As Double, Y_Mid As Double)
|
||||||
|
|
||||||
|
|
||||||
|
Dim measurement As IDisplayDimension
|
||||||
Dim point1Name As String = "Point" & points(0) & "@Sketch1@" & CompName & "@" & myView.GetName2
|
Dim point1Name As String = "Point" & points(0) & "@Sketch1@" & CompName & "@" & myView.GetName2
|
||||||
Dim point2Name As String = "Point" & points(1) & "@Sketch1@" & CompName & "@" & myView.GetName2
|
Dim point2Name As String = "Point" & points(1) & "@Sketch1@" & CompName & "@" & myView.GetName2
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue