Jump to content

Recommended Posts

Posted

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

Posted

Show us your code, then maybe someone can help you.

Posted
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.

Posted

oh I see. I've never had problems with alert before... then again I hardly ever use them

Posted

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

Posted

It has to be with value 0 like;

 

(setvar "qaflags" 0)

 

Regards

 

Michaels

Posted
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.

Posted
(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

Posted

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

Posted

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.

Posted

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

Posted

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))
)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...