cancel
Showing results for 
Search instead for 
Did you mean: 

PB TK Dialog

Valued Contributor
Valued Contributor

I've spent most of the weekend trying to discover how to impliment a user dialog box to have a TK dialog box pop up and get the users input for informaton reguarding the program he/she is posting. I found this post below that I thought was going bring me to a sample that would show me how to make the dialog box exexute but the link didn't work. Can anyone give me a small sample of how to have get a TK dialog box to be called from Post Builder?

 

Thanks in Advance,

 

wayne-o

 

 

BROKEN LINK THREAD

******************************************

Hello G. Kuipers, 
 
Multilple cores did not cause me or my customers any problems so far. However, I had this same problem when i switched to 64bit platform. But now i am using a different way of calling a TK script. 

You can find a sample in this thread 

The "open" command is now used to call the script instead of exec. 

There is a custom command called "pb_cmd_ugwish_win64.tcl" in the PB library you that can import into your post. This also delivers a solution to call a TK script. 

I hope this helps. 

Success.
Gerrit Koelewijn 
CAD/CAM Consultant 
Siemens PLM Software
11 REPLIES

Re: PB TK Dialog

Valued Contributor
Valued Contributor

I found this but it kinda pre dates a lot of the threads I've been reviewing and seems somewhat more complicated than what you would think it has to be. I dunno.......

 

http://community.plm.automation.siemens.com/t5/NX-CMM-Inspection/Displaying-dialogues-during-Post-Pr...

Re: PB TK Dialog

I've got one working with our posts to tell you if you don't have spindle speed.  I'm sure you could tweak the TK button setting and get it to work.

 

 

post call

#=============================================================
proc PB_CMD_AMT_spindle_warning { } {
#=============================================================

  # Provide a Tcl/Tk script for your application with a qualified path
  # -- "\\" should be used for Windows' folder names
  #
   set tcl "W:\\Engineering\\Programming\\NX_CUSTOM\\8.5\\CAM\\postprocessor\\AMT_spindle_wish.tcl"


   if { [file exists "$tcl"] } {


      set buff [UGWISH_win64 "$tcl"]


     #++++++++++++++++++++++++++++++++++++++++++++++
     # Read & process data returned from the dialog
     #++++++++++++++++++++++++++++++++++++++++++++++
      if { [string match *no* $buff] } {
          MOM_output_to_listing_device "****BOOM!!****"
          MOM_output_to_listing_device "****BANG!!****"
          MOM_output_to_listing_device "****CRASH!!****"
          MOM_output_to_listing_device "****YOU KILLED THE POST!!****"
          MOM_abort "You killed the post"

      } elseif { [string match *enuf* $buff] } {

          global eternal_spindle_flag
          set eternal_spindle_flag 1
      }

   }

#MOM_output_literal "buff = $buff"


}

 

 

external file to source

#------------------------------------
 # Fetch scratch file given by caller
 #------------------------------------
  set tmp_file [lindex $argv 0]


  wm withdraw .
  update


  # Open file channel to collect output messages
   set fid [open "$tmp_file" w]


  #+++++++++++++++++++++++++++++++++++
  # Body of work for your application
  #+++++++++++++++++++++++++++++++++++
   set title "No Spindle Speed Warning!!"
   set msg   "Uhhhhhh, did you really mean to post out a program with an M3 S0? You can click yes and keep posting if you really want to but it's going to either alarm the machine out or crash the tool. Click no to cancel posting and try again. Click yes to keep going. Please don't click yes."
   set msg2   "Do you want to suppress further messages about the spindle not being turned on?"

   switch [tk_messageBox -title "$title" -message "$msg" -type yesno -icon info] {
      no {
         puts $fid no
      }
      yes {
        switch [tk_messageBox -title "$title" -message "$msg2" -type yesno -icon question] {
		  no {
		    puts $fid enuf
		  }
		  yes {
		    puts $fid yes
		  }
		}
      }
   }


  #--------------------------------------------
  # Close scratch file and set it to -readonly
  #--------------------------------------------
   #puts $fid end
   close $fid
   file attributes "$tmp_file" -readonly 1


  wm withdraw .; destroy .

 

 

 

Jake Hardwick
CNC Programmer
Senior Aerospace AMT
Production NX8.5.3.3 Beta testing NX10.0.1.4

Re: PB TK Dialog

Valued Contributor
Valued Contributor

I was sitting out in my yard reading the message you send laughing my butt off :-) . Ya... I can tweak the tk dialog for my purposes. What I want to do is have a dialog window open and get program information like program number, operation, revisions , special instructions etc. I’d rather have a dialog box come up instead of a UDE. It’s one less series of button clicks the programmer has to go through.

 

I’m not sure what:

 

wm withdraw .

update

 

is doing. Can you give me a heads up?

 

I appreciate your help very much indeed.

 

Thank You!!

 

wayne-o

Re: PB TK Dialog

Valued Contributor
Valued Contributor

CAM,

 

I figured out what the wm withdraw was about but, Im not sure what happens if the answer is yes to msg2.....?

 

Are you using NX9?

 

 wayne-o

Re: PB TK Dialog

I'm using NX8.5.

 

Yes doesn't do anything.  It will keep poping up with the error message every time it sees a S0 in an operation.  I just output yes so there would be something there. I didn't know if it would barf out on the command in PB if it was an empty string.

Jake Hardwick
CNC Programmer
Senior Aerospace AMT
Production NX8.5.3.3 Beta testing NX10.0.1.4

Re: PB TK Dialog

All of the posts from the old bbs forum are still available here:

http://community.plm.automation.siemens.com/t5/NX-CAM/bd-p/Customer-NXManufacturing-CAM

 

You can search there for TK Wish and find several examples.

Mark Rief
Retired Siemens

Re: PB TK Dialog

Valued Contributor
Valued Contributor

thanks mark

Re: PB TK Dialog

Valued Contributor
Valued Contributor

Mark

 

I found a post I am interested in. The very last post had an attachment that could be accessed in the old BBC. 

 

Is it possible to access the file that was attached to that post? Or is it lost for ever? I'd like to see the attached file.

 

Here's the link:

 

http://community.plm.automation.siemens.com/t5/NX-CAM/Add-user-input-to-Post-Using-Tk/m-p/121705#M18...

Re: PB TK Dialog

We are looking in to the missing attachment now - give the web team some time to dig.

 

Mark Rief
Retired Siemens

Learn online





Solution Information