Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
andrew_canfield
in reply to: DRoam

Hello

I stripped the code back & the error message highlights a different line to what causes the problem:

SyntaxEditor Code Snippet

Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oDrawParams As UserParameters = oDrawDoc.Parameters.UserParameters

'oMyParameter = ThisApplication.ActiveDocument.ComponentDefinition.Parameters.UserParameters

Try
'Change value of param
Parameter("BE_PC") = Parameter("BE_PC")
Catch
'Create Param as it doesn't exist
Dim BE_PC As UserParameter = oDrawParams.AddByValue("BE_PC" , "BE", UnitsTypeEnum.kTextUnits)
End Try 

the above works, it's adding the code below which causes the error:

 

SyntaxEditor Code Snippet

MultiValue.SetList("BE_PC", "BE", "PC")
BE_PC =  "BE"

So far:

Open a drawing, check if the required parameter is there - working

if it's not there create it - working

make the parameter multivalue - failing

 

the error is caused by lines 14 &  15 - not line 11:

14.JPG

 

Thanks again

 

Andrew