Problem using iLogic and iFeature.ChangeRow

Problem using iLogic and iFeature.ChangeRow

Binary12
Contributor Contributor
945 Views
3 Replies
Message 1 of 4

Problem using iLogic and iFeature.ChangeRow

Binary12
Contributor
Contributor

Hi,

 

I have a lot of similar punch tools I am trying to combine into one tool to be used in an iLogic driven assembly. 

 

I've been searching the forum for ways to change the punch tool and  found the following thread on how to change a table driven ifeature:

http://forums.autodesk.com/t5/inventor-general-discussion/ilogic-to-change-a-table-driven-ifeature/t...

 

 

This is a basic example of what I'm trying to do.

 

 

If ChangeType = "01" Then
iFeature.ChangeRow("Punch1", 01)

ElseIf ChangeType = "02" Then
iFeature.ChangeRow("Punch1", 02)


End If

 

 

However, despite trying a lot of different ways I cannot get it to work. I keep getting an error message eventhough I have created a custom column in the iFeature and named it as key.

 

Attached is the error message as well as the part, punch tool/ifeature that I've been using.

 

 

Would really appreaciate if someone could tell me what I'm doing wrong.

 

Best,

Fredrik

0 Likes
Accepted solutions (1)
946 Views
3 Replies
Replies (3)
Message 2 of 4

Binary12
Contributor
Contributor
No one?

Feel like there must be something I did wrong when creating the punch tool as I've seen other use the same code and it works
0 Likes
Message 3 of 4

Binary12
Contributor
Contributor

I also tried following the example given in the Inventor 2016 Help section but get the same error.

(http://help.autodesk.com/view/INVNTOR/2016/ENU/?guid=GUID-020555BE-6197-4D27-8B31-A4D62E2CC2E8)

 

If size = "small" Then
iFeature.ChangeRow("RectangularPocket1", "Pocket-01")
ElseIf size = "medium" Then
iFeature.ChangeRow("RectangularPocket1", "Pocket-02")
ElseIf size = "large" Then
iFeature.ChangeRow("RectangularPocket1", "Pocket-03")
ElseIf size = "very large" Then
iFeature.ChangeRow("RectangularPocket1", "Pocket-04")
End If

 

Error message.PNG

 

 

Could this be a bug?

 

0 Likes
Message 4 of 4

Binary12
Contributor
Contributor
Accepted solution

Big thank you to MjDeck for telling me where I went wrong!

 

Apparently table-driven ifeatures are not supported when inserted as a punch tool. When I insert the Punch tool or iFeature as a regular iFeature it worked like a charm! 

 

My intention for this is to combine a lot of similar hole patterns into one ifeature and to "hide" unneeded holes in the same spot as the active ones. For the creation of the product in mind this will save a lot of programming and features in Inventor which will in turn greatly speed up the process of keeping the ilogic model updated with any future changes.

 

/Fredrik

0 Likes