Create a Multivalue Parameter in a drawing with ilogic after drawing is created
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
im trying to create a multivalue parameter to select a template once a drawing has been created. The idea is to have an input list show and the user picks a template and the drawing will load in the foormats. I have the formats set up and have most of the code to load those written and i cna get the drawing t create how i would like, my issue is with the input box list and multivalue parameter. i cant get it to populate in the drawing itself, i found some help and was able to get it into the part but would like this parameter to live in drawings and not the part itself.
Example of what i have been working with below:
Dim oDoc2 As Document = ThisApplication.ActiveDocument Dim oPar2 As UserParameters = oDoc2.Parameters.UserParameters Dim oPar1 As UserParameter MultiValue.SetList("Select Template","Onsrud Template", "Part Template", "Assy Template") Dim oTemplateSelect = InputListBox("Select a Template", MultiValue.List("Select Template"), oTemplateSelect, Title := "Select a Template", ListName := "List") '= InputBox("Select a Template", "Template Selection", "Onsrud Template") Try oPar1 = oPar2.Item("Select_Template") Catch oPar1 = oPar2.AddByValue("Select_Template", 0, UnitsTypeEnum.kDegreeAngleUnits) End Try 'Parameter("Select_Template") = ThisDrawing.Document.Parameters.UserParameters 'oParameter = Parameter("Select_Template").AddByValue("Select Template", "Onsrud Template", UnitsTypeEnum.kTextUnits) 'MultiValue.SetList("Select Template","Onsrud Template", "Part Template", "Assy Template") 'oSelectTemplate = InputListBox("Select a Template", MultiValue.List("Select Template"), oSelectTemplate, Title := "Select a Template", ListName := "List")
And here is the example code I found on here that i got to work for inserting into a part but cant get it to work for the drawing document:
'Create Parameter for selecting template
If oPartDoc.DocumentType = kPartDocumentObject Then
Dim oPartCompDef As PartComponentDefinition
oPartCompDef = oPartDoc.ComponentDefinition
Dim oParams As Parameters
oParams=oPartCompDef.Parameters
Dim oUserParams As UserParameters
oUserParams=oParams.UserParameters
Dim oAwesomeParameter As Parameter
Try
otester = oUserParams.Item("AwesomeParameter")
Catch
oInsulationType=oUserParams.AddByValue("AwesomeParameter", "Option1", kTextUnits)
MultiValue.SetList("AwesomeParameter", "Option1", "Option2", "Option3", "Option4")
End Try
End If
Parameter.Param("AwesomeParameter").ExposedAsProperty = False
Parameter.Param("AwesomeParameter").IsKey = True
Any help or direction would be greatly appreciated, im sure its something simple im overlooking.