Jump to content

bhatch dialog box using lisp routine


Recommended Posts

Posted

Hi,

I am writing a lisp routine that needs to invoke the bhatch command. The routine does, in fact, execute bhatch but only through the command line, as if the user had entered -bhatch.

I cannot figure out why I do not get the dialog box.

 

On a similar note, when my lisp routine invokes mtext the edit box is not displayed. Here again everything seems to be done in the command line.

 

I will appreciate any comments. I may be leaving some very elementary item out of the code. Although I programed in many languages from FORTRAN in the 1960's to object based VBA this is my first full effort at AutoLisp.

 

Regards,

Jerry

Posted

Usually in lisps it is desired to NOT have dialog boxes so the routine can continue & supply information to the command. Some commands run from lisp won't by default bring up the dialog box.

you mention "-bhatch"; that hyphen insures there won't be a DB. try "bhatch" or "hatch".

To bring up the DB, if in "command line" mode, the tilde is used, as in:

(command "hatch" "`")

Posted

CarlB,

My routine takes an AutoCAD command, sets a specific layer (one for dimensions, one for text, etc.) and then executes the command. This whole thing comes about because in our engineering office the engineers have LT and the designer/drafters have full AutoCAD. With their setup there is a VBA "BeginCommand" that handles all of this nicely. The LT setup, since it cannot use VBA, has the layer switched just before the command is executed. However when the command is finished running you are left on the switched layer, that is, you are no longer on the original layer. This sounds trivial but it is a pain in the neck. My program works but for mtext I cannot get the edit box and for bhatch I cannot get the dialog box.

 

The toolbar button would have, as an example for dimlinear, ^C^C(if(null c:LT_Switch)(load "LT_Switch"));(c:LT_Switch "dimlinear");. This passes the command to my LT_Switch routine.

 

I have attached the routine in case you or anyone else is interested.

 

Thanks,

Jerry

Posted

I think you need to test for a few command names which don't issue a dialog box, and send a "tilde". Such as:

 

( T      (while (command CommandName
           (if (member Commandname '("bhatch" "-bhatch" "mtext" "hatch"))
                  (command "~");;to bring up D.B.
         (while (= (logand 1 (getvar "cmdactive")) 1)
         (command pause)))))

I'm not sure that first 'while' is needed but apparently you have it working....

Good luck!

Posted

Also to bring up dialog boxes, you may use initdia:

 

like:

(initdia)

(command "_plot")

 

or

use vla-sendcommand to force db's

Posted

Thank you both, CarlB and wizman, I appreciate your help. I am just learning lisp and I am experiencing a steep learning curve which probably explains why I have an unnecessary nested "while". I will clean up the code and give both your methods a shot.

 

Regards,

Jerry

Posted
Thank you both, CarlB and wizman, I appreciate your help. I am just learning lisp and I am experiencing a steep learning curve which probably explains why I have an unnecessary nested "while". I will clean up the code and give both your methods a shot.

 

Regards,

Jerry

 

Cheers Jerry, Enjoy Lisping..'-)

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