Jump to content
Developer Wiki and Function Reference Links ×

Vectorscript Newbie


zuken86

Recommended Posts

Hello Huy,

???Here is a very short script that will get the XYZ coordinates of the center of a selected 3D object and display them in a Dialogue Box. There is no Set3DCenter() function in VectorScript (sadly), but you can use hMove3D() to slide the object into any position you want (with a little arithmetic).

PROCEDURE xxx;
{ Get the 3D Center values of the first selected object and sheo them in an Alert Dialogue Box.}
CONST
CR = chr(13);	{ Carriage Return character }
VAR
Xcen, Ycen, Zcen :Real;
S :String;

BEGIN
Get3DCntr(FSActLayer, Xcen, Ycen, Zcen);

{ Concat() builds a string from parts and also changes numbers to strings. }
{ String S holds the answer that will display in the dialogue box. }
S := concat('X center = ', Xcen, CR, 'Y center = ', Ycen, CR, 'Z center = ', Zcen);

AlrtDialog(S);
END;
Run(xxx);

Raymond

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...