Pass parameter value to custom iproperty

Pass parameter value to custom iproperty

ricksmithYGQR7
Participant Participant
291 Views
3 Replies
Message 1 of 4

Pass parameter value to custom iproperty

ricksmithYGQR7
Participant
Participant

Hi, I know I have seen this done but I have not messed with ilogic in a long time so im a bit rusty.

I am using a snipit of code I found

 

Dim oCSB As New ArrayList 'Create an Array
Dim UserParam As UserParameters 'Get the Parameters
UserParam = ThisApplication.ActiveDocument.ComponentDefinition.Parameters.UserParameters
For Each Item In UserParam 'Write Paramters to Array
oCSB.Add(Item.Name) '2nd Option - Just the Parameter names, no values
Next

 To select from a user parameter text list for materials specification. 

The code above is providing a form with a drop down from which I can select as desired. But now I need to pass the selected value to a custom iproperty for use in drawings and such. 

Ideally, I would have a drop down list in the custom iproperty to begin with and not need to store the list in a user parameter but that from what I have been able to find, is apparently not supported although I could swear I have seen a drop down list in a custom iproperty before, however, I have not been able to find anything on this idea, hence this approach.

As I say. its been a long time so if someone could help with passing this from a list to a string that I can put in a custom iproperty that would be greatly appreciated. 

Thanks in advance.

Rick

0 Likes
Accepted solutions (1)
292 Views
3 Replies
Replies (3)
Message 2 of 4

bradeneuropeArthur
Mentor
Mentor

Is this what you searching for:

 

bradeneuropeArthur_0-1730320919061.pngbradeneuropeArthur_1-1730320960362.png

 

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 4

ricksmithYGQR7
Participant
Participant

Actually yes and that was my first thought, but alas...

exporting a user param is apparently not an option in 2021, however, we will be migrating to the 2023 software soon.

 

ricksmithYGQR7_0-1730321181982.png

 

Message 4 of 4

bradeneuropeArthur
Mentor
Mentor
Accepted solution

Than use this:

 

Dim p As PartDocument = ThisDoc.Document
Dim pm As Parameter = p.ComponentDefinition.Parameters.UserParameters.Item("Test")
Dim cp As Inventor.Property

Try
 cp = p.PropertySets.Item(4).Item(pm.Name)
 cp.Expression = pm.Value
 Catch
cp = p.PropertySets.Item(4).Add(pm.Value,pm.Name)
End Try

bradeneuropeArthur_0-1730326061442.png

bradeneuropeArthur_0-1730326110485.png

 

 

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