<?xml encoding=”UTF-8″>By Adam Nagy
In the user interface this is where you can set the Allow custom values option for a parameter:
In case of the API, you’ll find it in a custom Attribute:
Here is a VBA sample that toggles this value for the first user parameter if possible:
Sub Toggle_AllowCustomValue()
Dim doc As PartDocument
Set doc = ThisApplication.ActiveDocument
Dim pcd As PartComponentDefinition
Set pcd = doc.ComponentDefinition
Dim p As UserParameter
Set p = pcd.Parameters.UserParameters(1)
On Error Resume Next
Dim att As Inventor.Attribute
Set att = p.AttributeSets _
("com.autodesk.inventor.ParameterAttributes") _
("AllowCustomValue")
If Not att Is Nothing Then
att.Value = Not att.Value
End If
On Error GoTo 0
End Sub



Leave a Reply