Description
Create and add a new McGraphObj to the collection.
-
Return Type
-
An Object object.
A new McGraphObj instance.
-
Syntax
-
object.Add (Class, [TemplateID], [CopyTemplate])
The Add Method syntax has these parts: Remarks
You must call the NotifyCreationComplete method before any object created or coordinate move notifications will be sent to notify clients (see example).
You may specify a Template ID for the template object to be used as a pattern for the new one (assuming the CopyTemplate is passed in as the default, TRUE). If no template object of the specified Class already exists, one is automatically created. Properties of this automatically created template (and thus the displayed graphic object) are taken from the closest existing base template object with the given template ID, and if none such exists then from the default template (the one with TemplateID mcgtDefaultTemplate).
Notes
As illustrated in the example, a call to the NotifyCreationComplete method must be made before any notifications that the object was created or moved will be sent to notify clients of the McGraphOverlay (the Overlay property). This serves two purposes: it avoids sending a bunch of expensive notifications during the process of object creation. It also allows an abort to be performed (as when the object is being created via user interaction) at any time until the NotifyCreationComplete method call is made without notify clients having to undo their object tracking.
|