Hello,
I'll get straight to it - I have a part with multiple features such as extrudes, sweeps, lofts etc. For each feature in the part i need to get:
(The actual dimension values are not improtant, more the ability to retrieve them)
example below:
a cylinderical prism (smartie tube) created using 1 circular extrusion. Information retrieved:
in the future it could be a cube, or a more complex sketch so im wondering if i can utilise the 'retrieve dimensions' function somehow.
another example (ideal information retrieved from part):
Feature 1 (extrusion) :
Feature 2 (revolve):
To try and explain myself regarding the retrieve dimensions. I need to get all the dimensions that the user used to contrain the part when they were creating it. So if i could get an output from my code that sais; linear dimension 1 from edge 1-edge 2. angular dimension 1 from edge 3-edge 2, linear dimension 2 from edge 7-edge2... I could work with that.
I know I am asking a lot, if anyone could offer me some pointers to get started, it would be greatly apreciated and I'll do the rest of the digging myself. I am an intermediate programmer that has worked with Inventor API for a while, just never with sketches and existing features before 😛
Thanks in advance
You may want to start from scratch, here is the link to the Inventor API Material:
https://github.com/ADN-DevTech/Inventor-Training-Material
Each feature has different properties. Please take a look at ExtrudeFeature and RevolveFeature in the API Help Files for a start. Another great way to discover how to retrieve a property and where to look for is to use the VBA debugger, it provides a powerful way of seeing "live" objects in Inventor.
For example, Extrusion.Profile.Parent returns the sketch the extrusion is based on, same for revolve.
I hope it helps,
Philippe.
Hi,
From the Feature you can go: Feature >> Profile >> ProfilePath >> SketchEntity >> Sketch
Inside the Sketch you'll find the DimensionConstraints collection.
Depending on the feature it will have different properties, so you'll have to handle them differently.
It's worth looking around in the VBA Watch window to find how to get to certain properties: http://adndevblog.typepad.com/manufacturing/2013/10/discover-object-model.html
I hope this helps.
Cheers,
Thanks for the support both of you, I will have a good look through the API training material - no-ones pointed that out to me before. Can I also add that this is why Autodesk products are in one respect much better that Solidworks... resources are made a valiable!
Anyway, the 'Extrusion.Profile.Parent' works a treat so thanks 🙂 . The 'Feature >> Profile >> ProfilePath >> SketchEntity >> Sketch' Is also another piece to the puzzle so thanks again.
However, im struggling to find all the corrrect extensions (if you'd call them extensions, mayby paths). See my attached screenshot to see how Visual Studio (ive also tested it in Inventos VBA editor), cant find the ProfilePath after Feature.Profile..... Do you know why its not finding the ProfilePath.SketchEntity?
A Profile can have multiple ProfilePath's, so you'll find it under Item, e.g. oExFeat.Profile.Item(1) is a ProfilePath