Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Interpreting iLogic error

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
alikhan.ganayev
412 Views, 5 Replies

Interpreting iLogic error

For an internship I have to debug an existing product configuration. I don't have a lot of knowledge when it comes to iLogic and neither do the other people working here, the guy who wrote this quit. So one of the problems was if you change the diameter of a parameter called 'RolDiameter' to 60, it would give the error as seen in the picture because it couldn't locate the file. Solution to this was pretty simple as the guy before me just forgot to put '.ipt' behind the file name in the rule. Once the rule 'Aandrijving' could locate the file and the diameter would be set to 60, the rule would just endlessly loop and keep loading more and more components until I'd have to shut down Inventor in the Task Manager. So far I have not been able to find out what causes this loop. In a last ditch attempt to figure it out I removed the extension behind the file to maybe be able to figure out where this file is mentioned in the rules or external rules. Only problem is, I don't know how to interpret an error like this beyond the first two lines. I hope I have explained this problem well enough, it is my first time posting here. Running Inventor 2019 on windows 10.

ERROR dia60.PNG

Labels (2)
5 REPLIES 5
Message 2 of 6

Hi @alikhan.ganayev.  Those error messages can definitely be difficult to understand or get anything useful from at times.  But sometimes they can give you enough of a hint, that you can figure out what it was trying to do when it failed or caused an error.  In this case, it looks like you may have a line of code in your iLogic rule that is attempting to replace an existing ComponentOccurrence in an assembly.  And in this line of code you must supply the full file name (path, file name, & file extension) of the file that is to replace the existing component.  And it looks like it can't find the file at the specified replacement file path.  This could be due to the file extension being missing, but since you tried fixing that, then ended up in an endless loop, I would say there are more problems in the code than just this one.  Is this line of code that is attempting to replace the component within a 'loop'?  A loop  is a block of code starting with something like "For Each ..... In ...." or "For i = 1 To Group.Count", then closed out with the keyword "Next".  There are other types of loops too, but these are the main ones.

 

It would be a lot easier for us to diagnose the problems within the code if we could see the whole code, and fully understood its intent or purpose.  You could attach it to this forum post by copying its contents into a .txt file, then attaching it to your next response post here, or you could just copy and paste the code directly from the rule to a code window here in your next post.  There is a tool called "Insert/Edit code sample" (looks like "</>") in the toolbar above the text box when you are writing a post here.  When you click that, it created a code window within the text box area to paste iLogic (or other) code into.  Just make sure there is not anything confidential or proprietary within the code, if that is important to you.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 6

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
Message 4 of 6

Also maybe a good note. It was this one giving me the trouble
Dim pathKettinglus119T13 = _
MyProject.KooponderdelenPath & _
"\VERMEIRE" & _
"\Vermeire - 10B1-28_2xT13_S119.ipt"

I appreciate the response. I don't think it's in a loop.
Message 5 of 6

Wow.  That's a fairly complex looking rule there.  I'm thinking this may be a bit harder to diagnose than I was originally predicting.  Also, I haven't seen some of those coding terms used in probably 8 to 10 years, so I'm not sure if they still work anymore.  I'm not familiar with the use of the term "MyProject", which is used many times throughout the rule.  And the term "Component.ReplaceIfDifferent()" looks like an iLogic snippet, but doesn't match any of the current snippets.  The last time I saw that line used was in this old post from 2010, as part of a custom solution that @MjDeck posted back then.  Perhaps he may be able to help us translate & update your code to today's equivalent.  He is the resident iLogic guru and Autodesk Software Developer who helped create it.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 6 of 6

I put some message boxes throughout the code to figure out where it was getting stuck and it got stuck here

 

Dim currentLength = iAssembly.CurrentRowValue("Rol", "Lengte")

Dim requestedLength = Breedte + 60

If currentLength <> requestedLength Then

        iAssembly.FindRow("Rol", "Lengte", "=", requestedLength)

End If

 

at the very end, I put a message box before it and after it. I do appreciate the response and I might just take you up on that advice. Have a great day.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report