Code not working in 2018 but works in 2012

Code not working in 2018 but works in 2012

jletcher
Advisor Advisor
5,753 Views
168 Replies
Message 1 of 169

Code not working in 2018 but works in 2012

jletcher
Advisor
Advisor

 I have looked this over and I can't figure out why it is giving me this error.

 

1st time I even seen this kind of error on ilogic.

 

Strange.JPG

 

 

I supplied the part I will warn you don't hit continue it will stick you in a loop and you will have to force close Inventor.

 

Now this is in a library folder it works if the part is in the project workspace but I can't have that they need to be in a library so they cannot modify the part by accident .

 

It works fine in 2012 as a library but not in 2018.

 

Thanks for the help.

 

 

0 Likes
5,754 Views
168 Replies
Replies (168)
Message 41 of 169

bradeneuropeArthur
Mentor
Mentor

Hi,

 

Would it help you if I could provide you an add in that is:

Sets the parameter  ThisApplication._LibraryDocumentModifiable = True

For ever, with a very small add in that will be installed on your machine?

 

This will help you for this moment, or isn't it?

 

for future I would do like as suggested.

I have also been doing that and it is a lot of work but afterwards you see the benefit.

keep going on like this should be no option for you!

 

let me know about it.

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 42 of 169

MjDeck
Autodesk
Autodesk

 Just set

ThisApplication._LibraryDocumentModifiable = True

in every rule that might ever try to modify a library part.

You don't ever have to set it back to False. It only affects API calls. It sounds like you didn't have problems with modifying library parts before. So you're not likely to have them now, once you set this to True.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 43 of 169

jletcher
Advisor
Advisor

 

 

Not sure why it would be a security risk. If it gets to that I will just remove net from engineers computer...

 

Autodesk just patched what? Not this issue...

0 Likes
Message 44 of 169

jletcher
Advisor
Advisor

 I did that but still fails..

 

Why can't you all make a patch? Going and doing this to 200 plus parts for this client and more for another is not right for the person that has to pay for it.

 

I did it 4 different ways to make that code work and it still fails.

 

I did it with just true in its own code like told..   FAILS

 

I put it on the top of the generate code just true...  FAILS

 

I put it on the top of the generate code just true and a false at the bottom.... FAILS

 

I even put it in its own rule and have the generated code run that rule.... FAILS

 

 I am doing everything told but still FAILS..

 

Just make a patch and make it right for the users not force them to change ALL their ilogic parts. That is just not right..

0 Likes
Message 45 of 169

MjDeck
Autodesk
Autodesk

James,

You don't have to change all your parts.

Just run that code once and the setting will persist until you shut down Inventor.

Don't ever change it to False.

If you want to automate it, you can put it in a event trigger that runs whenever a document is opened.

Are you sure what you're seeing is not a different error?


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 46 of 169

Frederick_Law
Mentor
Mentor

Did you found out which part of your code fail?

Does it stop at the SaveAs?

Or somewhere else?

0 Likes
Message 47 of 169

bradeneuropeArthur
Mentor
Mentor

Hi,

 

Seems that there is something else wrong with your coding.

 

Please try the following:

 

take one specific part with the error.

put a good exception handler in the code for this part and let it run.

 

now you will see what is wrong.

 

this should be doable for you I thinks.

 

 

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 48 of 169

jletcher
Advisor
Advisor

Whatever it takes to make this work.......

 

 No one will pay to have add ins made for all their parts.

 

 

But if you say a simple add in will make this work then why is Autodesk not making it a simple hot fix or update to fix?

 

 

 

 This is why I say they don't care about the users.. They know of this issue yet do nothing to fix it.........

 

 

Thanks for your help..

 

I may not reply again till tomorrow I am getting to frustrated to type and think straight at the moment..

 

It was my stupidity to upgrade to 2018 thinking it was better than 2012... Only did it for a few things they said were fixed. Just to find out many more things are now broken...

0 Likes
Message 49 of 169

jletcher
Advisor
Advisor

 I posted the error I was getting everyone else told me why..

 

This worked for years stopped in 2018...

 

Please answer my one question..

 

Why are you not making a patch for this?

 

You make it sound like it is a nothing but yet you have not made a patch for EVERYONE....

 

This is a workaround make a patch fix it.

0 Likes
Message 50 of 169

Frederick_Law
Mentor
Mentor

What we have been trying to say is, you can create addin instead of using iLogic.

Addin is another way of programing with Inventor.  Other is Apprentice and VBA macro (being remove in the future).

0 Likes
Message 51 of 169

