(VBA) DerivedParameterTable LinkedParameters Error

(VBA) DerivedParameterTable LinkedParameters Error

leszeko
Contributor Contributor
415 Views
2 Replies
Message 1 of 3

(VBA) DerivedParameterTable LinkedParameters Error

leszeko
Contributor
Contributor

Hi,

There is a API bug in inventor. I can not get e value for ReferencedEntity of the linked parameter.

If for example i will link parameters of an ipt file and then I want to check value of the ReferencedEntity of an any of the parameters then I'm getting an error. I have checked this on the last 3 versions of Inventor (2021, 2022, 2023). It's just not working.

 

Just to test it it's eanough to link an ipt file an try:

 

Dim oPartDoc As partDocument
Set oPartDoc = ThisApplication.ActiveDocument

Dim oParam As DerivedParameter
Set oParam = oPartDoc.ComponentDefinition.Parameters.DerivedParameterTables.Item(1).LinkedParameters.Item(1)

Debug.Print oParam.Name
Debug.Print oParam.ReferencedEntity.Name

 

Is it any way to find referced parameter name since they are renamed if same name of the parameters exists allready? Like for exampe d0 is reneamed to d0_1 butif this name allready exist then it's renamed to d0_1_2.

 

0 Likes
416 Views
2 Replies
Replies (2)
Message 2 of 3

bradeneuropeArthur
Mentor
Mentor

use it this way:

Dim oPartDoc As PartDocument
set oPartDoc = ThisApplication.ActiveDocument

Dim oParam As DerivedParameter
set oParam = oPartDoc.ComponentDefinition.Parameters.DerivedParameterTables.Item(1).LinkedParameters.Item(2)

MsgBox ( oParam.Name)
MsgBox( oParam.Dependents.Item(1).name)

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 3

leszeko
Contributor
Contributor

Unfortunelly it doesn't work Arthur. I have test it. But I knew it anyway. Dependants list holds only a list of a parameters which are using this particular parameter. In this case this is the parameter in the current document not that which it is linked to.  So, in my case the list have no items.

Snap01.png

 

 

0 Likes