Community
Hello, i am trying to add some items in the iMate matchlist. But with the code i use below i recieve a runtime '10' error:
This array is fixed or temporarily locked.
Can someone help me with this?
Thanks in advance.
Function PlaceiMates() Dim oApp As Application Set oApp = ThisApplication If ThisApplication.ActiveDocumentType = kPartDocumentObject Then Dim odoc As PartDocument Set odoc = oApp.ActiveEditDocument Dim oInsert As Object Dim oInsertiMate As InsertiMateDefinition Set oInsert = ThisApplication.CommandManager.Pick(kPartEdgeFilter, "Pick Edge for Imate") Set oInsertiMate = odoc.ComponentDefinition.iMateDefinitions.AddInsertiMateDefinition(oInsert, True, "0mm", , "Test") Dim ml(1) As String ml(0) = "pl" oInsertiMate.MatchList = ml End If End Function
Solved! Go to Solution.
Solved by nielsborgerink2714. Go to Solution.
Hello,
I solved the problem. I found out that an array must be created and should be filled completely.
Function PlaceiMates() Dim oApp As Application Set oApp = ThisApplication If ThisApplication.ActiveDocumentType = kPartDocumentObject Then Dim odoc As PartDocument Set odoc = oApp.ActiveEditDocument Dim oInsert As Object Dim oInsertiMate As InsertiMateDefinition Set oInsert = ThisApplication.CommandManager.Pick(kPartEdgeFilter, "Pick Edge for Imate") Set oInsertiMate = odoc.ComponentDefinition.iMateDefinitions.AddInsertiMateDefinition(oInsert, True, "0mm", , "Test") Dim ml(1) As String '<-----------------Enter the ammount of matches you want to add.(start with 0) ml(0) = "pl" ml(1) = "pl1" '<-----------------------The array should be filled completely oInsertiMate.MatchList = ml End If End Function