{"id":91,"date":"2010-04-18T00:08:00","date_gmt":"2010-04-18T00:08:00","guid":{"rendered":"http:\/\/pycheung.com\/weblog\/?p=91"},"modified":"2012-12-10T17:11:45","modified_gmt":"2012-12-10T17:11:45","slug":"mayaautocadrhino-ii","status":"publish","type":"post","link":"https:\/\/www.pycheung.com\/weblog\/post\/91","title":{"rendered":"Maya ~= Autocad|Rhino II"},"content":{"rendered":"<p><a href=\"http:\/\/pycheung.com\/weblog\/wp-content\/uploads\/2010\/08\/customCommand.jpg\" rel=\"lightbox\"><img loading=\"lazy\" src=\"http:\/\/pycheung.com\/weblog\/wp-content\/uploads\/2010\/08\/zrtn_009p5c9b7993_tn.jpg\" style=\"WIDTH: 600px; HEIGHT: 318px\" height=\"318\" width=\"600\"\/><\/a><\/p>\n<p><span class=\"test\">AutoCAD\/Rhino command line aliases-like behaviour in Maya<\/span> 2011 with custom command + hotkey<\/p>\n<pre>\n<br\/>\/\/20100418 ec @ studiounit6\n<br\/>if ( `window -exists customCommandUI` ) {<br\/> deleteUI \ncustomCommandUI;<br\/>}\n<br\/>string $window = eval(\"window -t \\\"command\\\" -tb 1 -tlb 1 -s 0 -widthHeight \n105 25 customCommandUI\");<br\/>rowColumnLayout -numberOfColumns 2 -columnAttach 1 \n\"right\" 0 -columnWidth 1 90 -columnWidth 2 15;<br\/>\/\/text -label \n\"command\";<br\/>$testCommand = `textField -aie 1 commandUI`;\n<br\/> <br\/>\/\/textField -edit -enterCommand (\"ecRunCommand()\") \n$testCommand;<br\/>textField -edit -rfc (\"ecClearCommand()\") -enterCommand \n(\"ecRunCommand();evalDeferred \\\"deleteUI customCommandUI\\\"\") $testCommand;\n<br\/>\/\/button -label \"X\" -command (\"deleteUI -window \" + $window);<br\/>button \n-label \"O\" -command (\"ecRunCommand();evalDeferred \\\"deleteUI \ncustomCommandUI\\\"\");\n<br\/>showWindow $window;<br\/>window -edit -widthHeight 105 25 $window;\n<br\/><br\/>global proc ecRunCommand(){<br\/>$statement = `textField -q -tx \ncommandUI`;<br\/>eval($statement);<br\/>}<br\/>global proc \necClearCommand(){<br\/>eval(\"textField -edit -tx \\\"\\\" commandUI\");<br\/>}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>AutoCAD\/Rhino command line aliases-like behaviour in Maya 2011 with custom command + hotkey \/\/20100418 ec @ studiounit6 if ( `window -exists customCommandUI` ) { deleteUI customCommandUI;} string $window = eval(&#8220;window&#8230;<\/p>\n<div class=\"royalwp-readmore-wrap\"><a href=\"https:\/\/www.pycheung.com\/weblog\/post\/91\" class=\"royalwp-readmore\">Explore more <i class=\"far fa-hand-point-right\"><\/i><\/a><\/div>\n","protected":false},"author":2,"featured_media":1082,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[159],"tags":[12,60,62],"_links":{"self":[{"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/posts\/91"}],"collection":[{"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/comments?post=91"}],"version-history":[{"count":2,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/posts\/91\/revisions"}],"predecessor-version":[{"id":932,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/posts\/91\/revisions\/932"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/media\/1082"}],"wp:attachment":[{"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/media?parent=91"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/categories?post=91"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pycheung.com\/weblog\/wp-json\/wp\/v2\/tags?post=91"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}