01-23-2017
11:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
01-23-2017
11:45 AM
try this:
Sub Main() Dim oAsmDoc As AssemblyDocument = ThisDoc.Document Dim oAsmCompDef As AssemblyComponentDefinition = Nothing oAsmCompDef = oAsmDoc.ComponentDefinition Dim oCustomParamGroup As CustomParameterGroup = Nothing Try oCustomParamGroup = oAsmCompDef.Parameters.CustomParameterGroups.Add("Category name", "Category name") Catch ex As Exception 'it probably already exists oCustomParamGroup = oAsmCompDef.Parameters.CustomParameterGroups("Category name") End Try 'enter existing parameter name, and copy the line for more parameters Dim oExistingParam As Inventor.Parameter = GetExistingParam(oAsmDoc, "Length") 'add parameter oCustomParamGroup.Add(oExistingParam) Dim oExistingParam1 As Inventor.Parameter = GetExistingParam(oAsmDoc, "Width") 'add parameter oCustomParamGroup.Add(oExistingParam1) End Sub Private Function GetExistingParam(ByVal oAssydoc As Inventor.AssemblyDocument, oParamName As String) As Inventor.Parameter Dim oParam As Inventor.Parameter = Nothing For Each oParam In oAssydoc.ComponentDefinition.Parameters If oParam.Name = oParamName Then Return oParam End If Next Return Nothing End Function
put it all in one iLogic rule
If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated
Succes on your project, and have a nice day
Herm Jan
Kudo's are also appreciated
Succes on your project, and have a nice day
Herm Jan