Use iFeature functions to choose a row in a table driven iFeature. Each row has a set of parameter values to drive the iFeature.
iFeature functions operate within a part in which the iFeature is placed (instantiated).Their syntax is like the syntax used for the GoExcel and iPart functions.
To access the iFeature functions, expand the iFeatures node under the System tab in the Snippets area.
Changes the active row of a table-driven iFeature.
Syntax
iFeature.ChangeRow("iFeatureName", "rowName")
"iFeatureName”
The name of the iFeature as displayed in the model tree.
"rowName"
The desired value of the key parameter in the iFeature table.
If the iFeature has more than one key parameter, specify them all in a text string of the form [Key1=Value1][Key2=Value2]. For example:
[Size=A0][CutLength=0.4375000 in]
This example is the iFeatureTableRow.MemberName property, as described in the Inventor API documentation. For an alternative way to specify several parameter values, use iFeature.FindRow.
You can also use an integer row number:
iFeature.ChangeRow("iFeatureName", rowNumber)
Example
In this example, the current iFeature configuration is changed based on a conditional statement that evaluates size, which is a text parameter. iFeature.ChangeRow requires only the iFeature component name RectangularPocket1 and the iFeature table Key Column name "Pocket-01" to drive the active iFeature configuration:
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
Searches for a row based on one or more column value criteria. If it finds a row, it changes the active row of the iFeature to that row.
Syntax
i = iFeature.FindRow("iFeatureName", "columnName", "<=", 0.2, "columnName", "<=", 4.1)
"iFeatureName"
The name of the table-driven iFeature.
"columnName"
The title of the column to be searched.
Operators
The value can be a numerical value or a text string. It can be specified using an explicit value, parameter, or local variable.)
Returns
iFeature.CurrentRowValue(“columnName”)
Reads a value from the row found using the iFeature.FindRow function, where "columnName" is the column title name. It returns the cell value of the current row value returned by the iFeature.FindRow function. For example:
i = iFeature.FindRow("RectangularPocket1", "pocketdepth", "=", 0.250) pocketlength = iFeature.CurrentRowValue("pocketlength") pocketwidth = iFeature.CurrentRowValue("pocketwidth")
If the column does not exist in the iFeature, the rule displays an error message.
iFeature.CurrentRowStringValue("columnName")
Use this function when the entry being sought in the iFeature table is a text string. For example:
Part_number = iFeature.CurrentRowStringValue("Part Number")
Used with the iFeature.FindRow function, this function allows you to search for a value within a range rather than searching for an exact value. There is always a tolerance for this search. The default tolerance is 0.0000001 and is not dependent on document units.
Syntax
iFeature.Tolerance = <value>
Set a higher tolerance to expand the range of acceptable values.
Example
iFeature.Tolerance = 0.001 i = iFeature.FindRow("insertpocket", "pocketlength", "=", 2.0)
This example matches a row with a pocketlength value of 2.0004.