{"id":164805,"date":"2023-03-17T08:58:41","date_gmt":"2023-03-17T08:58:41","guid":{"rendered":"\/knowledge\/forums\/topic\/i-would-like-to-make-my-own-menu-form-in-order-to-set-values-and-select-items-for-a-tcl-script-i-have-written-for-icem-cfd-looking-at-the-programmers-guide-this-seems-best-done-building-up-from-a\/"},"modified":"2023-07-31T12:26:18","modified_gmt":"2023-07-31T12:26:18","slug":"i-would-like-to-make-my-own-menu-form-in-order-to-set-values-and-select-items-for-a-tcl-script-i-have-written-for-icem-cfd-looking-at-the-programmers-guide-this-seems-best-done-building-up-from-a","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/i-would-like-to-make-my-own-menu-form-in-order-to-set-values-and-select-items-for-a-tcl-script-i-have-written-for-icem-cfd-looking-at-the-programmers-guide-this-seems-best-done-building-up-from-a\/","title":{"rendered":"I would like to make my own menu form in order to set values and select items for a Tcl script I have written for ICEM CFD.  Looking at the &#8216;Programmers Guide&#8217; this seems best done building up from a form_init command."},"content":{"rendered":"<p>This can be done with the &#8220;form_&#8221; functions, but I would probably stay away from them, since they are really done in the older GUI style, and if you create your own Tk widgets, you can then run ICEM in batch, but use only your windows without loading the main ICEM window.  Then you can do everything with all the basic Tcl\/Tk commands.  All the base commands of Tcl\/Tk are available within ICEM. Below is an example script which creates one window and selects surfaces.  It is meant to be used with ICEM\u00e2\u20ac\u2122s GUI loaded.  You can save this as &#8220;Tcl_gui_example.tcl&#8221;, and type \u00e2\u20ac\u0153source Tcl_gui_example.tcl\u00e2\u20ac\u009d in the ICEM message window with this script in the working directory.   proc create_top_window {w} {     toplevel $w     wm title $w &#8220;ICEM CFD Script ($w)&#8221;     button $w.surfs -text &#8220;Select&#8221; -command &#8220;set ${w}_surfs [geo_select surface]&#8221;     entry $w.ent -textvariable ${w}_surfs     label $w.surfs_label -text &#8220;Surfaces&#8221;     set endb [frame $w.end_buttons -bd 0]     button $endb.apply -text &#8220;Apply&#8221; -command &#8220;do_proc [set ${w}_surfs]&#8221;     button $endb.done -text &#8220;Done&#8221; -command &#8220;destroy $w&#8221;     grid $w.surfs_label $w.ent $w.surfs -sticky we -padx 2 -pady 2     grid $endb.apply $endb.done -padx 2     grid $endb &#8211; &#8211; -sticky we -pady 2     grid columnconfigure $w 1 -weight 1 }  proc do_proc {surfaces} {     # This procedure performs the action     mess &#8220;selected surfaces: $surfacesn&#8221; }  # This line sets everything going when the script is sourced create_top_window .icem_win1 # Multiple windows can be created with a different window, such as &#8220;create_top_window .icem_win2&#8221;<\/p>\n","protected":false},"template":"","class_list":["post-164805","topic","type-topic","status-publish","hentry","topic-tag-14-5","topic-tag-fluid-dynamics","topic-tag-general","topic-tag-icem-cfd"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_wp_page_template":["default"],"_bbp_last_active_time":["3-15-2023  20:20:09"],"_bbp_forum_id":["27796"],"_bbp_author_ip":["23.56.168.180"],"_btv_view_count":["578"],"siebel_km_number":["503485"],"product_version":["14.5"],"km_published_date":["2006-05-18T00:00:00.000Z"],"family":["Fluid Dynamics"],"application_name":["ICEM CFD"]},"test":"articlesansys-com"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/164805","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/164805\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/media?parent=164805"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}