Difference between revisions of "User Frame"

From SoftMC-Wiki
Jump to: navigation, search
(User Frame)
(User Frame)
Line 4: Line 4:
  
  
[[File:TABLEFRAME.PNG | 700px | Defining the frame]]
+
[[File:TABLEFRAME.PNG | 700px | Defining the frame]]<br>
 +
 
 +
The origin of the frame is at point A and points B & C help defining the orientation of the new frame.
  
 
==PROTO.PRO==
 
==PROTO.PRO==

Revision as of 14:01, 24 December 2015

User Frame

User can add his own frame by teaching three points: A, B, C


Defining the frame

The origin of the frame is at point A and points B & C help defining the orientation of the new frame.

PROTO.PRO

New function must be defined in the PROTO,PRO file as:

IMPORT_C RBT_TABLE(byval  as generic location, byval  as generic location, byval   as generic location,  as generic location ) as long

Usage

Calling:

-->?RBT_TABLE(A,B,C,D)

Return Value

Anything except 0 is an error code.


Example

Library definition:

IMPORT_C RBT_TABLE(byval  as generic location,byval  as generic location,byval   as generic location,  as generic location ) as long

public function Table(byval a as generic location,byval b as generic location,byval c  as generic location) as generic location
dim tmp as long
dim x as generic location
tmp = rbt_table(a,b,c,x)
if tmp then
  Print "Internal TABLE error",tmp
end if
Table = x
end function

Usage

dim shared Xax as location of xyzypr = #{10,0,0,0,0,0}
dim shared Yax as location of xyzypr = #{0,10,0,0,0,0}
dim shared Zax as location of xyzypr = #{0,0,10,0,0,0}

dim shared Origin as location of xyzypr = #{10,20,30,0,0,0}

program

dim MyFrame as location of xyzypr
dim Res as generic location


MyFrame = Origin:#{0,0,0,45,45,45}
Print "MyFrame : ";Myframe
Res = Table(Origin,MyFrame:Xax,MyFrame:Yax)

Print "Res : ";res
  
end program 

Output:

MyFrame : #{10 , 20 , 30 , 45 , 45 , 45}
Res : #{10 , 20 , 30 , 45 , 45 , 45}