I am attempting to write a piece of iLogic that will determine the quantity of holes on my part. You will see in the screenshot below that the first hole location is hard dimensioned(won't ever change). The last hole location must fall on the center mark which is 4" from the yellow mark. The last variable is that the hole spacing cannot be more than 9" apart, must be equal spacing, and be as close to 9" as possible while still following all of the other rules.
Inventor 2022
I didn’t see a code attached for a starting point but here is the references first for part features then for hole features.
Syntax
PartComponentDefinition.Features() As PartFeatures
https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=PartComponentDefinition_Features
syntax
PartFeatures.HoleFeatures() As HoleFeatures
https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=PartFeatures_HoleFeatures
There is VBA samples also if you are wanting to try those out too. The best way to learn is to construct your own method from scratch. If you have any questions just post them up.
Can't find what you're looking for? Ask the community or share your knowledge.