Tharwat Posted July 9, 2010 Posted July 9, 2010 Hi I used Alert function in my Lisp file, And I realized recently that it is not appearing as a message box, but as a line in the command line. I mean it is suppressed not to appear, of course by one of system variables. So what is that system variable my dear friends....... ??????? Regards Tharwat Quote
Small Fish Posted July 10, 2010 Posted July 10, 2010 Show us your code, then maybe someone can help you. Quote
Lee Mac Posted July 10, 2010 Posted July 10, 2010 use (initdia) Initdia is for ACAD Dialog Boxes: Currently' date=' the following commands make use of the [i']initdia[/i] function: ATTDEF, ATTEXT, BHATCH, BLOCK, COLOR, IMAGE, IMAGEADJUST, INSERT, LAYER, LINETYPE, MTEXT, PLOT, RENAME, STYLE, TOOLBAR, and VIEW. Quote
Lee Mac Posted July 10, 2010 Posted July 10, 2010 (setvar 'QAFLAGS (boole 2 (getvar 'QAFLAGS) 4)) Quote
Lt Dan's legs Posted July 10, 2010 Posted July 10, 2010 oh I see. I've never had problems with alert before... then again I hardly ever use them Quote
Tharwat Posted July 10, 2010 Author Posted July 10, 2010 Thanks Lee It is really great, And I do appreciate your Help a lot. The QAFLAGS is not documented with Autocad hlep I wonder why !!!. But why did not you use it directly with value 'setvar qaflags value' ...?? Faithful Tharwat Quote
Michaels Posted July 10, 2010 Posted July 10, 2010 It has to be with value 0 like; (setvar "qaflags" 0) Regards Michaels Quote
Lee Mac Posted July 11, 2010 Posted July 11, 2010 But why did not you use it directly with value 'setvar qaflags value' ...?? I just flipped a bit. It has to be with value 0 No it doesn't, mine only alters the value I wish to amend. Qaflags is undocumented and can cause a user all sorts of problems if set to certain values. Hence why I changed it in the way that I did. Quote
Michaels Posted July 11, 2010 Posted July 11, 2010 (setvar 'QAFLAGS (boole 2 (getvar 'QAFLAGS) 4)) Hello Mr. Lee May I ask you to explain to me the use of your code please ; (boole 2 (getvar 'QAFLAGS) 4)) Because I used to change the value of QAFLAGS to (1) sometimes to (0) and your code is completely new to me ........ ??? my best wishes Michaels Quote
Lee Mac Posted July 11, 2010 Posted July 11, 2010 Firstly, I would suggest that you read the help file on the boole function. Secondly, perhaps take a look here - explaining two functions that operate in the same fashion as the boole function. Lee Quote
Lee Mac Posted July 11, 2010 Posted July 11, 2010 Example with OSMODE: Say OSMODE is set to 52 (+ 32 16 4), if we apply: (boole 2 52 16) We are effectively doing this: (boole 2 52 16) Decimal Equivalent 32 16 8 4 2 1 ------------------------------------------------- [b][color=Blue]1[/color][/b] [b]1 0[/b] [color=Blue][b]1[/b][/color] [b]0 0[/b] (52) [b][color=Blue]0[/color][/b] [b]1 0[/b] [b][color=Blue]0[/color][/b] [b]0 0[/b] (16) result ------------------------------------------ [b][color=Blue]1[/color][/b] [b]0 0[/b] [b][color=Blue]1[/color][/b] [b]0 0[/b] (36) ------------------------------------------------- Hence we are effectively flipping bit 16. Quote
Michaels Posted July 11, 2010 Posted July 11, 2010 LEE That's really amazing and amazing . I have nothing to say, and I am studying what you have wrote in here. I feel that I am close to it , but will back to you if any not clear ...so is it oki with you ? best regards Michaels Quote
Lee Mac Posted July 11, 2010 Posted July 11, 2010 Boolean logic is great for concision of code, and useful for bit toggles also: Example to toggle OSMODE on and off, we flip the 16384 bit back and forth: (defun LM:OSModeToggle nil (setvar 'OSMODE (boole 6 (getvar 'OSMODE) 16384)) ) 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.