Software Developer's Kit - ChemDraw

Send comments on this topic
MakeObjectTag Method
See Also 
name

Name is an arbitrary label by which the ObjectTag may be identified

newTag
newTag is the actual name assigned to the object.

newTag is the ObjectTag that will be created i.e. the ObjectTag

duplicatesAllowed

True if the duplicate values are allowed, else False.

indicates whether duplicate values are allowed, or not

Description

Member of ChemDraw Control.ObjectTag.

Adds an ObjectTag to this ObjectTag.

Syntax

Visual Basic
Public Sub MakeObjectTag( _
   ByVal name As String, _
   ByVal newTag As ObjectTag, _
   ByVal duplicatesAllowed As Boolean _
) 

Parameters

name

Name is an arbitrary label by which the ObjectTag may be identified

newTag
newTag is the actual name assigned to the object.

newTag is the ObjectTag that will be created i.e. the ObjectTag

duplicatesAllowed

True if the duplicate values are allowed, else False.

indicates whether duplicate values are allowed, or not

Return Type

None

Remarks

Object tags are arbitrarily named properties which can be attached to any ChemDraw object.  This object can be used to associate arbitrary data with an object. 

Object tag names are critical to their management, since the name tells ChemDraw how to interpret the tag.  All tags assigned internally by ChemDraw begin with the character sequence "/CS/CD/".  Tags created for user purposes should begin with some other character sequence.  Any ChemDraw object can have any number of tags attached to it, including multiple tags with the same name.


Creates a new ObjectTag for this object. Duplicate ObjectTags may be allowed, or not, using "duplicates allowed".

Example

'Example - ObjectTag - Object can be any ChemDraw object
 Dim vObjectTag As ChemDrawControl10Ctl.ObjectTag
 Dim myObject As ChemDrawControl10Ctl.Object
 Dim vName As String
'------------------------------------------------------------
 Private Sub cmdMake_Click()
     vName = "NewName"
     Dim vAux As String
     vAux = "Value of ObjectTag"
     Set vObjectTag = Nothing
     'creates the object tag
     MyObject.MakeObjectTag vName, vObjectTag, True
     vObjectTag.StringValue = vAux
     If  (Not vObjectTag Is Nothing) Then
         'gets the object tag but it must be visible to see
         MyObject.GetObjectTag vName
         vObjectTag.Visible = True
         Text1.Text = vObjectTag.StringValue 'returns the content of vAux
         vMessage = InputBox("Input ObjectTag text", "Input", vName)
         MyObject.MakeObjectTag vName, vObjectTag, True
         vObjectTag.StringValue = vMessage
     End If
 End Sub

See Also