zuken86 Posted January 16, 2013 Share Posted January 16, 2013 I want to use Get3DCntr to obtain center position of a selected 3d object and pass that info to another object or simply display it using AlrtDialog. Can someone help? Thanks, Quote Link to comment
MullinRJ Posted January 16, 2013 Share Posted January 16, 2013 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 Quote Link to comment
zuken86 Posted January 18, 2013 Author Share Posted January 18, 2013 (edited) Thanks Raymond. I will give it a try. I am attempting to create an exploded tool for drawing assembly and setup instruction. Edited January 18, 2013 by zuken86 Quote Link to comment
Recommended Posts
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.