Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
JelteDeJong
in reply to: Anonymous

You can lookup all ExtrudeFeatures and look up the extrusion length.

C#

static void Main(string[] args)
        {

            Application inventor = (Inventor.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Inventor.Application");
            PartDocument doc = (PartDocument)inventor.ActiveDocument;
            
            foreach (ExtrudeFeature feature in doc.ComponentDefinition.Features.ExtrudeFeatures)
            {
                switch (feature.Definition.ExtentType)
                {
                    case PartFeatureExtentEnum.kDistanceExtent:
                        DistanceExtent ext = (DistanceExtent)feature.Definition.Extent;

                        Console.WriteLine(string.Format("{0} is of type {1} and has distance: {2}",
                            feature.Name,
                            feature.Definition.ExtentType.ToString(),
                            ext.Distance.Value
                            ));
                        break;
                    default:
                        break;
                }
                
            }
            
            Console.ReadKey();

        }

this example works only for a extrusion by a length. In the help you will find a more comprehensive example written in vba. (look for an example called "GetFeatureInfo")

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com