Go Back   AC3D Forums > Resources > AC3D Scripts and Mods
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 29th January 2007, 01:53 PM   #1
bdb
Junior Member
Junior member
 
Join Date: Jan 2007
Posts: 2
Default Re: Authoring your own scripts

Hi,

Is it possible to show a menu after right clicking in a view? Can this be done with a script?

Thanks,
Bart


Quote:
Originally Posted by Andy View Post
From within tcl, ac3d commands are generally called like this:

Code:
ac3d select_all
If a command returns a value:

Code:
set numselobs [ac3d selection_get_num_objects ]
For a list of available commands, send AC3D a 'list' comand e.g.

Code:
ac3d list
Some tips

Rather than using 'toplevel' to create a new window, we recommend you use 'new_toplevel <windowpath> <title>'. This is a multi-platform friendly function. Using this means that the script will run on any platform. If you do not use this, the new window can easily get lost behind others.

Under Windows, set File->Settings->Advanced->show-windows-console on. Any puts output will be shown in the console window that will stay visible after AC3D starts.

This message is under construction...
bdb is offline   Reply With Quote
Old 29th January 2007, 07:00 PM   #2
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,563
Default Re: Script for right-click menu

Try this:

Code:
 
#make a popup menu
menu .rightmenu -tearoff false 
.rightmenu add command -label "Select All" -command "ac3d select_all"
 
# bind a right click (button 3) to view 0 (top left view window)
bind $ToglWinName(0) <3> { tk_popup .rightmenu %X %Y}
Andy is offline   Reply With Quote
Old 2nd February 2007, 08:40 AM   #3
bdb
Junior Member
Junior member
 
Join Date: Jan 2007
Posts: 2
Default Re: Script for right-click menu

Thanks for the tip!

Regards,
Bart
Quote:
Originally Posted by Andy View Post
Try this:

Code:
 
#make a popup menu
menu .rightmenu -tearoff false 
.rightmenu add command -label "Select All" -command "ac3d select_all"
 
# bind a right click (button 3) to view 0 (top left view window)
bind $ToglWinName(0) <3> { tk_popup .rightmenu %X %Y}
bdb is offline   Reply With Quote
Old 18th March 2008, 07:57 PM   #4
Clear
Junior Member
Member
 
Join Date: Oct 2007
Posts: 12
Default Re: Script for right-click menu

what is tcl? how do i do this? do i need a separate program?
Clear is offline   Reply With Quote
Old 18th April 2008, 08:05 PM   #5
MrSteve
Senior Member
Professional user
 
MrSteve's Avatar
 
Join Date: Feb 2008
Location: Brighton, England
Posts: 231
Default Re: Script for right-click menu

no TCL is in the folder that AC3D is installed on on your computer, you can use notepad to right these is your clever enough
__________________
MarshallARTS, Playtime for the professionals!

http://www.turbosquid.com/Search/Ind...lAuthorExact/y
MrSteve is offline   Reply With Quote
Old 19th April 2008, 12:10 AM   #6
Klyde
Senior Member
Professional user
 
Klyde's Avatar
 
Join Date: Mar 2008
Location: USA
Posts: 227
Default Re: Script for right-click menu

Oh but Tcl/Tk (pronounced 'Tickle Tick') is a language all on its own my friend. Have got a book in storage; (Big, Black, Thick one), will dig it out tomarrow. It has an old version of it included. But yes you are correct you can use a text-editor to write the scripts.
__________________
VR is the future, The future is NOW!!.

Last edited by Klyde; 19th April 2008 at 12:12 AM. Reason: Spelling errors
Klyde is offline   Reply With Quote
Old 19th April 2008, 12:44 PM   #7
MrSteve
Senior Member
Professional user
 
MrSteve's Avatar
 
Join Date: Feb 2008
Location: Brighton, England
Posts: 231
Default Re: Script for right-click menu

is that what it is call Tickle Tick or is is just pronouced that way?
__________________
MarshallARTS, Playtime for the professionals!

http://www.turbosquid.com/Search/Ind...lAuthorExact/y
MrSteve is offline   Reply With Quote
Old 19th April 2008, 01:06 PM   #8
Klyde
Senior Member
Professional user
 
Klyde's Avatar
 
Join Date: Mar 2008
Location: USA
Posts: 227
Default Re: Script for right-click menu

Just pronounced that way I 'spose.
__________________
VR is the future, The future is NOW!!.
Klyde is offline   Reply With Quote
Old 22nd April 2008, 08:34 PM   #9
Klyde
Senior Member
Professional user
 
Klyde's Avatar
 
Join Date: Mar 2008
Location: USA
Posts: 227
Default Re: Script for right-click menu

Went to storage and retrieved that book. "Graphical Applications with Tcl & Tk 2nd edition. -- Eric Foster-Johnson (ISBN 1-55851-569-0) It covers ver 8.0.
__________________
VR is the future, The future is NOW!!.
Klyde is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 07:32 PM.


AC3D Forum
(C) Inivis Limited 2020