Instructions done

This commit is contained in:
Anton 2021-04-26 14:01:08 +02:00
parent 33249bc55c
commit 9c3a40d43b
3 changed files with 73 additions and 49 deletions

View File

@ -500,9 +500,9 @@ Public Class Frame_3D
swEquationMgr.Equation(i) = equationName & 0
counter += 1
End If
If counter = 7 Then
Exit For
End If
'If counter = 7 Then
' Exit For
'End If
Next
boolstatus = Part.EditRebuild3()
Dim swErrors As Integer

View File

@ -96,31 +96,68 @@ Public Class Instructions
Next
Dim straightFrames = Frame_3D.frameDT.Select("TYPE = 'SIDE'")
Dim worldX As Double
Dim worldY As Double
Dim offsetX As Double
Dim offsetY As Double
Dim straightFramesDT As New DataTable
straightFramesDT.Columns.Add("LENGTH", GetType(Integer))
straightFramesDT.Columns.Add("SIDE", GetType(Integer))
For i = 1 To 4
Dim sideNum = i + 1
If sideNum = 5 Then
sideNum = 1
End If
For j = straightFrames.Length - 1 To 0 Step -1
Dim DR As DataRow = straightFrames(j)
If DR("SIDE") = sideNum Then
Dim newDR As DataRow = straightFramesDT.NewRow
newDR("LENGTH") = DR("LENGTH")
newDR("SIDE") = i
straightFramesDT.Rows.Add(newDR)
End If
Next
Next
Dim sideOffsets(3) As Double
Dim cornerFrames = Frame_3D.frameDT.Select("TYPE = 'CORNER'")
For i = 0 To 3
Dim cornerFrameExist As Boolean = False
For j = 0 To cornerFrames.Length
If cornerFrames(j)("CORNER") = i + 1 Then
cornerFrameExist = True
Exit For
End If
Next
If cornerFrameExist = True Then
sideOffsets(i) = 0.21
Else
sideOffsets(i) = 0
End If
Next
Dim worldX, worldY, offsetX, offsetY As Double
Dim scale As Double = myView.ScaleDecimal
For i = 0 To straightFrames.Length - 1
If straightFrames(i)("SIDE") = 1 Then
worldX = swSheetWidth / 2
For i = 0 To straightFramesDT.Rows.Count - 1
If straightFramesDT.Rows(i)("SIDE") = 1 Then
worldX = swSheetWidth / 2 + (-(Data.gratingL / 1000) / 2 + sideOffsets(0) + (straightFramesDT.Rows(i)("LENGTH") / 1000) / 2) * scale
sideOffsets(0) += straightFramesDT.Rows(i)("LENGTH") / 1000
worldY = swSheetHeight / 2 + ((Data.gratingW / 1000) / 2 + 0.001) * scale
offsetX = worldX - 0.01 - 0.0045
offsetY = worldY + 0.015 + 0.0015
ElseIf straightFrames(i)("SIDE") = 2 Then
offsetY = worldY + 0.02 + 0.0015
ElseIf straightFramesDT.Rows(i)("SIDE") = 2 Then
worldX = swSheetWidth / 2 + ((Data.gratingL / 1000) / 2 + 0.001) * scale
worldY = swSheetHeight / 2
offsetX = worldX + 0.015 - 0.0045
worldY = swSheetHeight / 2 + ((Data.gratingW / 1000) / 2 - sideOffsets(1) - (straightFramesDT.Rows(i)("LENGTH") / 1000) / 2) * scale
sideOffsets(1) += straightFramesDT.Rows(i)("LENGTH") / 1000
offsetX = worldX + 0.02 - 0.0045
offsetY = worldY + 0.01 + 0.0015
ElseIf straightFrames(i)("SIDE") = 3 Then
worldX = swSheetWidth / 2
ElseIf straightFramesDT.Rows(i)("SIDE") = 3 Then
worldX = swSheetWidth / 2 + ((Data.gratingL / 1000) / 2 - sideOffsets(2) - (straightFramesDT.Rows(i)("LENGTH") / 1000) / 2) * scale
sideOffsets(2) += straightFramesDT.Rows(i)("LENGTH") / 1000
worldY = swSheetHeight / 2 - ((Data.gratingW / 1000) / 2 + 0.001) * scale
offsetX = worldX + 0.01 - 0.0045
offsetY = worldY - 0.015 + 0.0015
offsetY = worldY - 0.02 + 0.0015
Else
worldX = swSheetWidth / 2 - ((Data.gratingL / 1000) / 2 + 0.001) * scale
worldY = swSheetHeight / 2
offsetX = worldX - 0.015 - 0.0045
worldY = swSheetHeight / 2 + (-(Data.gratingW / 1000) / 2 + sideOffsets(3) + (straightFramesDT.Rows(i)("LENGTH") / 1000) / 2) * scale
sideOffsets(3) += straightFramesDT.Rows(i)("LENGTH") / 1000
offsetX = worldX - 0.02 - 0.0045
offsetY = worldY - 0.01 + 0.0015
End If
@ -152,27 +189,6 @@ Public Class Instructions
editedNote = swExtensions.EditBalloonProperties2(1, 3, 0, "F-" & i + 1, 0, "", 0, False, 1, "X", 0.001)
Next
'Frame_3D.frameDT()
'DT.Columns.Add("TYPE", GetType(String))
'DT.Columns.Add("LENGTH", GetType(Integer))
'DT.Columns.Add("SIDE", GetType(Integer))
'DT.Columns.Add("CORNER", GetType(Integer))
'DT.Columns.Add("ROTATION", GetType(Integer))
'DT.Columns.Add("OFFSET_W", GetType(Integer))
'DT.Columns.Add("OFFSET_L", GetType(Integer))
'noteAnnotation = myNote.GetAnnotation()
'noteAnnotation.SetPosition2(worldX + 0.01, 0.13, 0)
'textFormat = noteAnnotation.GetTextFormat(0)
'textFormat.CharHeight = 0.0025
'status = noteAnnotation.SetTextFormat(0, False, textFormat)
'iDrawing.ClearSelection2(True)
'balloonName = myNote.GetName()
'status = swExtensions.SelectByID2(balloonName & "@Drawing View" & i + 1, "NOTE", 0, 0, 0, False, 0, Nothing, 0)
'editedNote = swExtensions.EditBalloonProperties2(1, 3, 0, "F-" & Frame_3D.cuttingList.ElementAt(i).Value(j), 0, "", 0, False, 1, "X", 0.001)
End Sub
End Class

