Autolisp Double line / Offset double (AutoCAD)

Save coding berikut di notepad and save as dengan extension .lisp
Karena coding ini akan di load

(defun c:ol (/ ent dist obj kwrd)
  (vl-load-com)
  (while (not ent)
    (if	(eq (setq ent (car (entsel "\nPilih line untuk di offset:  ")))
	    nil
	)
      (princ "\nItu bukan line.  Tolong pilih lagi:  ")
    )
  )
  (initget (+ 1 2 4 64))
  (setq dist (getdist "\nMasukan jarak offset:  "))
  (initget (+ 2 4) "Yes No")
  (setq kwrd (getkword "\nHapus garis asli [Yes/No] <Yes>:  "))
  (if (/= kwrd "No")
    (setq kwrd "Yes")
  )
  (setq obj (vlax-ename->vla-object ent))
  (vla-offset obj dist)
  (vla-offset obj (* dist -1))
  (if (eq kwrd "Yes")
    (vla-erase obj)
  )
  (princ)
)

link sumber

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s