×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-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!
  • Students Click Here

*Eng-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

Jobs

postbuilder and tcl

postbuilder and tcl

postbuilder and tcl

(OP)
hi

 I want to write a condition in postbuilder
 This means:
 I made ​​an event (UDE)
####################
POST_EVENT "rev"
 UI_LABEL "no_program"
 PARAM nr_zm
.....
.....

###################

 and I need for generating code nc, NX detect whether it is active or not
 (if not Active then stop with the message that it is missing)

 how to do it?
 

RE: postbuilder and tcl

Without seeing the rest of the UDE here is what the proc may look like


proc MOM_rev {} {

global mom_nr_zm

if {![info exists mom_nr_zm]} { MOM_output_to_listing_device "PARAMETER NOT DEFINED"
      MOM_abort "PARAMETER NOT DEFINED"
      return }
}

Place the procure at the start of program event or where ever you are adding the UDE

John Joyce
N.C. Programming Supervisor
Barnes Aerospace, Windsor CT
NX6.0.5.3

RE: postbuilder and tcl

(OP)
Hi John

thank`s for reply!!!

I do not know what I'm doing wrong, but does not work
Maybe you manage to find my mistake
### This is my UDE:
EVENT rev_67
{
   POST_EVENT "rev"
   UI_LABEL "no_program"

   PARAM no_zm

    {
        TYPE o
        DEFVAL "-"
        OPTIONS "-","rev.A","rev.B","rev.C"
        UI_LABEL "rev no"
    }
   PARAM name

    {
        TYPE o
        DEFVAL "-"
        OPTIONS "-","param 67","param fast 2/4","para fast 4/4"
        UI_LABEL "name rev"
}
}

####
and this is my procedure in post builder (I create this procedure in Start of program)

#####

proc PB_CMD_no_program {} {
uplevel #0 {
proc MOM_rev { } {
global mom_no_zm mom_name

if {![info exists mom_no_zm]} { MOM_output_to_listing_device "PARAMETER NOT DEFINED"
      MOM_abort "PARAMETER NOT DEFINED"
      return }

if {![info exists mom_name]} { MOM_output_to_listing_device "PARAMETER NOT DEFINED"
      MOM_abort "PARAMETER NOT DEFINED"
      return }

MOM_output_literal "($mom_no_zm - $mom_name)"
}
}
}

#####
With such a procedure I always gets done nc code with variables and without

(sorry for my English :) )

thank`s !!!!

RE: postbuilder and tcl

What version of NX and Post builder are you using?
 

RE: postbuilder and tcl

I think the first problem is that you have not made a call to this ccmd in Start of program to acutally make the proc available. I usually put a ccmd in there that is called PB_CMD_init_procs and put a call to all of my UDE ccmds. In other words just type in the cmd name in the init proc. This makes them available for the UDE to use.  Also no matter what in your code the var exists when you call the ude in your program the vars are set so they will always exist. This is also I am assuming the only place you are checking for the vars. So if the ude is not set the program runs normal. In your ccmd for the ude just global the vars. Then in a separate ccmd do your checking to see if they exist and that they are not - .  This will have to be in the Start Of Path area and be the first thing in there to stop everything else after it. If you have things in Start of program then either you will have to move them or live with them being output. This is because the ude's set on the program header folder are not sent until after start of program. Here is a sample snipet. You might have to put a \ in front of the - . Good Luck

if {![info exists mom_no_zm] || $mom_no_zm == -} {
     MOM_output_to_listing_device "PARAMETER REV NO NOT DEFINED"
     MOM_abort "PARAMETER NOT DEFINED"
     return
}
if {![info exists mom_name] || $mom_name == -} {
     MOM_output_to_listing_device "PARAMETER NAME REV NOT DEFINED"
     MOM_abort "PARAMETER NOT DEFINED"
     return
}


 

RE: postbuilder and tcl

(OP)
Hi thank`s very much for everything
but I do not have what I need :(

now I have that:
If I choice my event "no_program" I gets message "PARAMETER NOT DEFINED"
and
if I do not choice that event I get normal nc code

I dont`t understand this :(

I need to have this message if I not will choose a variable "no_program" from list UDE in NX.

maybe someone has a tested procedure and could share it?
Please & Thank `s!!

I work in PB 6.03

RE: postbuilder and tcl

Post your code and exactly what you want to happen and how you propose to get it. Which params are you setting in the code I sent you must set both or you will get the error. But if the ude is not set then it should stop processing because the var doesn't exist.  

RE: postbuilder and tcl

(OP)
check this for me

ok????

thank you very much!!!!
 

RE: postbuilder and tcl

Now what exactly do you want to do? If you want to absolutely not output any file by a UDE you will have to do some harder coding but not too bad I don't think. But if all you want to do is stop the output by aborting, that shouldn't be too bad. As I stated b4 you must empty start of program of all but the commands that are initializing the UDE's. Move all of the output to the start of path area and trigger it with a variable that will only be 0 once and then increment it. This was all in your start of program. Can't have this as the UDE's are not available until the Start of path. Use the commands that I have provided.
 

RE: postbuilder and tcl

You didn't uplevel the MOM_rev proc as you did before.

RE: postbuilder and tcl

(OP)
Thank you very much
I make it last
I did not hit it without your help
 

RE: postbuilder and tcl

No problem. Have fun learning this stuff!

RE: postbuilder and tcl

hello all

I want to do like Marcinell
But I do not go

I want to nx detected that when I did not use in the program event (UDE = Siemens_Cycles.cdl - EVENT high_speed_setting "SINUMERIK 840")

looks like such a procedure?

I work in NX6.05 & PB 6.03 & postprocessor with templates SINUMERIK from PB

I tried the procedure:
if {![info exists mom_command_status] || $mom_command_status == "Inactive"} {     
MOM_output_to_listing_device "PARAMETER...."      MOM_abort "PARAMETER NOT DEFINED"     
return
}
but this is not work

help me please

Thank you
 

RE: postbuilder and tcl

You really should start your own thread but mom_command_status is in most ude's and variables in ude's are only available when the ude is used so that is not going to work just checking for it to be inactive. You need to check for another variable that is in the ude. Also where are you checking for it? Timing is essential as ude's are only available at certain times. If you set the ude on the program header(folder) then it will be available at the start of operation area. You could check for it first thing in that area.

RE: postbuilder and tcl

ok thanks shags72
I know what's going on

cheers

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 Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

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

Click Here to join Eng-Tips and talk with other members!


Resources