CoordinateSpaceTree AddSpace Method Cognex VisionPro 9.22

Add a new coordinate space, with the given name and transform, to this tree. Attach it to the specified pre-existing parent space.

Namespace: Cognex.Vision
Assembly: Cognex.Vision.Core.Net (in Cognex.Vision.Core.Net.dll) Version: 9.22.2.0
Syntax

public void AddSpace(
	string parentSpaceName,
	string newSpaceName,
	ITransform2D parentFromNew,
	bool copyTransform,
	AddSpaceConstants duplicateHandling
)

Parameters

parentSpaceName
Type: System String
A valid nonqualified or fully-qualified space name that indicates the parent space.
newSpaceName
Type: System String
A valid nonqualified space name for the user coordinate space to add.
parentFromNew
Type: Cognex.Vision ITransform2D
A transform that maps points from the space you are adding to the parent user space.
copyTransform
Type: System Boolean
If True, AddSpace adds a copy of the transform to the tree; if False, a reference to the transform is added. . defaults to True.
duplicateHandling
Type: Cognex.Vision AddSpaceConstants
An AddSpaceConstants value that specifies what do if the parent coordinate space already contains an immediate child with the same name as newSpaceName. The options are to return an error, replace the transform of the named child, or do nothing. . defaults to DuplicateIsError : it treats a duplicate as an error.
Exceptions

ExceptionCondition
SpaceTreeExceptionnewSpaceName is not a valid nonqualified name.
ArgumentExceptionparentFromNew is NULL.
ArgumentExceptionduplicateHandling value is not a member of AddSpaceConstants.
SpaceTreeExceptionBoth newSpaceName is a child of the parent space and duplicateHandling is set to DuplicateIsError.
SpaceTreeExceptionparentSpaceName value is not a legal space name.
SpaceTreeExceptionparentSpaceName is a nonqualified space name and more than one instance of it exists in this tree.
Remarks

SpaceAdded Raised when a space is added to the tree.

Remarks

Adds a new user coordinate space to a CoordinateSpaceTree object. You must specify the name of the parent space for the newly added space, and supply a transformation that defines the relationship between the parent space and the new space. To indicate that the parent space is the root space, use the name syntax "@"; to indicate that the current selected space is the parent space, use "." as the name syntax. By default, AddSpace saves a copy of the supplied transform. You can also add the transform by-reference. Although this is more efficient, it may result in errors for users who unknowingly continue to modify the original transform object.

See Also