ObjectCollection Valid Objects to Cast Changed

ObjectCollection Valid Objects to Cast Changed

J-Camper
Advisor Advisor
314 Views
3 Replies
Message 1 of 4

ObjectCollection Valid Objects to Cast Changed

J-Camper
Advisor
Advisor

I recently upgraded To 2025 Inventor And noticed a weird behavior change With Object Collections. I went From 2023 To 2025 so I'm not sure if this behavior change was present in 2024 or not.

 

I have an old iLogic rule, which used an objectcollection To collect strings. I'm not sure why it was written that way to begin with but it seems you cannot cast a string into an objectcollection anymore. I get "Specified cast is not valid" now. This rule works in 2023 and earlier, but not in 2025:

Dim oc As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
oc.Add("Test")

 

It's not really an issue since there are other container objects I can use, but i found it odd that this change was made. Just curious if this was an intended change.

0 Likes
315 Views
3 Replies
Replies (3)
Message 2 of 4

WCrihfield
Mentor
Mentor

FYI:  I just copied those two lines of code into a new internal iLogic rule in a new part, and ran it, and it did not throw an error.  I'm using 2024.3.4, just for reference.

Maybe it has something to do with their shift from vb.net Framework 4.8 to vb.net 8.  I have not made that upgrade yet, so I am just speculating, but there has been a ton of others on the forums talking about pre-existing codes that worked in earlier versions, not working in Inventor 2025, so I suspect that maybe the 'strictness' (less able to work with poorly written codes) of the coding environment may have increased also.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 4

bradeneuropeArthur
Mentor
Mentor

bradeneuropeArthur_0-1742557312160.png

Same issue I have on Inventor 2025

bradeneuropeArthur_1-1742557366342.png

 

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

J-Camper
Advisor
Advisor

okay, so the change started in 2025.  I guess this might mean that only Inventor specific Objects can be added to an Object collection now?  I have not tested anything other than the string because it was broken upon upgrading.

0 Likes