Difference between revisions of "MC-Basic:CASTPOINT"

From SoftMC-Wiki
Jump to: navigation, search
(Created page with "{{MC-Basic |SHORT FORM= |SYNTAX= <''variable''> = arraysize (<''array_name''>, <''long_expression''>) |AVAILABILITY= All versions |DESCRIPTION= Returns the size of a array...")
 
(Added an entry of CASTPOINT function.)
Line 4: Line 4:
  
 
|SYNTAX=
 
|SYNTAX=
<''variable''> = arraysize (<''array_name''>, <''long_expression''>)
+
<''point_variable''> = castpoint (<''list_of_coordinates''>, <''long_expression''>)
  
 
|AVAILABILITY=
 
|AVAILABILITY=
All versions
+
Version 4.9.11 and up
 
 
 
|DESCRIPTION=
 
|DESCRIPTION=
Returns the size of a array’s dimension according to the dimension’s number (1 for first the dimension, 2 for the second dimension, etc.).
+
Creates and returns a generic point using the robot type given by the second, long-type argument, whereas point type (i.e., joint or location) and coordinate values are taken from the first, list-of-coordinates argument.
 
 
Returns zero, if the dimension number is larger then the number of dimensions defined for the array and also, if the dimension number is zero or negative.
 
  
 
|TYPE=
 
|TYPE=
Line 30: Line 27:
  
 
|LIMITATIONS=
 
|LIMITATIONS=
 
+
The robot type given in the second argument must match the number of coordinates of the list-of-coordinates argument.
  
 
|EXAMPLE=
 
|EXAMPLE=
 
<pre>
 
<pre>
? ArraySize (Arr, 2)
+
GenJoint = CASTPOINT({0.0, 10.0, 20.0}, TYPE_XYZ)
 
+
? CASTPOINT(#{0.0, 0.0, 0.0, 1.0}, TYPE_XYZR)  
Size = ArraySize (Arr, X)
 
 
</pre>
 
</pre>
  

Revision as of 10:26, 5 November 2012

Creates and returns a generic point using the robot type given by the second, long-type argument, whereas point type (i.e., joint or location) and coordinate values are taken from the first, list-of-coordinates argument.

Syntax

<point_variable> = castpoint (<list_of_coordinates>, <long_expression>)

Availability

Version 4.9.11 and up

Type

Long

Scope

Configuration, Task, Terminal

Limitations

The robot type given in the second argument must match the number of coordinates of the list-of-coordinates argument.

Examples

GenJoint = CASTPOINT({0.0, 10.0, 20.0}, TYPE_XYZ)
? CASTPOINT(#{0.0, 0.0, 0.0, 1.0}, TYPE_XYZR)