It not exist aditional information about the tcl code of GiD, but all tcl files
(located in the directory /scripts) are ascii files. Any user can read it to learn.
It is higthly unrecommended to modify this files (if update GiD are overwritten),
instead is best to change GiD with tcl scripts loaded with the problem type.
To learn to customize, see also the code of another good problemtypes, as RamSeries or Nastran.
The file GrDataMenus.tcl contain the standard values filling the arrays
of the menus ( MenuNames MenuEntries MenuCommands MenuAcceler)
The file tclfileP.tcl, contain the code to create the menus from the array (proc CreateTopMenus, etc)
The file dev_kit.tcl contain some procedures to facilitate the use to a problemtype developer
(as explained in help-Tcl-Tk extension-Managing menus)
To change the use of the menu Export-Calculation, see the value of the arrays to define this option (in GrDataMenus.tcl):
set MenuEntries(0,5) [list [_ IGES…] [_ DXF…] — [_ GiD mesh…] —
[_ Text data report…] [_ Ascii project…] [_ ON layers…] —
[_ Calculation file…] [_ Using Template .bas (only mesh)] ]
set MenuCommands(0,5) { {Files IgesWrite} {Files DXFWrite} “” {Files WriteMesh} “”
{Files WriteAscii} {Files SaveAsciiProj} {Files SaveLayer} “”
{Files WriteCalcFile} {-np- SetTemplatesMenu %W }}
set MenuAcceler(0,5) { “” “” “” “” “” “” “” “” “” “Control-x Control-c” “”}
You can change this values an call UpdateMenus
for example,
set MenuCommands(0,5) { {Files IgesWrite} {Files DXFWrite} “” {Files WriteMesh} “”
{Files WriteAscii} {Files SaveAsciiProj} {Files SaveLayer} “”
{-np- MyWriteCalc} {-np- SetTemplatesMenu %W }}
UpdateMenus
-np- is for not process MyWriteCalc as a .central.s process order, instead is a tcl order
You must define this new tcl procedure.
The common dialog to open a file used is the proc Browser-ramR (tclfileP.tcl)
(this procedure facilitate the use of tkFDialog, defined in tkfbox.tcl)
proc MyWriteCalc { } {
set ChooseType file
set OpenMode write
set w .gid
#parent witget
set title {Write nid file}
set DefaultFile {}
#set filetypes {{{Output nid data} {.nid}} {{All files} {.*}}}
#set defaultextension “”
set filetypes {{{Output nid data} {.nid}}}
set defaultextension “.nid”
to force allwais this extension
set filename [Browser-ramR $ChooseType $OpenMode $w $title $DefaultFile $filetypes $defaultextension]
if { $filename != “” } {
.central.s process Files WriteCalcFile “$filename”
}
}
Regards
Enrique Escolano
----- Original Message -----
From: “LEWIS, RANDEL E” rlewis at oppd.com
To: gidlist at gatxan.cimne.upc.es
Sent: Tuesday, October 08, 2002 4:54 PM
Subject: RE: [GiDlist] Length of the fields in ProblemType
Enrique,
Regarding your attached discussion of Menu manipulations, is there any documentation discussing the internal structure of GiD’s menus and which files are associated with which menus? In addition, is there documentation which describes how to perform manipulations such as you’ve recommended below? I would like to add the file type *.nid to the default list for Export-Calculation but have no idea where to begin.
Randy
-----Original Message-----
From: Enrique Escolano [SMTP:escolano at cimne.upc.es]
Sent: Monday, October 07, 2002 1:35 PM
To: gidlist at gatxan.cimne.upc.es
Subject: Re: [GiDlist] Length of the fields in ProblemType
This code is tested and it works. Add a menu named “NewMenu” before “Calculate”,
and add a submenu calling a window to show the classical message “hello world”.
proc InitGIDProject { dir } {
MytTestCreateMenu “NewMenu”
InsertMenuOption “NewMenu” “Hello” 0 “WarnWin "Hello world!"” “PRE”
UpdateMenus
}
proc MytTestCreateMenu {new_menu_name} {
global MenuNames MenuEntries MenuCommands MenuAcceler
set last [llength $MenuNames]
set pos1 [expr $last-1]
set pos2 [expr $last-2]
set MenuNames [linsert $MenuNames $pos2 “$new_menu_name”]
set MenuEntries($last) $MenuEntries($pos1)
set MenuCommands($last) $MenuCommands($pos1)
set MenuAcceler($last) $MenuAcceler($pos1)
set MenuEntries($pos1) $MenuEntries($pos2)
set MenuCommands($pos1) $MenuCommands($pos2)
set MenuAcceler($pos1) $MenuAcceler($pos2)
set MenuEntries($pos2) [list “”]
set MenuCommands($pos2) [list “”]
set MenuAcceler($pos2) [list “”]
}
In general unrecommended the use of too large names or excesive mumber of fields
(for problems of limitation of some internal data, and for visualization pourposes)
The names of materials and conditions are internally limited to 300 characters,
and the number of fields of a material is limited to 100 in some old procedures.
The lenght of a field is unlimited, but if it is too large, cannot be showed inside a window.
Some internal limits (e.j. the limit of 100 fields for a material) can be removed for the
next GiD 7.1.1-beta version.
The aspect of a window can change from a computer to another one, because it does not have
fixed size, It is packed dynamically. The aesthetic change can be due to the use of a different font.
Enrique
GiDlist mailing list
GiDlist at gid.cimne.upc.es
_http://gid.cimne.upc.es/mailman/listinfo/gidlist_
-------------- next part --------------
An HTML attachment was scrubbed…
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20021009/04960bd2/attachment.htm