10-06-2022
06:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
10-06-2022
06:14 AM
Sure. I see two things that may be causing problems. The first thing is using that exact term 'ThisAssembly', which is already being used by iLogic in the background. That is a term used to represent an iManagedAssembly object (Interface), so I would advise you to use a different term there for your variable name. Next, I don't think the referenced document that you area writing the iProperty data to is getting updated or saved after the edit, so the edit may not be staying. I modified your code a bit to help remedy these things. Give this version a try.
Dim oADoc As AssemblyDocument = ThisDoc.Document
For Each oRefDoc As Document In oADoc.ReferencedDocuments
If oRefDoc.PropertySets.Item("Inventor Summary Information").Item("Keywords").Value <> "Test" Then
oRefDoc.PropertySets.Item("Inventor Summary Information").Item("Keywords").Value = "Test"
End If
If oRefDoc.RequiresUpdate Then oRefDoc.Update2(True)
If oRefDoc.Dirty Then oRefDoc.Save2(False)
Next
oADoc.Update
Wesley Crihfield
(Not an Autodesk Employee)