Jump to content

Recommended Posts

Posted

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.

Posted

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

Posted

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)

)

Posted

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.

Posted

Yeah I tend to cheat and not worry about errors unless I really need to, have quick fix for osmode filedias etc.

Posted

You may have to look into LIMITS as well, if you need the grid to be visible. -David

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