Visual LISP, AutoLISP and General Customization
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Re: Auto offset for selected items
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-27-2013 09:53 PM in reply to:
lai
lai wrote:Hi pbejse,
I not sure if the lisp can be modify to do it to be as shown in attachment.
But of course
(defun c:osdc ( / ss e )
(setq ofd (cond
((getdist (strcat "\nEnter Offset distance"
(if ofd (strcat " <" (rtos ofd) ">: ") ": ")
)))(ofd))
)
(if (setq ss (ssget ":L"))
(repeat (sslength ss)
(setq e (vlax-ename->vla-object (ssname ss 0)))
(if (vlax-method-applicable-p e 'Offset)
(progn
(mapcar '(lambda (o)
(vl-catch-all-error-p
(vl-catch-all-apply
'vla-offset (list e o))))(list ofd (- ofd)))
(mapcar '(lambda (p)
(entmakex (list (cons 0 "CIRCLE")
(cons 10 p)
(cons 40 ofd))))
(list (vlax-curve-getstartpoint e)
(vlax-curve-getendpoint e)))
)
)
(ssdel (ssname ss 0) ss)))
(princ)
)
command: Osdc
Select objects:
HTH


