- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am having an issue, and I do not know what is causing it. See image "Parameter is incorrect". When my For Loop is looping it always hangs up on the same part "Jumper WP:16". It gives me a "parameter is incorrect" see image "Parameter is incorrect". It handles every other part just fine but this one. I have no idea what is going on.
See my browser tree "Parameter is incorrect - 3" image so you can see how the assembly model is built. I also put an image of the Visual Studio Autos window, so you can see nothing strange is going on. See image "Parameter is incorrect - 2". At first, I thought it did not like the 2 digit place for the component count, but it did count some with 2 digits. Any help would be grateful.
Thanks,
Mike Munson
Inventor 2018 Pro
Visual Studio 2017
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
In you second picture it says X = 21, but I only count 20 occurrences in your third picture. I think it's trying to get an occurrence that doesn't exist. I'm not sure where your CenterLineToolModule.AssyCompOccCount is getting it's number, but you might want to run a test and see what it equals.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I think leaf occurrences will include occurrences in your sub assemblies as well. I think you want something like AssemblyDocument.ComponentDefinition.Occurrences.Count for just the occurrences in your top assembly. If you are trying to check for sketches in the occurrences in sub assemblies as well, you will probably need a different approach.