×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

TCL command in Siemens NX 7.5. Translation from excel to tcl.

TCL command in Siemens NX 7.5. Translation from excel to tcl.

TCL command in Siemens NX 7.5. Translation from excel to tcl.

(OP)
Hello everybody,
I am CAD CAM programmer and learning tcl. For programming using Siemens NX 7.5.
I am trying write a procedure in tcl language which will do calculation in coordinate system and output a hole depth.
I manage to write it in excel , but cant do it in TCL
I excel I am using entry and exit coordinates of hole as it shown on attachment.

Formula in excel look like this:

=SQRT(POWER(D3-G3,2)+POWER(E3-H3,2)+POWER(F3-I3,2))

Where
D3= X start position of the hole
G3= X exit position of the hole
E3= Y start position of the hole
H3= Y exit position of the hole
F3= Z start position of the hole
I3= Z exit position of the hole


(Formula from excel is in attachment hole depth calculator)

In tcl I have available globals, variables:

global mom_cycle_rapid_to_pos(0) (X Start of the hole)
global mom_cycle_rapid_to_pos(1) (X Start of the hole)
global mom_cycle_rapid_to_pos(2) (X Start of the hole)
global mom_cycle_feed_to_pos(0) (X End of the hole)
global mom_cycle_feed_to_pos(1) (X End of the hole)
global mom_cycle_feed_to_pos(2) (X End of the hole)

and tried translate excel to tcl like this and it didn't work....

set H [expr{pow($mom_cycle_rapid_to_pos(0)-pow($mom_cycle_feed_to_pos(0),2),2)+
pow($mom_cycle_rapid_to_pos(1)-pow($mom_cycle_feed_to_pos(1),2),2) +
pow($mom_cycle_rapid_to_pos(2)-pow($mom_cycle_feed_to_pos(2),2),2}]



Goal is to do this calculation and output something like H= hole depth 21.84 in out first example.
I think for you guys it will be very simple.



please contact with me on segama@interia.pl

or post code here.





RE: TCL command in Siemens NX 7.5. Translation from excel to tcl.

I think you may have the wrong forum. This is a technical forum for the UCx Voice server platform.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close