Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi I found this code which does almost exactly what I would like it to do. The only change I need, is for it to not use AllReferencedDocuments and instead only change the iproperty of the immediate children only. Is this possible to do?
Thanks in advance for any help!
I copied this code from @A.Acheson so credit goes to him!
Dim oAssyDoc As AssemblyDocument oAssyDoc = ThisApplication.ActiveDocument ' Get the Design Tracking property set. Dim AssyDesignPropSet As PropertySet AssyDesignPropSet = oAssyDoc.PropertySets.Item("Design Tracking Properties") ' Get the Description property. Dim AssyProj As Inventor.Property AssyProj = AssyDesignPropSet.Item("Part Number") 'Get all of the referenced documents. Dim oRefDocs As DocumentsEnumerator oRefDocs = oAssyDoc.AllReferencedDocuments 'Iterate through the list of documents. Dim oRefDoc As Document For Each oRefDoc In oRefDocs ' If oRefDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then ' Logger.Info("DisplayName: "& oRefDoc.DisplayName)'FileName ' Logger.Info("FullFileName: "& oRefDoc.FullFileName)'FilePath ' Get the Design Tracking property set. Dim DesignTrackPropSet As PropertySet DesignTrackPropSet = oRefDoc.PropertySets.Item("Design Tracking Properties") ' Get the Description property. Dim RefProj As Inventor.Property RefProj = DesignTrackPropSet.Item("Project") Try RefProj.Value = AssyProj.Value Catch Logger.Info("Read Only - "& oRefDoc.DisplayName ) End Try 'End If Next
Solved! Go to Solution.