View File

@ -114,18 +114,26 @@ Public Class Multiple_3D_Simplified
Dim config As Configuration
config = assembly.GetActiveConfiguration
Dim swCustPropMgr = config.CustomPropertyManager
status = swCustPropMgr.Add3("Benämning", 30, "Floor grating " & User_Input.gratingMesh & " " & User_Input.gratingHeight & "/" & User_Input.loadBarThickness, 1)
status = swCustPropMgr.Add3("ExtraBenämning1", 30, "LxW " & Data.gratingL & "x" & Data.gratingW, 1)
If User_Input.gratingSerrated Then
status = swCustPropMgr.Add3("ExtraBenämning2", 30, "Serrated", 1)
Else
If withFrame = True Then
status = swCustPropMgr.Add3("Benämning", 30, "Placement instructions for assembly", 1)
status = swCustPropMgr.Add3("ExtraBenämning1", 30, "", 1)
status = swCustPropMgr.Add3("ExtraBenämning2", 30, "", 1)
End If
If User_Input.gratingLacquered Then
status = swCustPropMgr.Add3("Materialsort", 30, User_Input.gratingMaterial & " (Lacquered)", 1)
status = swCustPropMgr.Add3("Materialsort", 30, "", 1)
Else
status = swCustPropMgr.Add3("Materialsort", 30, User_Input.gratingMaterial, 1)
status = swCustPropMgr.Add3("Benämning", 30, "Floor grating " & User_Input.gratingMesh & " " & User_Input.gratingHeight & "/" & User_Input.loadBarThickness, 1)
status = swCustPropMgr.Add3("ExtraBenämning1", 30, "LxW " & Data.gratingL & "x" & Data.gratingW, 1)
If User_Input.gratingSerrated Then
status = swCustPropMgr.Add3("ExtraBenämning2", 30, "Serrated", 1)
Else
status = swCustPropMgr.Add3("ExtraBenämning2", 30, "", 1)
End If
If User_Input.gratingLacquered Then
status = swCustPropMgr.Add3("Materialsort", 30, User_Input.gratingMaterial & " (Lacquered)", 1)
Else
status = swCustPropMgr.Add3("Materialsort", 30, User_Input.gratingMaterial, 1)
End If
End If
status = swCustPropMgr.Add3("Art. Nr", 30, "TBD", 1)
status = swCustPropMgr.Add3("Material_Art", 30, "TBD", 1)