iLogic - Occurrence in a specified Assembly

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All!
I'm trying to make an iLogic rule to fill the Part Number of every component of an assembly. I have already figured out almost everything but I got stuck with a part of it.
I would need to show the hierarchy of the components in the part numbers just like they are in the assembly:
e.g.
XXXX 00-00-000
XXXX 10-00-000
XXXX 11-00-000
XXXX 11-10-000
XXXX 11-10-001
XXXX 11-10-002
XXXX 11-11-000
XXXX 11-11-101
.
XXXX 11-11-199
.
.
XXXX 12-00-000
XXXX 12-00-001
XXXX 12-00-002
XXXX 12-00-003
XXXX 12-00-004
.
.
XXXX 20-00-000
XXXX 30-00-000
XXXX 00-00-001
XXXX 00-00-002
.
.
What I'm trying to do is the following:
- I store the name of the assemblies for each level (I would use 5 levels, so I have 5 variables)
- I would check if the "current" part or "current" assembly (I'm using a "For Each" command) is occurs on the current level/assembly (If yes => keep or +1 the level, then give a part number / If no => check the previous levels, and give a part number according to the level that contains the "current" component)
What I can't do and I would like to ask some help from you, is how can I check a specified Inventor Component if it contains an other component by its name?
I searched many forums and sites about it, but I could not figure it out. I'm trying something like this, but I can't make it work:
SyntaxEditor Code Snippet
Dim subass1 As AssemblyDocument subass1 = Component.InventorComponent(Lvl1) Dim Occur1 As Inventor.ComponentOccurrence Dim PartExists1 As Boolean = False For Each Occur1 In Occurrences If Occur1.Name = docFName Then PartExists1 = True Lvl2 = docName & ":1" ID2 = ID2 + 1 ID3 = 0 ID4 = 0 ID5 = 0 ID6 = 0 Level = 2 iProperties.Value(docFName, "Project", "Part Number") = azonosito & " " & ID1 & ID2 & "-" & ID3 & ID4 & "-" & ID5 & "0" & ID6 Exit For End If Next
I attached my full code, it's not finished, since I can't solve this part of it, but maybe it helps to understand what I would like to do 🙂
Thank you very much in advance!!!