×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Autocad spray
2

Autocad spray

Autocad spray

(OP)
thread555-44373: Multiple picks in Autocad Hi.. Can anyone help me spray closed donuts in AutoCAD. I got the spray to spray points but need solid circles. Thank you.

Here is the lisp that I used from the thread posted in Feb.

(princ "Type SPRAY to start")
(defun c:spray ()
(setvar "cmdecho" 0)
(setq CurRead T TimeTol 0.0000002)
(setq OldTime (getvar "CDATE"))
(while CurRead
(setq ReadStuff (grread T 5 0)
NewTime (getvar "CDATE")
DeltaTime (- NewTime OldTime)
SprayFlag (if (> DeltaTime TimeTol) T nil)
);
(if (/= (car ReadStuff) 5) (setq CurRead nil))
(if SprayFlag
(progn
(setq Pt (cadr ReadStuff))
(entmake (list '(0 . "POINT") (cons 10 Pt)))
;;(command "point" Pt)
(setq OldTime NewTime)
);progn
);if
);while
(princ)
);defun

RE: Autocad spray

2
Try this modified code:

CODE

(princ "Type SPRAY to start")
 (defun c:spray ()
 (setvar "cmdecho" 0)
 (setq DoDi 0.5) ;;set desired donut OD here
 (setq DoR (/ DoDi 2))
 (setq hador (/ DoDi 4))
 (setq CurRead T TimeTol 0.00000005)
 (setq OldTime (getvar "CDATE"))
 (while CurRead
 (setq ReadStuff (grread T 5 0)
 NewTime (getvar "CDATE")
 DeltaTime (- NewTime OldTime)
 SprayFlag (if (> DeltaTime TimeTol) T nil)
 );
 (if (/= (car ReadStuff) 5) (setq CurRead nil))
 (if SprayFlag
 (progn
 (setq Pt (cadr ReadStuff))
 (setq PtL (mapcar '- pt (list hador 0.0)))
 (setq PtR (mapcar '+ pt (list hador 0.0)))
 (entmake (list 
 			'(0 . "LWPOLYLINE")
			'(100 . "AcDbEntity")
 			'(100 . "AcDbPolyline")
			'(90 . 2)
			'(70 . 1)
			(cons 43 DoR)
			(cons 10 ptL)
			'(42 . 1.0)
			(cons 10 ptR)
			'(42 . 1.0)
	))
 (setq OldTime NewTime)
 );progn
 );if
 );while
 );defun
 (princ) 

RE: Autocad spray

(OP)
CarlB Thank you for the code... it works perfectly. smile

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources