Message 1 of 14
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I do have lot old files i need to add True/ False Parameter ABC . Can somebody help please. Thanks
Solved! Go to Solution.
I do have lot old files i need to add True/ False Parameter ABC . Can somebody help please. Thanks
Solved! Go to Solution.
You van do that with Windows Explorer selves!
Regards,
Arthur Knoors
Autodesk Affiliations & Links:
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 !
Regards,
Arthur Knoors
Autodesk Affiliations & Links:
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 !
Correct I have read wrong!
I will help you further...
Regards,
Arthur Knoors
Autodesk Affiliations & Links:
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 !
Dim d As Inventor.FileDialog Call ThisApplication.CreateFileDialog(d) d.MultiSelectEnabled = True d.Filter = "Parts|*.ipt" d.ShowOpen d.CancelError = False If Not d.FileName = "" Then Dim a() As String = Split(d.FileName, "|") i=0 For i = 0 To UBound(a) Dim odoc As Inventor.PartDocument = ThisApplication.Documents.Open(a(i)) odoc.ComponentDefinition.Parameters.UserParameters.AddByValue("ABC", True, "BOOLEAN") odoc.Save odoc.Close Next End If
EDIT
Regards,
Arthur Knoors
Autodesk Affiliations & Links:
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 !
Great it is working. Before close and accept let me ask you this. Can it be done if part is already open, or can it be done to run code from assembly in all parts?
Appreciate once again for you time and help
sure.
You mean for the active part also put parameter ABC = true/false
and loop through assembly parts and put parameter ABC = true/false
Regards,
Arthur Knoors
Autodesk Affiliations & Links:
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 !
Sub main
Dim a As AssemblyDocument = ThisApplication.ActiveDocument
loopi(a)
End Sub
Sub Loopi(a As AssemblyDocument)
Dim c As ComponentOccurrence
For Each c In a.ComponentDefinition.Occurrences
Dim d As Document = c.Definition.Document
If d.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject
loopi(d)
Else If d.DocumentType = DocumentTypeEnum.kPartDocumentObject
Dim p As PartDocument = Nothing
p = d
p.ComponentDefinition.Parameters.UserParameters.AddByValue("ABCD",True,"BOOLEAN")
End If
Next
End Sub
Regards,
Arthur Knoors
Autodesk Affiliations & Links:
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 !
Good to hear!
Regards,
Arthur Knoors
Autodesk Affiliations & Links:
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 !
Thanks for this rule.
It works a charm!
Thing is, I need a few more options on it.
Would you please show me how?
First I need to replace the value with the name of a parameter (G_L).
Then I need to Export the parameter, and then format the units of the parameter to decimal 3 places, no zeros and no unit string. If you can point me in the right direction I would be grateful. I keep getting an error about the 'document class' when I try to cut-and-paste other code I find in this forum into this rule. Here is what I did so far:
'Create user parameter in part file after checking for existence and then adding a value to it and formatting it and exporting it
Sub Main
Dim a As AssemblyDocument = ThisApplication.ActiveDocument
Loopi(a)
End Sub
Sub Loopi(a As AssemblyDocument)
Dim c As ComponentOccurrence
For Each c In a.ComponentDefinition.Occurrences
Dim d As Document = c.Definition.Document
If d.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject
Loopi(d)
Else If d.DocumentType = DocumentTypeEnum.kPartDocumentObject
Dim p As PartDocument = Nothing
p = d
p.ComponentDefinition.Parameters.UserParameters.AddByValue("G_LD", G_L, UnitsTypeEnum.kInchLengthUnits)
End If
Next
End Sub
I believe I have to 'expose' the parameter so it can be changed, but don't know how to do it.
Here is a link showing some code to do that, but I don't know how to integrate it into your rule.
Here is the code from that link:
param =Parameter.Param("G_L")
param.ExposedAsProperty = True
param.CustomPropertyFormat.Precision = kThreeDecimalPlacesPrecision
param.CustomPropertyFormat.ShowTrailingZeros = False
param.CustomPropertyFormat.ShowLeadingZeros = False
param.CustomPropertyFormat.ShowUnitsString = False
param.CustomPropertyFormat.Units = "in"
Also, I do not understand what this is doing:
If d.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject
Loopi(d)
Else If d.DocumentType = DocumentTypeEnum.kPartDocumentObject
Dim p As PartDocument = Nothing
p = d
Thanx...Chris