Jump to content

Recommended Posts

Posted

Hi All,

 

I am tring to create a macro (a lisp might be ok too) to insert Mtext object with justification set to Bottom Left, Height 0.09375, and Width 0.

 

This is what I'm starting with (button on a pallet)...

^C^C_mtext \ "Justify" "BL" "Height" "0.09375" "Width" "0"

 

the \ allows me to pick an insertion point, but then I get an error saying "2D point or option keyword required"

 

if i type it all in on the command line as the command is being run there are no problems. How do you send the keyword to the command in the macro?

 

Any help is greatly appriciated.

I'm running Vanilla AutoCAD 2008 SP1

Posted

For a macro, just concatenate each prompt as you would type it at the command line. Use a ";" for enter so it's visible in the macro.

 

I prefer lisp since it's easier to debug. Here is a sample.

 

;;; 
(command "._mtext" (getpoint "\nSelect BL point") "_J" "_BL" "_H" "0.09375" "_W" "0.0")
;;;
;;;
;;; optional way if you want to use the point for something else
(setq pt1 (getpoint "\nSelect BL point"))
(command "._mtext" pt1 "_J" "_BL" "_H" "0.09375" "_W" "0.0")

Posted

I figures it out this morning. My first attempt I had a space following the \, and extra spaces all over the place in the rest of the macro. Simply removing these spaces fixed it, and it works from the button just the way I want it to!!

The corrected macro...

^C^C_mtext \J;BL;H;0.09375;W;0;

 

Thanks.

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