bradeneuropeArthur
Mentor
Mentor
Remark.

Add ins are not part based but application based.
So one add in.

If you change your mind let me know.
Otherwise in a private message.

Frustration is not helping you.
Because of the time difference I will not be available whole day for you.

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 52 of 169

MjDeck
Autodesk
Autodesk

We're not planning to make a patch, because we want to make the API act the same as the UI commands.

In the UI, you can't modify a library part.

There's a possibility that we will change our minds, and make a patch. But I want to know why the option isn't working for you.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 53 of 169

jletcher
Advisor
Advisor

 No I have not I have been doing what everyone here says to do at the moment because seems everyone including Autodesk knows of this issue..

 

 And like I stated worked then stopped then worked then stopped.

 

 

 I guess I am just frustrated Autodesk would do this to the users and not fix it like everything else not fixed..

 

 I guess I am just going to have to live with Inventor is no longer the software of my dreams and move on from it.... Time to make some choices..

0 Likes
Message 54 of 169

Frederick_Law
Mentor
Mentor

If you think this is a big problem for you, AutoDesk programmers are waiting for a much bigger problem.

The lastest Intel chip problem means a patch in Windows.  This mean all AutoDesk software will be affected and they may not work when the patch from Microsoft come out.

Users will be flooding support like every time Windows 10 update.

 

This is everyday life for a programmer, developer.

Welcome to the club.

0 Likes
Message 55 of 169

Frederick_Law
Mentor
Mentor

@Anonymous wrote:

  I guess I am just going to have to live with Inventor is no longer the software of my dreams and move on from it.... Time to make some choices..


I that case you should have stop using Microsoft Windows or even any computer a long time ago.

Try SolidWorks and let us know how it goes Smiley Wink

0 Likes
Message 56 of 169

Frederick_Law
Mentor
Mentor

Is there any chance the file already exist?

From the code you posted (I don't have 2018 to open the ipt), there is not checking for existing file.

So the SaveAs will be overwriting a Library file which is readonly.

 

When you see the popup when it crash, click Detail and there maybe clue to where it actually crash.

 

You have to realize we don't have the whole picture of what happening on your computer.  We're trying to help with our best guess.

0 Likes
Message 57 of 169

bradeneuropeArthur
Mentor
Mentor
Agreed.
I am missing a good exception handling in general.
This is crucial for coding.

But.... too late with build in coding.

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 58 of 169

jletcher
Advisor
Advisor

When a part is in a Library path in the ipj it is a read only file but you can still do a save as and that is all I am doing with these ilogic parts.

 

By putting this code in a API to always allow will not work.

 

 My hardware is in a library all engineers share that library if one runs the ilogic code to put job numbers on parts it will do those library parts I can't have that. I need them not to be modified.

 

 

 In 2012 when this worked there was never an issue the library part can be modified. If I open one of the ilogic parts and try to change the description a error window pops up says I cannot modify a library part. But if I run my ilogic code it does a save as and that was allowed. 

 

This is why I don't understand the need to change how it worked. It worked perfectly it protected the masters but allowed a save as through ilogic.

 

 So again I ask why did this get changed when you WERE NEVER able to modify a library part already..

 

 

 And I will ask for a patch to put this back how it worked it did everything you claim was the reason for the change so no change was needed...

 

 

 

 

 

 

 

0 Likes
Message 59 of 169

jletcher
Advisor
Advisor

 Oh I understand the ups and downs of chasing windows updates..

 

And this is where I would have my programmers design my software around not using windows commands. Then you never have to worry about it..

 

 

0 Likes
Message 60 of 169

jletcher
Advisor
Advisor

1st Windows was never a software of my dreams Apple iOS is if we are talking OS systems.

 

2nd I don't work with Windows I need Windows to run this program if this worked without windows you know like a DOS version I would not load Windows. Or if they had a MAC version I would be using that.

 

3rd Clients are still on Window 7 clients will not change to Window 10..

 

 Also talking about Widows 10. When it 1st came out no one was upgrading because they heard you no longer have desktop. Similar to Autodesk forcing me to use this stupid interface and removing my classic. But Window seen this and changed so you can have your desktop back. But not Autodesk they said forget the users that like the classic interface..

 

 

I don't think you can compare software to computers. Computers have gotten better and the way they work has not changed Inventor is not getting better if I can't do the same thing as before..

 

I use 7 other cad systems Solid Works is one of them to be honest I have not had these kind of issues with it..I like Inventor better but that is starting to fade with all these issues in 2018.

0 Likes