Welcome, Guest. Please login or register.
Did you miss your activation email?
February 09, 2012, 03:18:02 AM
Home Help Login Register
News: Any Problems or Experience with Industrial Robots ?
Register and place your Question / Answer to worldwide Robotexperts right here !

+  Robotforum | Support for Robotprogrammer and Users
|-+  Simulation Systems
| |-+  eM-Workplace / Robcad
| | |-+  Help in tcl/tk programming in robCAD
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: 1 [2] 3 Print
Author Topic: Help in tcl/tk programming in robCAD  (Read 7453 times)
jitsubh07
Guest
« Reply #15 on: March 27, 2009, 06:01:48 AM »

 dance2

Hi Asimo. congr8s!!!

     Now the test script u gave is working......Now please suggest how i can make the GUI capable of interchanging info with basic RobCAD application, which I've indicated earlier.....

Best Regards,
Subhrajit
Logged
asimo
Guest
« Reply #16 on: March 28, 2009, 07:40:17 PM »

Superb!

Now let's try to solve your original problem. What I wanted to show you is how to *wait* for an event with TK. In your case, you don't have to use a while loop since it will always scanning and stay there and won't give you the opportunity to enter something. It's better to use a proc (function) tied to a button, entry, etc. As I said, its been a long time since I used Robcad and I don't have it, so I am kind of *blindfolded* when I try to help you, so we will have to work it out in team. What I suggest now is to try to put your code related to the GUI inside the same proc (GetText) with another IF condition. Something that looks like this:

proc GetText {} {
    set data [.frm.ent get]
    set entity ""
    set property ""

            # Test to see if the GUI is working when the word "end" is entered.
    if {$data == "end"} {
        tk_messageBox -type ok -default ok \
            -message "This is a message" \
            -icon info \
            -title "INFO"
    }

    # Try to pick information when the word "select_entity" is entered.
    if {$data == "select_entity"} {
        uiWriteMsg "Pick an Entity"
        set entity [uiGetPick]
        set property [apGetProperty $entity P_NAME]

        # Output the property in a MessageBox
        tk_messageBox -type ok -default ok \
            -message "This is the property: $property" \
            -icon info \
            -title "PROPERTY"
    }
}

Let me know what happened.
Logged
jitsubh07
Guest
« Reply #17 on: March 30, 2009, 07:46:47 AM »

Hi asimo.....

   I tried with the following code.....The GUI is working but when I click on the "CLICK" button after entering "select_entity" in the "Input Box", It throws an error message. A snap shot of the message has been in the attachment........ Pls go theough the following code......

#code for try1.tcl:--
Code:
exec wish84 c:/Conversion/new_try.tk &
#code for new_try.tk:--
Code:

 tk_setPalette Grey
frame .frm -borderwidth 2 -relief sunken
pack .frm -fill x

label .frm.hello -text "Hello World"
entry .frm.ent -width 30
button .but -text "CLICK" -command GetText
button .quit -text Quit -command proc_end

pack .frm.hello -side left -padx 2
pack .frm.ent -after .frm.hello -padx "5 10"

pack .but -side left
pack .quit -after .but

update idletasks

proc GetText {} {
set data [.frm.ent get]
set entity ""
set property ""

if{$data == "select_entity"} {
uiWriteMsg "Pick an Entity"
set entity [uiGetPick]
set property [apGetProperty $entity P_NAME]
tk_messageBox -type ok -default ok \
            -message "This is the property: $property" \
            -icon info \
            -title "PROPERTY"
}

}

proc proc_end {} {
puts "end"
flush stdout
exit
}

regards,
Subhrajit
Logged
asimo
Guest
« Reply #18 on: March 31, 2009, 04:08:21 AM »

...my mistake, sorry!

