(Deprecated)
vcPathObject
vcPathObject is a layout item used for creating and storing path object nodes and segments.
Inherits: vcLayoutItem
Path Objects
A path object can contain one or more types of nodes and segments used for special purposes.
- vcPathObjectActionNode is an action related to a motion node.
- vcPathObjectMotionNode defines the trajectory of a motion.
- vcPathObjectParameterNode contains generic parametric information, for example calibration status.
- vcPathObjectReferenceNode references another node, which may include component nodes.
- vcPathObjectSegment is a section of path with its own visualization properties and can include several segments.
Properties
Name | Type | Access | Description |
ActionNodeCount | Integer | R | Gets the number of action nodes in path object. |
ActionNodeVisualization | vcFrameSetVisualization | R | Gets the object controlling the visualization of action nodes in path object. |
MotionNodeCount | Integer | R | Gets the number of motion nodes in path object. |
MotionNodeVisualization | vcFrameSetVisualization | R | Gets the object controlling the visualization of motion nodes in path object. |
Name | String | RW | Defines the name of path object. |
ParameterNodeCount | Integer | R | Gets the number of parameter nodes in path object. |
ParameterNodeVisualization | vcFrameSetVisualization | R | Gets the object controlling the visualization of parameter nodes in path object. |
Persistent | Integer | RW | Defines if the path object is saved with a layout.
If 0, path object is not saved with layout. If 1, path object is saved with layout. |
ReferenceNodeCount | Integer | R | Gets the number of reference nodes in path object. |
ReferenceNodeVisualization | vcFrameSetVisualization | R | Gets the object controlling the visualization of reference nodes in the path object. |
SegmentCount | Integer | R | Gets the number of segments in the path object. |
Methods
Name | Return Type | Parameters | Description |
clear | None | None | Removes all nodes and segments from path object. |
clearNodes | None | Enumeration type | Removes all nodes of a given type from path object.
See Path Object Constants for more information. |
clearSegments | None | None | Removes all segments from path object. |
createNode | <Type> | Enumeration type, [Integer index] | Adds a new node of a given type to the path object, and then returns the new node.
See Path Object Constants for more information. |
createSegment | vcPathObjectSegment | Integer index | Adds a new segment to the path object at a given index, and then returns the new segment. |
deleteNode | None | vcPathObjectNode node | Deletes a given node from path object. |
deleteSegment | None | vcPathObjectSegment segment
or Integer index |
Deletes a given segment or one at a given index from the path object. |
findNode | <Type> | String name | Returns a node matching a given name in path object. |
findSegment | vcPathObjectSegment | Real logical_distance | Returns a segment at a given logical_distance in path object. |
getNode | <Type> | Enumeration type, Integer index | Returns a node of a given type at a given index in path object. |
getNodes | List of <Type> | Enumeration type | Returns a list of nodes of a given type in path object. |
getSegment | vcPathObjectSegment | Integer index | Returns a segment at a given index in path object. |
Examples
Example. Create a path of motion nodes
from vcScript import * import random app = getApplication() for i in app.LayoutItems: if i.Type == VC_LAYOUTITEM_IT_PATHOBJECT: app.deleteLayoutItem(i) po = app.createLayoutItem(VC_LAYOUTITEM_IT_PATHOBJECT) vis = po.MotionNodeVisualization vis.ConnectingLinesVisible = True vis.LineDisplayMode = VC_LINEDISPLAY_LINE vis.FramesVisible = True vis.FrameDisplayMode = VC_FRAMEDISPLAY_COLOR_AXIS # Note: pathobjects are only visible in the Teach tab for i in range(5): point = po.createNode(VC_PATHOBJECT_NT_MOTION) m = point.PositionMatrix m.translateRel(100*i, random.random()*20, random.random()*20) point.PositionMatrix = m prop = point.createProperty(VC_STRING, 'ExtraData') prop.Value = str(i)+'_example' po.update() |