ITcSmTreeItem

ITcSmTreeItem is the central interface for nodes in the TwinCAT project tree, such as devices, boxes, variables, containers, and project objects. It provides access to the name, type, path, parent/child relationships, variables, XML serialization, and basic child operations. The versions ITcSmTreeItem2 through ITcSmTreeItem10 extend this root interface to include resource selection, Visual Studio integration, custom files, collections, and project variants. When writing new code, you should use the highest available interface version.

Chain of inheritance

ITcSmTreeItem
└── ITcSmTreeItem2
    └── ITcSmTreeItem4
        └── ITcSmTreeItem5
            └── ITcSmTreeItem6
                └── ITcSmTreeItem7
                    └── ITcSmTreeItem8
                        └── ITcSmTreeItem9
                            └── ITcSmTreeItem10

For items that have already been deleted, the methods return TSM_E_ITEMDELETED. Write operations are protected against non-editable files. Domain-specific behavior, such as CreateChild or DeleteChild, depends on the specific node type.

Interface versions

Version

Newly introduced

ITcSmTreeItem

Basic interface: name, type, path, parent/child relationships, variables, XML serialization, child operations.

ITcSmTreeItem2

Changing SubTypes and selecting resources.

ITcSmTreeItem4

Internal Visual Studio integration data.

ITcSmTreeItem5

Language-independent name.

ITcSmTreeItem6

User files: signature, encryption, Object Protection Level.

ITcSmTreeItem7

Collection access to child nodes, reference back to the owning System Manager.

ITcSmTreeItem8

Access to the Visual Studio ProjectItem.

ITcSmTreeItem9

Flags for project variants (Define, Disable, Link, Parameter, SParameter).

ITcSmTreeItem10

Support for project variants in simulation states.

See also