Scope: Schematic editor
Object: Application Object
Prerequisites: None
Occurs whenever a new object is created. Use this event to stipulate other events, such as verifying that a component is labeled, has correct attributes, and so on.
Sub Application_CreateObject(ByVal ReasonFlag As VdCreateTime, ByVal ObjectType As VdObjectType, ByVal Block As IVdBlock, ByVal Object As Object)
Specifies that the event occurs either before or after the object is placed. This argument takes the form of VdCreateTime Enum.
Specifies the type of object being created in the form of VdObjectType Enum.
The block in which the object is being created.
The dispatch interface of the object that was just created. You must cast it to the correct type by using the ObjectType parameter.
Add a label when new components are created.
Sub Application_CreateObject(ByVal ReasonFlag, ByVal ObjectType, ByVal Block, ByVal Object)
If ObjectType = VDTS_COMPONENT Then
Object.AddLabel "LABEL", Object.GetLocation().X, Object.GetLocation().Y
End If
End Sub