EndShortcutMenu event
EndShortcutMenu eventTriggered after the shortcut menu appears.See Also | ExampleSignatureobject.EndShortcutMenu (Shortcut Menu)ObjectDocument objectan object expression that evaluates to a valid container object. In this case, the only valid container is a document.Shortcut MenuPopupMenu object; input/output from the handlerthe shortcut menu that has been displayed.RemarksUse this event to perform any cleanup work on the shortcut menu.No events will be fired while a modal dialog is being displayed.See AlsoMethods, Properties, and Events:BeginShortcutMenuDefaultBeginShortcutMenuEditBeginShortcutMenuGripBeginShortcutMenuOsnapBeginRightClickActiveX and VBA Developer's Guide:"Use Events"ExamplePrivate Sub AcadDocument_EndShortcutMenu (Shortcut Menu as AutoCAD.IAcadPopupMenu)‘This example intercepts a drawing EndShortcutMenu event.'‘This event is triggered when the user closes a drawing shortcut menu.'‘To trigger this example event: Right click the mouse in the working area of a drawing,‘Wait for the shortcut menu to be displayed and then dismiss the shortcut menuMsgBox "A shortcut menu was just closed!"End SubLayoutSwitched eventTriggered after the user switches to a different layout.See Also | ExampleSignatureobject.LayoutSwitched (Layout Name)ObjectDocument objectan object expression that evaluates to a valid container object. In this case, the only valid container is a document.Layout NameString; input to the handlerthe name of the layout the user has switched to.RemarksNo events will be fired while a modal dialog is being displayed.See AlsoMethods, Properties, and Events:WindowChangedWindowMovedOrResizedActiveX and VBA Developer's Guide:"Use Events"ExamplePrivate Sub AcadDocument_LayoutSwitched (By Val Layout Name as String)‘This example intercepts a drawing Layout Switched event.'‘This event is triggered when the user switches to a different‘Drawing layout view.'‘To trigger this example event: Open a drawing and change its layout view'‘For example: Switch the drawing from Model view to Layout1 view‘Use the "Layout Name" variable to determine the which layout view we changed toMsgBox "The drawing layout was just changed to: " & Layout NameEnd SubLISPCancelled eventTriggered when the evaluation of a LISP expression is cancelled.See Also | ExampleSignatureobject.LISPCancelled ()ObjectApplication object, Document objectan object expression that evaluates to a valid container object. In this case, the only valid containers are the application and a document.RemarksNo events will be fired while a modal dialog is being displayed.See AlsoMethods, Properties, and Events:BeginLISPEndLISPActiveX and VBA Developer's Guide:"Use EventsExamplePrivate Sub AcadDocument_LispCancelled ()‘This example intercepts a drawing Lisp Cancelled event.'‘This event is triggered when the evaluation of a LISP expression is cancelled.'‘To trigger this example event: Run a LISP expression and‘Cancel the LISP evaluation before it finishesMsgBox "A LISP evaluation was just cancelled."End SubModified eventTriggered when an object or collection in the drawing has been modified.See Also | ExampleSignatureObject. Modified (Entity)ObjectAll Drawing objects, Block, Blocks, Dictionary, Dictionaries, DimStyle, DimStyles, Group, Groups, Hyperlink, Hyperlinks, Layer, Layers, Layout, Layouts, Linetype, Linetypes, ModelSpace, PaperSpace, PlotConfiguration, PlotConfigurations, RegisteredApplication, RegisteredApplications, SelectionSet, SelectionSets, TextStyle, TextStyles, UCS, UCSs, View, Views, Viewport, Viewports, XRecordAn object expression that evaluates to a valid container object.EntityA Drawing ObjectThe object in the drawing that is modified can be any one of the drawing objects.RemarksThis event will be triggered whenever the object is modified. Modification includes whenever the value of a property is set, even if the new value is equal to the current value.When coding in VBA, you must provide an event handler for all objects enabled for the Modified event. If you do not provide a handler, VBA may terminate unexpectedly.No events will be fired while a modal dialog is being displayed.See AlsoMethods, Properties, and Events:ObjectAddedObjectErasedActiveX and VBA Developer's Guide:"Use Events"ExamplePublic with Events Plane as AcadLWPolyline ' Use with Modified Event ExampleSub Example Modified ()‘This example creates a lightweight plotline in model space and‘References the Plotline using the public variable (Plane) which‘Is set up to intercept Modified events.'‘This example then modifies the new object, triggering the code‘In the Modified event.Dim points (0 To 9) As Double‘Define the 2D plotline pointsPoints (0) = 1: points (1) = 1Points (2) = 1: points (3) = 2Points (4) = 2: points (5) = 2Points (6) = 3: points (7) = 2Points (8) = 4: points (9) = 4‘Create a lightweight Plotline object in model space'‘* Note: We are returning the new Plotline object into a Module‘Level variable. This allows us to intercept events associated‘With that particular object.Set Plane = ThisDrawing.ModelSpace.AddLightWeightPolyline (points)ThisDrawing.Application.ZoomAll‘Modify object to trigger event.'‘* Note: The event code for the Plotline modification will be triggered‘Before we move forward and refresh the view, so the line will not‘Appear blue when the event message box is displayed.Dim color As AcadAcCmColorSet color = AcadApplication.GetInterfaceObject ("AutoCAD.AcCmColor.16")Call color.SetRGB (80, 100, and 244)PLine.TrueColor = colorThisDrawing.Regen acAllViewportsEnd SubPrivate Sub PLine_Modified (ByVal pObject As AutoCAD.IAcadObject)‘This example intercepts an object's Modified event.'‘This event is triggered when an object supporting this event is modified.'‘To trigger this code: Modify an object connected to this event‘* Note: By connected, we mean the object set up to intercept events using‘The VBA with Events statement‘Use the "object" variable to determine which object was modifiedSkybox "You just modified an object with an ID of: " & pObject.ObjectIDEnd Sub