Derived Part does not update properly when changing parameters through iLogic

KenPalAlt
Participant
Participant

Derived Part does not update properly when changing parameters through iLogic

KenPalAlt
Participant
Participant

 

I occasionally have an issue where derived features don't update, even though the part I'm deriving from is updated. When I click "Edit Derived Part", it automatically updates.
This causes a lot of problems in large assemblies, since it's not obvious what has gone wrong.

 

Example (find files in attachment):

  • DeriveUpdate_Base.ipt: Contains two parameters: Length & Width.
  • DeriveUpdate_Derive1.ipt: Links Length & Width in Parameters from DeriveUpdate_Base.ipt and uses these parameters to offset two work planes.
  • DeriveUpdate_Derive2.ipt: Derives the planes from DeriveUpdate_Derive1.ipt and uses them in a sketch to extrude a cuboid.
  • DeriveUpdate_Assy.iam: Contains the components DeriveUpdate_Base.ipt ("BaseComponent") & DeriveUpdate_Derive2.ipt, and some iLogic code to change Length & Width in DeriveUpdate_Base.ipt.

The code in DeriveUpdate_Assy.iam:

 

 

Parameter("BaseComponent", "Width") = Width
Parameter("BaseComponent", "Length") = Length
InventorVb.DocumentUpdate()

 

 

 

When I run this code, following happens:

  • DeriveUpdate_Base.ipt: Length & Width get updated properly.
  • DeriveUpdate_Derive1.ipt: The work planes get updated properly.
  • DeriveUpdate_Derive2.ipt: The derived planes from DeriveUpdate_Derive1.ipt are not updated, so the extrusion is not updated.

If I click on "Edit Derived Part" in DeriveUpdate_Derive2.ipt it instantly updates the derived planes correctly.
If I change Length & Width manually in User Parameters inside DeriveUpdate_Base.ipt, everything is always updated correctly. The issue only occurs when modifying the parameters through iLogic.


How do I fix this? Is there simply an Inventor setting that will solve it? Is there some way to force the Derived Part feature to update from code?
Help is greatly appreciated!

 

We're currently on Inventor 2021.4.1. We'll soon update to 2023, but my testing showed that this issue exists there as well.

0 Likes
Reply
262 Views
5 Replies
Replies (5)

bradeneuropeArthur
Mentor
Mentor

Correct I have seen this indeed too.

 

https://forums.autodesk.com/t5/inventor-forum/derived-sketch-geometry-doesn-t-update-for-certain-cha...

 

https://forums.autodesk.com/t5/inventor-forum/derived-parts-not-updating/m-p/12865449#M930738

Regards,

Arthur Knoors

Autodesk Affiliations:

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: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 !

0 Likes

KenPalAlt
Participant
Participant
@bradeneuropeArthur
Thank you for confirming that this issue affects other as well.

Does anyone know of a way to force the Derive feature to update? I found no solutions if the two links posted (nor in other threads I found discussing this issue).
0 Likes

WCrihfield
Mentor
Mentor

Hi @KenPalAlt.  This is just an educated guess at this point, since I generally do not attempt to 'manage' derived referenced documents by code that much myself, but have you tried using the Rebuild2 method on the main assembly yet?  It sounds like Inventor is not fully recognizing that some of those derived referenced documents need to be updated, so it is not doing that step automatically for you.  You may need to force that step, one way, or another.  The Rebuild2 method is like the Update2 method, but it ignores the documents' status of not needing to be updated, and does it anyways.  Not always a good idea in a large assembly, for performance reasons, but can be manageable in smaller ones.

 

There is also the FileManager.RefreshAllDocuments method, but I am honestly not really familiar with using that one.  This 'refresh' method sounds like it may cause all documents being held in memory to reflect what has actually been written to their files, rather than reflecting any changes that may only be held in memory so far, but I am not sure.  If so, then you would have to save all the documents that your code has made changes to, before using that method.  Just ideas to think about.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

KenPalAlt
Participant
Participant

@WCrihfield
Thanks for the reply!
For good measure, I tried all of Update2, Rebuild2 and even RefreshAllDocuments (after saving files). Unfortunately, neither of them made a difference.

 

I've made an additional discovery about this issue, that allows for a workaround (see attachment);

  • Create an extrusion in DeriveUpdate_Derive1.ipt using Length and Width parameters. The extrusion has to use the parameters that drive the work features you want updated.
  • Derive that solid into ilogicTest_DeriveUpdate_Derive2.ipt
  • The derived feature of the solid in ilogicTest_DeriveUpdate_Derive2.ipt can now be suppressed.

After this, the derived planes in ilogicTest_DeriveUpdate_Derive2.ipt update correctly. If I stop deriving that solid, then the planes stop updating (but suppressing is allowed).

 

I feel like this gives some clue about the behaviour, but I don't know what to do with it.

The workaround is far from a good solution (as I need to create nonsensical solids, which will confuse the users), so I'm still looking for a better way to solve this.

0 Likes

kesUPRHR
Participant
Participant

hi.

i have been trying to fix this issue for some time now and stumbled upon this workaround.

i have not fully tested it but seems to work for my needs.

i am currently using it to force update when i am changing the derived part's material.

 

the basic idea is to get into every "DerivedPartComponent" with a foreach loop and switch one value 2 times, forcing it to update

 

            partDocument.ComponentDefinition.ReferenceComponents.DerivedPartComponents.OfType<DerivedPartComponent>().ToList().ForEach(x =>
            {
                x.SuppressLinkToFile = !x.SuppressLinkToFile;
                x.SuppressLinkToFile = !x.SuppressLinkToFile;
            });

 

it is written in C# but should be easy to change into visual basic

i would love to here feedback on more use cases.

kind regards

0 Likes