Message 1 of 2
Weird error, issue with updating iProperties
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, so i have been using a snippet of code to replace designer name, project & date based off of form entry on multiple configurators for a while. But today i cant get it to work on this particular sub assembly. The issue has to do with which ever part is first in the tree. If the first item is suppressed, no matter which part, it will run no issue, if the first part isnt suppressed it errors out... Any help would be appreciated, thank you
It errors out on line iProperties.Value(oOccurrence.Name, "Project", "Project") = _
'Goes through all parts & subassemblies and replaces the Project based on form inputs Sub iPropPartsProject Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition 'Iterate through all Of the occurrences Dim oOccurrence As ComponentOccurrence For Each oOccurrence In oAsmCompDef.Occurrences.AllReferencedOccurrences(oAsmCompDef) 'create iprop with default Value iProperties.Value("Project", "Project") = Project 'write to component iprops iProperties.Value(oOccurrence.Name, "Project", "Project") = _ iProperties.Value("Project", "Project") On Error Resume Next Next End Sub