fabriciorby Posted July 3, 2015 Posted July 3, 2015 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) ) Quote
mbrandt5 Posted July 4, 2015 Author Posted July 4, 2015 (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 July 6, 2015 by mbrandt5 Quote
fabriciorby Posted July 7, 2015 Posted July 7, 2015 Oh, congrats I thought you needed more precision while inserting Quote
Recommended Posts
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.