Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iFeature Punch tool name when feature name has changed

1 REPLY 1
Reply
Message 1 of 2
tmoney2007
442 Views, 1 Reply

iFeature Punch tool name when feature name has changed

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!

1 REPLY 1
Message 2 of 2
adam.nagy
in reply to: tmoney2007

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,



Adam Nagy
Autodesk Platform Services

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report