Role: This allows the creation of a Tag
The following code snippet can be used to obtain a TagFactory from a selected TagGroup
Dim objTagFactory As TagFactory
Set ParentObject = CATIA.ActiveDocument.Selection.FindObject("CATIAProduct")
Set objTagFactory = ParentObject.GetTechnologicalObject("TagFactory")
Methods
- Sub CreateTag( iTagName, oTag)
-
Creates a Tag. Each Tag has a Name and a parent TagGroup.
- Parameters:
-
- iTagName
- Name of the Tag to be created. dd>
- oTag
- Newly created Tag. dd>
- Returns:
- An HRESULT.
Legal values:- S_OK
- Action is successfully created and the interface pointer is successfully returned
- E_FAIL
- Action was successfully created, but the interface query failed
- E_NOINTERFACE
- Action was successfully created, but the it doesn't implement the requested interface
- E_OUTOFMEMORY
- The component allocation failed
- Example:
-
Dim objTagFactory As TagFactory ... Dim objTag As Tag Dim TagName As String TagName = "MY_TAG" objTagFactory.CreateTag TagName, objTag