Deby Ferdian Posted March 27, 2016 Posted March 27, 2016 (edited) Yeah. It's same so! So where was my wrong came from? can you tell me @Lee Mac and Please guide me to troubleshoot this problem? Edited March 28, 2016 by Deby Ferdian Input his name! Quote
Deby Ferdian Posted March 28, 2016 Posted March 28, 2016 (edited) I get it now. It turns out that caused this all happen that is because I assign it of a keyboard shortcut into a CUI options as CTRL+W that's why my palettes is always shown up and hidden every my act to press my custom keyboard shortcut of text window. But in otherwise vice verse it's very normally when I just type it at the command line as aliasses and everything work greats very nice! so.. Do you have an any idea to get can custom the "TS" command as a text window into a CUI options? Edited March 28, 2016 by Deby Ferdian try to arragement! Quote
BIGAL Posted March 29, 2016 Posted March 29, 2016 Have a look here https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-Customization/files/GUID-9970E91B-A4F5-405C-99C1-46AD804A8858-htm.html My F1 is my osnaps Quote
Deby Ferdian Posted March 29, 2016 Posted March 29, 2016 Hi, @BIGAL or anyone could help me. Do you have an Idea guys about this code and Assign it of a keyboard shortcut key into a CUI options. Here it is my code: (defun-q c:[color=darkorange][b]TW [/b][/color]nil (tgltxtscr) (setq c:TW (vl-list* '() (if (equal '(tgltxtscr) (cadr c:TW)) '(textscr) '(tgltxtscr)) (cddr c:TW))) (princ) ) (defun tgltxtscr ( / wsh ) (if (setq wsh (vlax-create-object "wscript.shell")) (progn (textscr) (vl-catch-all-apply '(lambda ( ) (vlax-invoke wsh 'appactivate "AutoCAD Text Window") (vlax-invoke wsh 'sendkeys "% H") ) ) (vlax-release-object wsh) ) ) (princ) ) Get assign a "TW" command has figure of an above into "CTRL+W". I was try with many times but what the occur is, it seems doesn't work normally as a common as toggle screen of text window instead the subject with another function has came out since that. It is HIDE/SHOW PALETTES. why??? But in the otherwise if I just type it ("TW" command only) at the command line then everything was fine.. Quote
guigonse Posted September 9, 2017 Posted September 9, 2017 I've been in shock for a while!! Nice self-re-defining function!! Quote
Grrr Posted September 9, 2017 Posted September 9, 2017 I've been in shock for a while!! Nice self-re-defining function!! Brings me memories of this somewhat related thread about self-redefining function. I guess thats the simpliest example from Lee Mac, where my brain still gets stuck. Quote
guigonse Posted September 9, 2017 Posted September 9, 2017 Yes!! Just a late comment about both related and present thread: in old Autolisp, (defun ..) functions WHERE true lists, and so could be edited as it. This days I'm rewriting old routines to remain compatibles with Autolisp as well as AutoCAD2007 forced-VisualLISP. Take a look here if you feel idle (next paste promoted by Microsoft Explorer...) http://www.cadtutor.net/forum/showthread.php?101640-AutoLISP-or-Visual-LISP Quote
pkenewell Posted September 11, 2017 Posted September 11, 2017 Try the following: (defun-q c:ts nil (graphscr) (setq c:ts (vl-list* '() (if (equal '(graphscr) (cadr c:ts)) '(textscr) '(graphscr)) (cddr c:ts))) (princ) ) Truly Ingenious Lee! I never figured out back in the day that you could make a function re-write itself like that. I understand it a bit better now, but once upon a time I was pulling my hair out trying to figure out a way to do that. Now there it is! Quote
Lee Mac Posted September 12, 2017 Posted September 12, 2017 Truly Ingenious Lee! I never figured out back in the day that you could make a function re-write itself like that. I understand it a bit better now, but once upon a time I was pulling my hair out trying to figure out a way to do that. Now there it is! Thank you! The technique is useful for developing functions which 'learn' from repeated usage... Quote
guigonse Posted September 12, 2017 Posted September 12, 2017 Wasn't Lisp in the origin of AI development? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.