CogCoordinateSpaceTree MoveSubtree Method Cognex VisionPro 9.5
Move the subtree rooted at SpaceName and attach it to the NewParentSpaceName, using SpaceName's existing parent transform.

Namespace: Cognex.VisionPro
Assembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 69.0.0.0
Syntax

public void MoveSubtree(
	string spaceName,
	string newParentSpaceName,
	CogAddSpaceConstants duplicateHandling
)

Parameters

spaceName
Type: System String

A valid nonqualified or fully-qualified space name that indicates the root space of the subtree to move.

newParentSpaceName
Type: System String

The valid nonqualified or fully-qualified name of the parent space to which to append the subtree.

duplicateHandling
Type: Cognex.VisionPro CogAddSpaceConstants

A CogAddSpaceConstants value that specifies what do if the parent coordinate space contains an immediate child with the same name as spaceName. The options are to return an error, replace the named child with the copied subtree, or do nothing. duplicateHandling defaults to DuplicateIsError: it treats a duplicate as an error.

Exceptions

ExceptionCondition
ArgumentException

spaceName cannot be the root space. NewSpaceName cannot be a descendant of spaceName.

ArgumentException

The duplicateHandling value is not a member of CogAddSpaceConstants.

CogSpaceTreeDuplicateChildNameException

spaceName is already a child of the NewParentSpaceand the duplicateHandling argument is DuplicateIsError.

CogSpaceTreeInvalidNameSyntaxException

spaceName or NewSpaceName value is not a legal space name.

CogSpaceTreeNotUniqueException

spaceName or NewSpaceName is a nonqualified space name and more than one instance of it exists in this tree.

Remarks

Moves the subtree rooted at the given space name to the new parent space name. Attaches the given space name using its existing parent transform.

See Also