Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Vba Matchcrop rule

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
252 Views, 2 Replies

Vba Matchcrop rule

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

 

2 REPLIES 2
Message 2 of 3
tobias.orlow
in reply to: Anonymous

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

Tobias Orlow
Designated Support Specialist
Customer Success Organization
Linkedin: www.linkedin.com/in/tobiasorlow/
Message 3 of 3
Anonymous
in reply to: Anonymous

My firm stayed at Autodesk® Inventor® 2018

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report