- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
For a project I have to suppress subassembly parts based on the suppression state of parts in another subassembly, using VB.Net/iLogic. I'm quite new to both of them so it would be great if someone could give some help. What the code has to do is that it looks for the first part in subassembly 1 and reads it suppression state. It then has to copy that suppression state to the first part in subassembly 2. Then it has to move to part 2 in subassembly 1, reads its suppression state and copy that state to the second part of subassembly 2. And so on until it has 'copied' all suppression states of all parts of the first subassembly to the corresponding parts in the second subassembly.
What I know after some reading that I have to open and close the code with a sub, have to define all objects, probably have to use a 'for each-loop' and an if-then-else statement. I thought it would be relatively easy to do using a 'for each-loop' but the rule editor keeps throwing errors on me without me teaching how to do it the good way. 🙂
For defining the objects I use the Inventor API Object Model to see what object I have to define. If I for example define oComponent and oAssembly and say something like:
For Each oComponent In oAssembly
.
It returns that the expression is of the type of Inventor.AssemblyDocument, which isn't of a collection type. Can't quite get which objects I have to define and how. Hope someone can help me a little.
Solved! Go to Solution.