図面内のオブジェクトまたはコレクションが修正されたときに開始されます。
サポートされているプラットフォーム: Windows のみ
VBA:
object.Modified(Entity)
タイプ: すべての図形オブジェクト、Block、Blocks、Dictionaries、Dictionary、DimStyle、DimStyles、Group、Groups、Layer、Layers、Layout、Layouts、Linetype、Linetypes、Material、Materials、MLeaderStyle、ModelSpace、PaperSpace、PlotConfiguration、PlotConfigurations、RegisteredApplication、RegisteredApplications、SectionManager、SectionSettings、SectionTypeSettings、SortentsTable、TableStyle、TextStyle、TextStyles、UCS、UCSs、View、Viewport、Viewports、Views、XRecord
有効なコンテナ オブジェクトを評価するオブジェクト式
タイプ: 図形オブジェクト
修正される図面内のオブジェクトは、どの図形オブジェクトでもかまいません。
このイベントはオブジェクトが修正されると必ず開始されます。プロパティの値の設定も、新しい値が現在値と等しい場合も含め、修正とみなします。
VBA でコーディングをする場合、Modified イベントで有効化されるすべてのオブジェクトに対して、必ずイベント ハンドラを用意しなければなりません。ハンドラがないと、VBA が突然終了してしまう可能性があります。
モーダル ダイアログが表示されている間、イベントは発生しません。
VBA:
Public WithEvents PLine As AcadLWPolyline ' Use with Modified Event Example
Sub Example_Modified()
' This example creates a lightweight polyline in model space and
' references the PolyLine using the public variable (PLine) 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 polyline points
points(0) = 1: points(1) = 1
points(2) = 1: points(3) = 2
points(4) = 2: points(5) = 2
points(6) = 3: points(7) = 2
points(8) = 4: points(9) = 4
' Create a lightweight Polyline object in model space
'
' * Note: We are returning the new PolyLine object into a Module
' level variable. This allows us to intercept events associated
' with that particular object.
Set PLine = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
ThisDrawing.Application.ZoomAll
' Modify object to trigger event.
'
' * Note: The event code for the PolyLine 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 AcadAcCmColor
Set color = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.20")
Call color.SetRGB(80, 100, 244)
PLine.TrueColor = color
ThisDrawing.Regen acAllViewports
End Sub
Private 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 WithEvents statement
' Use the "pObject" variable to determine which object was modified
MsgBox "You just modified an object with an ID of: " & pObject.ObjectID
End Sub
Visual LISP:
Not available