iLogic code to zip files suddenly stopped working

iLogic code to zip files suddenly stopped working

b.graaf
Advocate Advocate
289 Views
4 Replies
Message 1 of 5

iLogic code to zip files suddenly stopped working

b.graaf
Advocate
Advocate

Hi!

 

I have an iLogic code which generate several stepfiles and add them into a new created compressed folder (ZIP).

I am using it in several Inventor versions and we are now on the latest Inventor professional 2025.

 

I have used this iLogic rule about a year ago for the last time and now it suddenly does not work anymore!

I did not change anything in the code.

 

Is there something changed within iLogic, or maybe in .net?

 

I am using this line:

 

 

System.IO.Compression.ZipFile.CreateFromDirectory(_export_Location, _ZipFileName)

 

 

 

But get this message:

Error on Line 190 : 'ZipFile' is not a member of 'System.IO.Compression'.

 

Does somebody has any idea?

 

0 Likes
Accepted solutions (1)
290 Views
4 Replies
Replies (4)
Message 2 of 5

bradeneuropeArthur
Mentor
Mentor

Have you add the reference 

To use the ZipFile class in a .NET Framework app, you must add a reference to the System.IO.Compression.FileSystem assembly in your project. For information on how to add a reference to your project 

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 3 of 5

b.graaf
Advocate
Advocate

Hi Arthur,

 

Thank you for your reply.

Just to be clear, we are using this iLogic rule for about 4 years without any problems! We did not change anything to the code and now suddenly, it does not work anymore. 

 

In the code there are the next two refferences, and the one you have mentioned is one of them:

AddReference "System.IO.Compression"
AddReference "System.IO.Compression.FileSystem"

 

So I am wondering, if it has to do with some change in for example dot.net or something?

0 Likes
Message 4 of 5

JelteDeJong
Mentor
Mentor
Accepted solution

There was a big change in Inventor 2025. We went from .Net Framework 4.8 to .Net Core 8. Some things might not work any more. (Officially addins need to migrate to .Net core to work for that reason.) Anyway, you might try to add this to the top of your rule:

AddReference "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.IO.Compression.FileSystem.dll"

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 5 of 5

b.graaf
Advocate
Advocate

That did the trick, thanx!

0 Likes