By Wayne Brill
Issue
I create a Custom Parameter Group to contain certain user parameters. The custom parameter group is created correctly however the user parameters do not retain the export parameter setting. (This applies to the 2009 release of Inventor).
Solution
A workaround is to restore the export parameter property by setting the ExposedAsProperty property of the parameter object (the equivalent to this export parameter check mark in the Parameters dialog) after it is added in the custom parameter group. The below VB.Net code demonstrates this suggestion:
Sub CreateCustomParaGroup() Dim oCustomParameterGroup As CustomParameterGroup Dim oParams As Parameters Dim oDoc As PartDocument oDoc = _invApp.ActiveDocument oParams = oDoc.ComponentDefinition.Parameters oCustomParameterGroup = oParams. _ CustomParameterGroups.Add("LVA_VCC", "LVA_VCC") Dim oParameter As UserParameter For Each oParameter In oParams.UserParameters Dim oStr As String = oParameter.Comment oStr = oStr.Substring(0, 3) If oStr = "LVA" Then Dim oExported As Boolean oExported = oParameter.ExposedAsProperty oCustomParameterGroup.Add(oParameter) oParameter.ExposedAsProperty = oExported End If Next End Sub

Leave a Reply