iLogic error

iLogic error

Anonymous
Not applicable
3,415 Views
22 Replies
Message 1 of 23

iLogic error

Anonymous
Not applicable

Hello,

Can i ask you for help with iLogic?
I use iLogic rules to configure our products, and until 2018 it all worked.
I have used the same rules since the 2015 version and everything is ok. In the version 2018, I ceased to run a rule that has the task of tying the project name to all parts.
There is a lot of others involved in the rule, and that's why it's virtually nothing to do with this error.
Now I can not make orders and I am practically standing, which is why it burns a lot.

The rule is here:

 

 

Dim IPJ as String
Dim IPJ_Name As String
Dim IPJ_Path As String
Dim FNamePos As Long
'set a reference to the FileLocations object.
IPJ = ThisApplication.FileLocations.FileLocationsFile
'get the location of the last backslash seperator
FNamePos = InStrRev(IPJ, "\", -1)    
'get the project file name with the file extension
IPJ_Name = Right(IPJ, Len(IPJ) - FNamePos)
'get the project name (without extension)
'IPJ_ShortName = Left(IPJ_Name, Len(IPJ_Name) - 4)
'get the path of the folder containing the project file
IPJ_Folder_Location = Left(IPJ, Len(IPJ) - Len(IPJ_Name))

Dim oAsmDoc As AssemblyDocument
oAsmDoc = ThisApplication.ActiveDocument
'oAsmName = Left(oAsmDoc.DisplayName, Len(oAsmDoc.DisplayName) -4)
oAsmName = Left(IPJ_Name, Len(IPJ_Name) - 4)

Dim oRefDocs As DocumentsEnumerator
oRefDocs = oAsmDoc.AllReferencedDocuments
Dim oRefDoc As Document

Dim i As Integer
i=1

For Each oRefDoc In oRefDocs
        oRefDocs.Item(i).PropertySets.Item("Inventor Summary Information").Item("Title").Value=oAsmName
        i=i+1    
Next

iProperties.Value("Summary", "Title") = oAsmName

ThisDoc.Save

 


We found out that this rule throws out this error when it writes to standard parts. Until 2018 there was no problem.

Many thanks,

Daniel Zdenek

0 Likes
3,416 Views
22 Replies
Replies (22)
Message 2 of 23

JaneFan
Autodesk
Autodesk

Hello Daniel,

 

Are you using inventor with Windows 8.1 OS?

I can see the same issue as you with windows 8.1 OS, while the same code works well on window 7 OS. This seems a windows update issue:

 

Resolution

To resolve this issue, install update 2919355. For more information about how to obtain update 2919355, click the following article number to view the article in the Microsoft Knowledge Base:
2919355 Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2 Update April, 2014
 

The upper resolution is get from following Microsoft website, please check more details there.

https://support.microsoft.com/en-us/help/2938832/e-fail-0x80004005-error-occurs-on-the-icredentialpr...

 

 

 

 

 




Jane Fan
Inventor/Fusion QA Engineer
0 Likes
Message 3 of 23

Anonymous
Not applicable

Hello,

I'm using Win 10, and I used Win 10 at the Inventor 2017. I figured out here at the forum that the API was modified with the 2018 version. Can not it be that? And how to fix it?

Thank you very much,
Daniel Zdeněk

0 Likes
Message 4 of 23

udo.huebner
Autodesk Support
Autodesk Support

Hi Daniel Zdeněk,
you are right, in Inventor 2017 with iLogic you were able to modify properties even in write protected files like standard parts in library path. But you couldn't edit these properties from BOM.
From my point of view, this was a defect in the behavior in former releases and is corrected now in Inventor 2018. I understand that you used this leak for your own purposes.

With Try - catch - end Try, you can suppress the error message in the code, but you still can't write in the properties of the write protected parts, because they are "write protected". 

Is it really necessary to modify the properties of standard parts every time you run this rule?

 

Udo Huebner

 

0 Likes
Message 5 of 23

udo.huebner
Autodesk Support
Autodesk Support

Here a discussion/wish on Inventor Idea Station to have write protected files really write protected. No permanent, temporary or local changes should be possible.
https://forums.autodesk.com/t5/inventor-ideas/write-protection-for-write-protected-files/idi-p/56023...
Now, you need this unwanted behavior back? You can post this as Idea - but explain clearly, why it is useful for you and most other Inventor users.
Let's try to find a better way to solve your intention. Explain your desired result and we can search for a solution. The old way - modifying write protected files - is closed for now.

 

0 Likes
Message 6 of 23

JaneFan
Autodesk
Autodesk

Hello Daniel,

 

I just tried this issue again both with inventor 2017 and 2018, but see no difference that iLigic rule can run without error both in Win7 OS and Win 10 OS.

But I can reproduce the error you saw with a unsaved part or assembly file with following steps. Please check whether your assembly file is saved or not prior to running the rule.

1. Ceating a new assembly or part document, do not save it manually.

2. Add a new iLogic rule, with just one lline of your rule:

ThisDoc.Save.

Result: It fails saying:

Error in rule: Rule0, in document: Part1
Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))

 




Jane Fan
Inventor/Fusion QA Engineer
0 Likes
Message 7 of 23

udo.huebner
Autodesk Support
Autodesk Support

Hello Jane, please insert a standard part from content center (stored in a lib.path), then test again. The exception occurs mainly with write protected files.

0 Likes
Message 8 of 23

JaneFan
Autodesk
Autodesk

