Copy the custom iProperties to all files in the folder

Copy the custom iProperties to all files in the folder

Anonymous
Not applicable
1,001 Views
4 Replies
Message 1 of 5

Copy the custom iProperties to all files in the folder

Anonymous
Not applicable

Good day everyone,
in the main report I write the appropriate number in the user property Order number. I need this number to be written to all iam, ipt and idw files in the current folder with one click. There is a solution to do this using iLogic.
Thanks
Martin

0 Likes
1,002 Views
4 Replies
Replies (4)
Message 2 of 5

bradeneuropeArthur
Mentor
Mentor

Could you please explain a little more detailed of what you need?

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 5

Anonymous
Not applicable

Hi @Anonymous  Try this code.

'Enter the folder path where your files are located.
oFolder
= "C:\Users\User\Desktop\Inventor\iProperty_WriteToAllFilesInFolder" oFiles = System.IO.Directory.GetFiles(oFolder) For Each oFile In oFiles If oFile.Contains(".idw") Or oFile.Contains(".dwg") Or oFile.Contains(".ipt") Or oFile.Contains(".iam") 'MsgBox(oFile) ThisApplication.Documents.Open(oFile, True) Dim oDoc As Document = ThisApplication.ActiveDocument customPropertySet = oDoc.PropertySets.Item("Inventor User Defined Properties") Try prop = customPropertySet.Item("Order_Number") Catch ' Assume error means not found customPropertySet.Add("", "Order_Number") End Try oDoc.PropertySets.Item("Inventor User Defined Properties")("Order_Number").Value = "Order_Value" oDoc.Close(False) End If Next
0 Likes
Message 4 of 5

Anonymous
Not applicable

@Anonymous  You need to open a blank document. From there you cn run the rule.

 

0 Likes
Message 5 of 5

WCrihfield
Mentor
Mentor

Here is a link to a related solution I published within my Contribution posts, that I think you may find useful in this case.  When you run this rule, it will display a Windows Form (fully created within the rule).

iProp To All Docs In Dir (Form).png

 

 This form allows you to specify the iProperty's Name, its value's data type (drop-down list - sets the property's type), its Value, the target folder (with Browse button and read only result box), and select which types of documents you want it to target within that folder (drop-down list).  When you click Start, it will start processing all the matching documents within that folder.  If a property by that name already exists, it will update its value.  If it doesn't exist, it will create it.  And when it's done processing, it will let you know with a message.

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

(Not an Autodesk Employee)