08-21-2019
02:58 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-21-2019
02:58 PM
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.
Blog: hjalte.nl - github.com