Community
This Vba code works great with line MsgBox ("Matchcrop") but if i remove the line the code doesn't work.
Can anyone help with this??
Sub MatchCrop_MA()
On Error Resume Next
Dim odoc As Document
Set odoc = ThisApplication.ActiveDocument
oSelectedPriority = odoc.SelectionPriority
odoc.SelectionPriority = kEdgeSelectionPriority
odoc.Update2 (True)
MsgBox ("Matchcrop")
ThisApplication.CommandManager.ControlDefinitions.Item("AppRefreshCmd").Execute2 (True)
Set oitem1 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllEntitiesFilter, "Select first line")
If oitem1 Is Nothing Then
odoc.SelectionPriority = oSelectedPriority
Exit Sub
End If
again:
Set oitem2 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllEntitiesFilter, "Select second line")
If oitem2 Is Nothing Then
odoc.SelectionPriority = oSelectedPriority
Exit Sub
End If
oitem2.Layer = oitem1.Layer
GoTo again
End Sub
Hi vulic,
The code works as expected on my side, also without the MessageBox. What exactly is not working on your side if you remove the MessageBox?
Which version of Inventor are you working on?
Many thanks,
Tobias
Can't find what you're looking for? Ask the community or share your knowledge.