Jump to content

Recommended Posts

Posted

Try this, you will get a snap every 15º

(defun c:blkInsert (/ blkName cmdEcho attDia blkPoint entCircle distPoint polarAng OSMode autoSnap)
(if (tblsearch "block" (setq blkName (getstring "\nBlock name: ")))
	(progn
	(setq cmdEcho (getvar 'cmdEcho) attDia (getvar 'attDia) polarAng (getvar 'polarAng) OSMode (getvar 'OSMode) autoSnap (getvar 'autoSnap))
	(setvar 'cmdEcho 0)
	(setvar 'attDia 1)
	(setvar 'OSMode 32)
	(setvar 'polarANG 0.261799)
	(setvar 'autoSnap 63)
	(while 
		(if blkPoint 
			(setq blkPoint (getpoint "\nSpecify insertion point: <press ENTER to stop>" blkPoint))
			(setq blkPoint (getpoint "\nSpecify insertion point: <press ENTER to stop>"))
		)
		(if entCircle (entdel entCircle))
		(command "_.-insert" blkName blkPoint 1 1 0)
		(while (not (setq distPoint (getdist "\nType the distance: "))))
		(command "_.circle" blkPoint distPoint)
		(setq entCircle (entlast))
	)
	(if entCircle (entdel entCircle))
	(setvar 'cmdEcho cmdEcho)
	(setvar 'attDia attDia)
	(setvar 'OSMode OSMode)
	(setvar 'polarAng polarAng)
	(setvar 'autoSnap autoSnap)
	)
	(princ (strcat "The block " blkName " doesn't exist in your drawing."))
)
(princ)
)

  • Replies 22
  • Created
  • Last Reply

Top Posters In This Topic

  • fabriciorby

    9

  • Commandobill

    8

  • mbrandt5

    6

Posted (edited)

Thanks a lot for the help and though the circles reminded me of fireworks...I did the some minor alterations and got rid of them...for anyone looking for this lisp here it is...

 

 

(defun c:tblkInsert (/ blkName cmdEcho attDia blkPoint distPoint polarAng autoSnap)
(if (tblsearch "block" (setq blkName "GridLine"))
 (progn
 (setq cmdEcho (getvar 'cmdEcho) attDia (getvar 'attDia) polarAng (getvar 'polarAng) autoSnap (getvar 'autoSnap))
 (setvar 'cmdEcho 0)
 (setvar 'attDia 1)
 (setvar 'polarANG 0.261799)
 (setvar 'autoSnap 63)
 (while 
  (if blkPoint 
   (setq blkPoint (getpoint "\nSpecify insertion point: <press ENTER to stop>" blkPoint))
   (setq blkPoint (getpoint "\nSpecify insertion point: <press ENTER to stop>"))
  )
  (command "_.-insert" blkName blkPoint 1 1 0)
 )
 (setvar 'cmdEcho cmdEcho)
 (setvar 'attDia attDia)
 (setvar 'polarAng polarAng)
 (setvar 'autoSnap autoSnap)
 )
 (princ (strcat "The block " blkName " doesn't exist in your drawing."))
)
(princ)
)

Edited by mbrandt5
Posted

Oh, congrats

I thought you needed more precision while inserting

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