MSSmith Posted November 28, 2012 Posted November 28, 2012 I am looking for an automated way to place grid ticks in a drawing. The program would allow the user to place the cursor anywhere in the model view, upon a data point, it would lock onto a 250' grid point, read it, show where the grid tick is, then allow the user to accept and place the grid tick with the X,Y coordinates or reject it and move to another location where the process begins again. I have a Microstation "user command" that does the above, but I am now working in AutoCad and could really use it there. Thanks. Quote
irneb Posted November 29, 2012 Posted November 29, 2012 Uhm, what about simply using the Point command? You could set the "grid" spacing and snap to grid through the DSettings command (or right-click on status bar and select Settings...). You might want to turn the PDMODE to some "point" which looks more like your "grid-tick". Or you could use the Insert command instead to place a block. To have the same command repeat, start off with the multiple command. Then: if you're using Point you would simply move the mouse to each grid where you want it, then click only there. If you use insert then this lisp would make it work the same way: (defun c:InsertMultiple (/ bname) (if (setq bname (getstring "\nEnter Block name: ")) (while t (command "._-insert" bname pause "" "" ""))) (princ)) Quote
BIGAL Posted November 30, 2012 Posted November 30, 2012 A bit more to Pbe hope you dont mind (defun c:InsertMultiple (/ bname) (setvar oldsnap "osmode") (setvar "osmode" 0) (setvar "Gridunit" "50,50") (setvar "gridmode" 1) (if (setq bname (getstring "\nEnter Block name: ")) (while t (command "._-insert" bname pause "" "" ""))) (setvar "osmode" oldsnap) (setvar "gridmode" 0) (princ) ) Quote
irneb Posted November 30, 2012 Posted November 30, 2012 Don't mind at all! Just I'd be a bit careful with that one. You'll need an *error* routine for in case the user presses Esc. Otherwise you could end up turning off the OSnaps permanently. Quote
BIGAL Posted November 30, 2012 Posted November 30, 2012 Yeah I tend to cheat and not worry about errors unless I really need to, have quick fix for osmode filedias etc. Quote
David Bethel Posted November 30, 2012 Posted November 30, 2012 You may have to look into LIMITS as well, if you need the grid to be visible. -David 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.