Hi Udo, 

 

Thank you for your clarification. My misunderstanding previously. You are right, It's a new change from Inventor 2018 in API. 




Jane Fan
Inventor/Fusion QA Engineer
0 Likes
Message 9 of 23

Anonymous
Not applicable

Hello Udo,

Yes, it is really necessary.
Skanska has used it to create elements that hang on the facade.
At this point, they have a 14-day slip in the projection, and the situation is serious about being threatened with redundancies, and they are considering finding new software to ensure that the update does not happen.

 

They did not know about the use of the hole in the system, and so no one even thought of preparing for such a situation in the future.

 

It is not possible to override an element because it consists of 2000+ components and has more than 20 different rules applied to it.

 

Please can you create a patch that would allow the rule to work again?
Or is there no way to put it into operation?
I suppose that when the hole was repaired, it should go for this rare case to pay off.

Thank you for your quick response and your greetings,
Daniel Zdenek

0 Likes
Message 10 of 23

udo.huebner
Autodesk Support
Autodesk Support

Hello Daniel, I understand that this is an current Problem.

But in 2017 in former releases you also were not able to modify Properties in Standard parts in library path or in general write protected files. If you opened the files directly you got always the message

Standardparts-writeprotected.PNG

and in the BOM the properties were greyed out.

BOM-Writeprotected.PNG

 

Only using the leak in the API you were able to modify the properties in the write protected parts. But a save of these files was also not possible. So what is your intention or the result you need - an modified BOM export? You have to modify your iLogic rule to write a individual BOM with the name of the current Project directly to a file (text or Excel), without modifying the properties of standard parts.
I understand that this is a hot issue and it have to be changed soon. As a workaround you can Pack&Go your Assembly and then use your Ilogic rules with the copied assembly when standard parts not write protected.

Why has this issue (functionality of rules) has not been tested before upgrading to Inventor 2018 companywide?

 

The only quick and clean solution from my point of view is to modify your iLogic rules to reach your result, but in a different way.

 

0 Likes
Message 11 of 23

MjDeck
Autodesk
Autodesk

Hi Daniel,

 Maybe you don't really need to modify the properties in the library files? If that's the case, you can make the rule run without error by checking the location of each file before trying to modify it.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 12 of 23

MechMachineMan
Advisor
Advisor

Poor workflows and poor understanding of the software you use leaves room for catastrophic "failure".

 

Perhaps going into the future, your employees who use this software should look into doing their processing using the AUTODESK SUPPORTED methods so that there is zero % chance they would change things that would leave you hanging.


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 13 of 23

Owner2229
Advisor
Advisor

Hey, currently see two possible solutions to this (workarounds):

1) Don't store the project number in the CC (or any write-protected) parts. (If it's for BOM purposes or smt. it can be re-written in the table).

2) Copy the CC (or any write-protected) parts from the library to the project folder (programatically, and link the files to the new location). This way you will be able to write to them.

 

I can write the code if you wish.

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
0 Likes
Message 14 of 23

Anonymous
Not applicable

I have the same problem with a .NET addin I wrote for a customer.

It is necessary for me too to access CC's components iProperties from my Addin.

 

I explain how it works.

 
- The user checks a file out from the Vault 

- He launches my addin: the addin does many things; the most useful one is accessing their ERP with the component's part number (read from the iPropeties) and write its properties, read from the ERP, back inside the component. They need it because those data are mapped in Vault, and useful both for the designers and for everybody who has access to the Vault and need to look for files.

- The same properties are then mapped with the items, creating a full sync between Vault, Inventor and ERP

 

Everything has always worked like a clockwork until r2018

Now it still works for normal components, but it is impossibile to access the iProperties of CC's files, even if they are checked out, but Ineed to write the society's special information even inside them, not only inside the normal components.

 

I think that in this case Autodesk should take a step back and let us access library's properties as before by releasing a proper fix.

 

Davide Brizio

 

0 Likes
Message 15 of 23

MjDeck
Autodesk
Autodesk

We're planning to add an API option that you can set to restore the ability to modify library files.
(The internal number of this issue is INVGEN-6002).


Mike Deck
Software Developer
Autodesk, Inc.

Message 16 of 23

MechMachineMan
Advisor
Advisor
It's not impossible. Just difficult.

If you open a secondary application and change the content center files
locations in either the project or application settings, it will let you
modify the content center file in inventor because it will no longer
recognize it as a protected location.

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
Message 17 of 23

Anonymous
Not applicable

I solved the problem by dinamically copying the component into a temporary directory, modifying its properties, and then copying it back into its original position.

It seems to work, even if it's not beautiful to see because you can see the file closing and opening in front of you, and of course it is slower than the previous solution. But at least it's a solution, and it works.


Davide

0 Likes
Message 18 of 23

NPieper
Participant
Participant

Exists already an API option for the internal issue number INVGEN-6002 ?

0 Likes
Message 19 of 23

MjDeck
Autodesk
Autodesk

There is an option. It's available only in the recently released Inventor 2018.2 Update.
To enable it, set the Inventor.Application._LibraryDocumentModifiable property to true. Example:

ThisApplication._LibraryDocumentModifiable = True


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 20 of 23

MechMachineMan
Advisor
Advisor

Is there a reason this API change isn't documented in the 2018.2 release notes?

 

https://knowledge.autodesk.com/support/inventor-products/downloads/caas/downloads/content/inventor-2...


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type