My company is trying to put some automation together to pull design attributes of parts and assemblies to drive routing creation in the shop.
The issue that we have run into is that for certain ifeatures, we need to gain access to the name (or punch ID) of an ifeature (primarily punch tools). Pulling the name of the feature that the tool created is relatively easy, but because you are able to change the name of the feature as it appears in the model browser, it isn't the most reliable way to get that information.
We are looking for a way to figure out what the name of the ifeature used to create the feature without referencing the resulting feature's name in the model tree.
I've included an example, and I'm looking for the name of the tool which should be "Ob_750X562".
Any help would be much appreciated. Thanks!
Hi,
I'm a bit confused, because I think you attached the part from which you extracted an iFeature and not the part where you used the extracted iFeature, correct?
But as I understand you want to get the iFeature's name from the inserted iFeature instance, right?
If you have an iFeature inserted in the part document with a Punch Id set (in case of a punch feature), then you can simply get that id from the iFeature object:
See attached pictures.
Public Sub iFeatureName() ' Select the iFeature you're interested in Dim oDoc As PartDocument Set oDoc = ThisApplication.ActiveDocument Dim i As iFeature Set i = ThisApplication.ActiveDocument.SelectSet(1) MsgBox i.iFeatureDefinition.PunchId End Sub
Cheers,