Hi,
I'm sure this is very simple, I just can't find any reference to this. I am looking to apply a set part number iproperty to the first, then second, then third components in the assembly browser tree in my iLogic rule, regardless of their current part number. (I need to select them by their position in the browser tree as their part number will vary). How do I do this?
Many thanks for your help
Solved! Go to Solution.
Solved by CadlineSupport. Go to Solution.
I found it. Dead easy when you know how of course. You can get the name of the first, second etc components in the assembly tree as follows:
My_Variable1 = ThisDoc.Document.ComponentDefinition.Occurrences.Item(1).Name
My_Variable2 = ThisDoc.Document.ComponentDefinition.Occurrences.Item(2).Name
Hello,
i tried the same thing for the Part Number, but it gives me " end of statement expected".
SyntaxEditor Code Snippet
PartX = ThisDoc.Document.ComponentDefinition.Occurrences.Item(2).ReferencedDocumentDescriptor.ReferencedDocument.PropertySets.Item("Design Tracking Properties").Item("Part Number").Value
is there an error in my line? did i forgot something?
i found the solution for my problem
SyntaxEditor Code Snippet
Dim PartX As Object PartX = ThisDoc.Document.ComponentDefinition.Occurrences.Item(2) PartY = iProperties.Value(PartX.Name, "Project", "Part Number") MessageBox.Show(PartY)