Iventor 2024 Error handling is terrible..

Iventor 2024 Error handling is terrible..

Spoiwk
Advocate Advocate
503 Views
4 Replies
Message 1 of 5

Iventor 2024 Error handling is terrible..

Spoiwk
Advocate
Advocate

Dear Users,

 

I don't know who of you uses the new Inventor 2024 in combination with iLogic models. But it doesn't seem right. I cannot seem to get the error in which part or rule/line. The model I used worked perfectly fine before but from the migration from 2022->2024 it started to get errors. Now i'm spending 3 full days already fixing the problem. However cannot find it. 

 

  • Done all migrations
  • Updated all style references
  • Used more Parameter references in code
  • Checked all the rules for Boolean/Integer to string conversion
  • Checked if other VBA add-ins messed with the model, so excluded them

 

Spoiwk_0-1706257042361.png

 

I am using the sheet metal style set function. I think this has something to do with it.

 

I cannot send the model.

 

Do any of you got any solutions? It's really frustrating.

 

Thanks in advance.

0 Likes
504 Views
4 Replies
Replies (4)
Message 2 of 5

robbeRtek
Advocate
Advocate

Hello,

I suspect there might be an issue with the data type of an object within a (object) collection. If you're using Visual Studio, insert breakpoints to identify where the crash occurs. Examine the types and other properties of the object that need attention when the error occurs.

In iLogic, you can use multiple MsgBox statements to pinpoint the crash. By adding or modifying MsgBox statements before the line where the crash occurs, you can inspect the type and other crucial properties of the object.

MessageBox.Show(Object.type,"Title")

If this information proves helpful in identifying the error, I would appreciate it if you could support and vote for these 'Inventor ideas.' Thank you!
pointcloud display/import on idw - Autodesk Community
Add Multiple Region Label/Types/Properties - Autodesk Community

0 Likes
Message 3 of 5

A.Acheson
Mentor
Mentor

Hi @Spoiwk 

 

Can you share the code your using? Have you managed to narrow down the exact line it occurs at? Can the operation the code breaks at be done manually? Unfortunately because we only see some of the error message this isn't useful. 

 

Are you using  to ensure all object variables are declared

Option Explicit On

 It also sounds like your using the iLogic API which is more difficult in my opinion to figure out what's going on because some of the data is hidden in the function. 

 

If your model is confidential maybe you can prepare a non confidential model with the same issues and share screen shots and or the model in a zipped folder. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 4 of 5

bradeneuropeArthur
Mentor
Mentor

Understanding the sourcecode when programming is much more important than the code selves, because of preventing these issues.

One of the reasons I prefer using ie vb.net which will warn you if minor programming mistakes are made.  Ilogic alone is to easy to use and easier to make programming mistakes. I know this solves not the issue for you know, but for the future you could consider this.

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 5 of 5

Spoiwk
Advocate
Advocate

@bradeneuropeArthur @A.Acheson @robbeRtek 

 

Hi guys, thank you for your reaction.

 

To make it more simple I describe what i'm basically doing. And also my thinking process.

 

First off I have a main assembly which sends parameters to a sub part which is basically my master. All the sub-parts are linked to this part. My guess is that because of the migration form 2022 to 2024 some parameter objects are not defined correctly in those sub-parts.

 

I'm using just a local trigger (undefined object, worked perfectly before to define all these will take me a long time, also all the other, lets say 100 components do work.) which triggers the rule. The triggering parameter which is linked is blue. Example below:

 

 

Trigger = Male + ThicknessFlange + Material_Type

iLogicVb.RunExternalRule("Sheetmetal_Style.iLogicVb")

If Parameter("Male") = 0 Then
Parameter("d22") = Parameter("HeightFemaleFlange")
Parameter("d199") = Parameter("Flange") + Parameter("ThicknessFlange ")
Parameter("d112") = -90.0 deg
Feature.IsActive("Hole1") = False

 

 

In the main form/assembly i have an input form which has a boolean, i'm converting that boolean into an integer 0/1, the rules into the sub-parts have just simple if then statements with the 0's and 1's. As you can see above.

 

I made a general sheetmetal_style external rule which triggers with an unitless parameter. i have excluded this rule and still the same issue. Maybe you guys can find out how or what.

 

Basically a conversion chart which converts text into a string and then sets the Sheetmetal Style. After setting the Sheet Metal style it gives me an error. But with just executing the plain code it does not give me an error. It says "Executing Set Sheet Metal Defaults" then gives me the DISP_E_EXCEPTION error.

 

Code below is my sheetmetal string defining rule:

 

I'm using 5 different types of Materials. Which has thicknesses between: 1, 1,5, 2, 3

 

Plaatdikte means thickness

And Naam means name

Dim SheetMetal_Style_Plaatdikte As String 
Dim SheetMetal_Style_Naam As String 

SheetMetal_Style_Plaatdikte = CStr(Parameter("Plaatdikte"))


If SheetMetal_Style_Plaatdikte.Contains(",") Then
	SheetMetal_Style_Plaatdikte.Replace(",",".")
End If

Select Case SheetMetal_Style_Plaatdikte
	Case "1"
	SheetMetal_Style_Plaatdikte = "1.00"
	Case "1,5"
	SheetMetal_Style_Plaatdikte = "1.50"
	Case "2"
	SheetMetal_Style_Plaatdikte = "2.00"
	Case "3"
	SheetMetal_Style_Plaatdikte = "3.00"
End Select

Select Case Parameter("Materiaal_Type") 
	Case 1
		SheetMetal_Style_Naam = "ALMG3-" & SheetMetal_Style_Plaatdikte 
	Case 2
		SheetMetal_Style_Naam = "SV-" & SheetMetal_Style_Plaatdikte
	Case 3
		SheetMetal_Style_Naam = "RVS304-" & SheetMetal_Style_Plaatdikte
	Case 4
		SheetMetal_Style_Naam = "RVS316-" & SheetMetal_Style_Plaatdikte
	Case 5
		SheetMetal_Style_Naam = "ELO-" & SheetMetal_Style_Plaatdikte
End Select

SheetMetal.SetActiveStyle(SheetMetal_Style_Naam)
InventorVb.DocumentUpdate()
iLogicVb.UpdateWhenDone = True

 

0 Likes