Jump to content

Inserting block (break line) using AutoLISP


Recommended Posts

Posted

Hi everyone,

 

I have a code that inserts a block that is included on all of my drawings. Sometimes a few hundred times on each drawing. It currently works, but I would like to eliminate a couple of the prompts to save pressing enter an extra 2 times.

 

I type the command "BB", then it prompts for insertion point, which is fine, then it prompts the following two things, which i would like to eliminate:

" Enter X scale factor, specify opposite corner, or [Corner/XYZ] : Enter Y scale factor : " and

" Pick Insertion point "

 

after those it prompts for rotation, which is also fine.

 

 

Here is the code:

(defun c:bb (/ pt)
 (while (setq pt (getpoint "\nPick Insertion point."))
   (command "-insert" "1-20 BREAK" "_non" pt "" pause)
 )
 (princ)
)

 

 

Thanks in advance,

 

Lyndon

Posted
(command "_insert" "1-20 BREAK" "_Scale" "1" "_rotate" "0" "_non" pt "" pause)

Posted

Thanks for the reply, but that did not work as i can no longer specify the rotation.

Posted

Maybe:

 

   (command "-insert" "1-20 BREAK" "_non" pt 1 1 pause)

 

-David

Posted

Thank you David, that worked perfectly.

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