InventorVb.UpdateWhenDone = True
Dim doc As AssemblyDocument = ThisDoc.Document
MyProject.Init(doc)
' # Paths
' ## Ketting
Dim pathMotorketting119 = _
MyProject.KooponderdelenPath & _
"\VERMEIRE" & _
"\Vermeire - 10B1-36_3xT15_S119_H89.ipt"
Dim pathKettinglus119 = _
MyProject.KooponderdelenPath & _
"\VERMEIRE" & _
"\Vermeire - 10B1-30_2xT15_S119.ipt"
Dim pathMotorketting119T13 = _
MyProject.KooponderdelenPath & _
"\VERMEIRE" & _
"\Vermeire - 10B1-34_2xT13_1xT15_S119_H83.ipt"
Dim pathKettinglus119T13 = _
MyProject.KooponderdelenPath & _
"\VERMEIRE" & _
"\Vermeire - 10B1-28_2xT13_S119.ipt"
Dim pathMotorketting135 = _
MyProject.KooponderdelenPath & _
"\VERMEIRE" & _
"\Vermeire - 10B1-38_3xT15_S135_H92.ipt"
Dim pathKettinglus135 = _
MyProject.KooponderdelenPath & _
"\VERMEIRE" & _
"\Vermeire - 10B1-32_2xT15_S135.ipt"
Dim pathKettinglus = ""
Dim pathMotorketting = ""
If Steek = 119 Then
If RolDiameter = 60 Then
pathKettinglus = pathKettinglus119T13
pathMotorketting = pathMotorketting119T13
Else
pathKettinglus = pathKettinglus119
pathMotorketting = pathMotorketting119
End If
Else If Steek = 135 Then
pathKettinglus = pathKettinglus135
pathMotorketting = pathMotorketting135
End If
' ## Motor
Dim pathPowerSourceLineWithSwitch1 = _
MyProject.KooponderdelenPath & _
"\SIEMENS\Geared motors" & _
"\SIEMENS - 2KJ3601-1CE21-4FL1-Z_D21+H02+K01+K07+L02+L11+L75+M10+M55.ipt"
Dim pathPowerSourceInverterWithSwitch1 = _
MyProject.KooponderdelenPath & _
"\SIEMENS\Geared motors" & _
"\SIEMENS - 2KJ3601-1CE21-4FL1-Z_D21+H02+K01+K07+L02+L11+L75+M10+M55+P91+U01+U43+U71.ipt"
Dim pathPowerSourceInverterAndSwitchSeperate1 = _
MyProject.KooponderdelenPath & _
"\SIEMENS\Geared motors" & _
"\SIEMENS - 2KJ3601-1CE21-4FL1-Z_D21+H02+K01+K07+L02+L11+L75+M10+M59+P91+U01+U43.ipt"
Dim pathPowerSourceLineWithSwitch2 = _
MyProject.KooponderdelenPath & _
"\SIEMENS\Geared motors" & _
"\SIEMENS - 2KJ3601-1CE21-4FL1-Z_D11+H02+K01+K07+L02+L11+L75+M10+M65.ipt"
Dim pathPowerSourceInverterWithSwitch2 = _
MyProject.KooponderdelenPath & _
"\SIEMENS\Geared motors" & _
"\SIEMENS - 2KJ3601-1CE21-4FL1-Z_D11+H02+K01+K07+L02+L11+L75+M10+M65+P91+U01+U43+U71.ipt"
Dim pathPowerSourceInverterAndSwitchSeperate2 = _
MyProject.KooponderdelenPath & _
"\SIEMENS\Geared motors" & _
"\SIEMENS - 2KJ3601-1CE21-4FL1-Z_D11+H02+K01+K07+L02+L11+L75+M10+M61+P91+U01+U43.ipt"
Dim pathWerkschakelaar = _
MyProject.StandaardStukkenPTPath & _
"\99991000 - PR - Montageplaat werkschakelaar.ipt"
Dim pathSwitch = _
MyProject.KooponderdelenPath & _
"\SIEMENS\Switching Devices" & _
"\SIEMENS - 3LD2064-1GP51.iam"
' ## Rollen
Dim pathRol89 = _
MyProject.KooponderdelenPath & _
"\INTERROLL" & _
"\Interroll - CR3950_D89_20_M12_2x10B1T15.iam"
Dim pathRol80 = _
MyProject.KooponderdelenPath & _
"\INTERROLL" & _
"\Interroll - CR3950_D80_20_M12_2x10B1T15.iam"
Dim pathRol60 = _
MyProject.KooponderdelenPath & _
"\INTERROLL" & _
"\Interroll - CR3500_HEAVY_D60_17_M12_2x10B1T13.iam"
Dim pathRol As String = ""
If RolDiameter = 89 Then
pathRol = pathRol89
Else If RolDiameter = 60 Then
pathRol = pathRol60
Else
pathRol = pathRol80
End If
' ## Kettingwiel motor
Dim pathKettingwielT15 = _
MyProject.StandaardStukkenPTPath & _
"\99991000 - PR - Kettingwiel motor.ipt"
Dim pathKettingwielT13 = _
MyProject.StandaardStukkenPTPath & _
"\99991000 - PR - Kettingwiel motor T13.iam"
Dim pathKettingwiel As String = ""
If RolDiameter = 60 Then
pathKettingwiel = pathKettingwielT13
Else
pathKettingwiel = pathKettingwielT15
End If
' # Stukken
' ## Ketting
Component.ReplaceIfDifferent("Motorketting",
pathMotorketting, True)
Component.ReplaceIfDifferent("Kettinglus",
pathKettinglus, True)
' ## Kettingwiel motor
Component.ReplaceIfDifferent("Kettingwiel",
pathKettingwiel, False)
' ## Motor
If MotorRichting = 1 Then
Select Case PowerSource
Case PowerSourceLineWithSwitch
Component.ReplaceIfDifferent("Aandrijfmotor", pathPowerSourceLineWithSwitch1, True_)
Case PowerSourceInverterWithSwitch
Component.ReplaceIfDifferent("Aandrijfmotor", pathPowerSourceInverterWithSwitch1, True_)
Case PowerSourceInverterAndSwitchSeperate
Component.ReplaceIfDifferent("Aandrijfmotor", pathPowerSourceInverterAndSwitchSeperate1, True_)
End Select
Else If MotorRichting = -1 Then
Select Case PowerSource
Case PowerSourceLineWithSwitch
Component.ReplaceIfDifferent("Aandrijfmotor", pathPowerSourceLineWithSwitch2, True_)
Case PowerSourceInverterWithSwitch
Component.ReplaceIfDifferent("Aandrijfmotor", pathPowerSourceInverterWithSwitch2, True_)
Case PowerSourceInverterAndSwitchSeperate
Component.ReplaceIfDifferent("Aandrijfmotor", pathPowerSourceInverterAndSwitchSeperate2, True_)
End Select
End If
Constraints.AddMate("MateAandrijfmotor1", "Aandrijfmotor", "Face1",
"Spanplaat motor", "Face1",
e1InferredType := InferredTypeEnum.kInferredLine,
e2InferredType := InferredTypeEnum.kInferredLine,
solutionType := MateConstraintSolutionTypeEnum.kUndirectedSolutionType)
Constraints.AddAngle("AngleAandrijfmotor1", "Aandrijfmotor", "XY Plane", "",
"XY Plane", 0.00 deg,
AngleConstraintSolutionTypeEnum.kReferenceVectorSolution,
"", "XY Plane")
Constraints.AddMate("MateAandrijfmotor2", "Aandrijfmotor", "Face0",
"Spanplaat motor", "Face0")
' ### Schakelaar
ThisAssembly.BeginManage("Switch")
If AddSwitch Then
Dim Montageplaat_werksch = Components.Add("Montageplaat werkschakelaar",
pathWerkschakelaar)
Montageplaat_werksch.Occurrence.SetDesignViewRepresentation("Colored", True)
Dim SIEMENS_3LD2064_1GP5 = Components.Add("Switch",
pathSwitch)
SIEMENS_3LD2064_1GP5.Occurrence.SetDesignViewRepresentation("Colored", True)
Constraints.AddInsert("InsertSwitch1",
{"Switch", "1"}, "Edge0",
"Montageplaat werkschakelaar", "Edge1",
axesOpposed := True)
Constraints.AddInsert("InsertSwitch2", "Montageplaat werkschakelaar",
"Edge0",
{"Zijwang Aandrijving", "Zijwang aandrijving"},
"Edge4", axesOpposed := True)
Constraints.AddMate("MateSwitch2",
{"Zijwang Aandrijving", "Zijwang aandrijving"},
"Face10", "Montageplaat werkschakelaar",
"Face0",
e1InferredType := InferredTypeEnum.kInferredLine,
e2InferredType := InferredTypeEnum.kInferredLine,
solutionType := MateConstraintSolutionTypeEnum.kUndirectedSolutionType)
Constraints.AddMate("MateSwitch3", "Switch",
"YZ Plane", "Montageplaat werkschakelaar",
"XZ Plane")
End If
ThisAssembly.EndManage("Switch")
' ## Draadnet
Dim lengteGewenst = Math.Floor(Lengte / 100) * 100
Dim lengteNu = iAssembly.CurrentRowValue("Draadnet", "Length")
If lengteGewenst <> lengteNu Then
i = iPart.FindRow("Draadnet", "Hoogte", "=", 60, "Breedte", "=", 100, "Length", "=", lengteGewenst)
End If
' ## Rollen
Component.ReplaceIfDifferent("Rol", pathRol, True)
Try
Constraints.Delete("InsertRol")
Constraints.AddInsert("InsertRol", {"Rol", "ShaftSideA"}, "Edge0",
{"Zijwang Aandrijving", "Zijwang aandrijving"},
"Rol1", axesOpposed := True,
lockRotation := True)
Catch e As Exception
End Try
Dim currentLength = iAssembly.CurrentRowValue("Rol", "Lengte")
Dim requestedLength = Breedte + 60
If currentLength <> requestedLength Then
iAssembly.FindRow("Rol", "Lengte", "=", requestedLength)
End If
Parameter("UpdateColors") = True