Instead of:
Code:
if{$data == "select_entity"} {
put:
Code:
if {$data == "select_entity"} {

Note the space between the word "if" and "{".

Try that and let me know what it does when you enter "select_entity" in the input box.
Logged
jitsubh07
Guest
« Reply #19 on: March 31, 2009, 06:00:58 AM »

HI !!

     I've given the space in between if & {.......Now the error message coming is in the attchment.....


subhrajit
Logged
asimo
Guest
« Reply #20 on: March 31, 2009, 07:56:13 PM »

Okay, so now your problem is that it doesn't *see* the librairies defined in Robcad. This one can be a little bit harder to debug remotely, but let's try something. Normally, you can add librairies with the environment variable TCLLIBPATH. This variable is read before executing a script. So you will have to find them on your computer. If you really don't know where to start searching, first try to locate the executable file to start Robcad. From there, you will have an idea of where the libraries could be. Go to the root directory of Robcad. From there, do a search for the words TCL or TK or *.tcl or *.tk or LIB. Normally, you are suppose to find them under a folder named "lib". Once you have found them, add them to the TCLLIBPATH variable or add a new variable if it's not already defined. It is better if the librairies are not within a path where there are spaces in it. Be carefull when you define the environment variable. Don't use ";" to separate path but spaces instead. And use "/" instead of "\". If there is a space in a path, try using double quotes or the short name with the "~". After that, restart Robcad and try the script again. Add every librairy path that you find (tcl, tck, lib). Try that and let me know.

Good luck.
Logged
jitsubh07
Guest
« Reply #21 on: April 01, 2009, 02:49:57 PM »

Hi Asimo...

I'll be enjoying my holidays in the next week....so we will resume our try-outs on this issue once i'll come back....

Regards,
jitsubh07

Logged
asimo
Guest
« Reply #22 on: April 02, 2009, 04:06:17 AM »

No problem, I wish you nice ones!
Logged
simspec
Full Member
***
Offline Offline

Posts: 132


« Reply #23 on: April 02, 2009, 05:04:14 PM »

Anybody know how to copy an entity from component1 into component2 with tcl???

i have tried doing apCopyObject but cant get the syntax correct to copy into compenent2 it just copies into component1
Logged
Torkens
Newbie
*
Offline Offline

Posts: 13


« Reply #24 on: July 15, 2009, 12:11:18 PM »

I read your conversation and I consider what proggram you use for tcl programing. I don't have file: wish84.exe. So in my robcad this example test dosn't work. I use tcl only as a scripts without GUI (for example for coulor points in spot model according to exel sheet). I would like to expand my programming capabilities.
Thenks
Logged
joker
Full Member
***
Offline Offline

Gender: Male
Posts: 204


"Hell...Yesterday it was workinG... I sweaR" :o)


« Reply #25 on: July 23, 2009, 06:40:26 PM »

I'm using notepad normally  icon_mrgreen
Logged
dreaming
Guest
« Reply #26 on: November 05, 2009, 02:33:38 PM »

the software is too expensive
Logged
sunshine123
Newbie
*
Offline Offline

Posts: 1


« Reply #27 on: October 09, 2011, 01:16:57 PM »


I have panel data and x, y, z co-ordinates of spot in Robcad.
I want to make an excel sheet with spot locations on panel in grid format, i.e. i want a chart on which the panel is the background and spots projected on the image of the panel in the chart.
I want 3 charts:
One for xy plane
one for yz plane
and one for xz plane.
The image of the panel captured from robcad must exactly fit the chart so that the spot co-ordinates fall at the right locations on the panel image.

Do you know how this can be done?
Logged
simspec
Full Member
***
Offline Offline

Posts: 132


« Reply #28 on: October 09, 2011, 04:17:56 PM »

add reference points in a cube around your robcad model, when you make a screen dump of the part make sure you include the reference points in the picture, paste the picture into excel and add your spot locations using the reference points shown on the picture as a scale to position the spot points in the correct location.

alternatively add the spot locations to the robcad model and then take the screen dumps and paste into excel.
Logged
RobcadSim
Newbie
*
Offline Offline

Gender: Male
Posts: 17



« Reply #29 on: October 28, 2011, 09:24:43 AM »

 
That's over?
Logged

Nice day~!
Pages: 1 [2] 3 Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!