- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
All,
I am working on some code to create an iMate on each work point in a pattern. I think I have everthing down to one line (underlined), but I cannot figure out where I am going astray. I have been referencing this forum post, but can't figure out what I am doing wrong. If anyone could give me a tip, I would be greatly appreciative! If you have any questions, please do not hesitate to contact me. Hope all is well and have a most blessed day!
'Define the Document
Dim oDoc As PartDocument
oDoc = ThisApplication.ActiveDocument
Dim oCompDef As PartComponentDefinition
oCompDef = oDoc.ComponentDefinition
'Define the work point object
Dim oWorkPoint As WorkPoint
'Define the numbers used to create the work point names
Dim i As Integer
Dim Max_Count As Integer
Max_Count = Row_Count * Column_Count
'Set the first value to zero to negate the Origin Point
i = 0
'Define the iMate creation object
Dim oInsertiMate As InsertiMateDefinition
'Cycle through each work point in the pattern and rename them
For i = 0 To Max_Count
For Each oWorkPoint In oDoc.ComponentDefinition.WorkPoints
'Create a new iMate
oInsertiMate = oCompDef.iMateDefinitions.AddMateiMateDefinition(oWorkPoint, 0, , ,"MatePoint")
oWorkPoint.Name = "Work Point" & i
i = i + 1
Next
Next
iLogicVb.UpdateWhenDone = True
Please give a kudos if helpful and mark as a solution if somehow I got it right.
Solved! Go to Solution.