Skip to content

Instantly share code, notes, and snippets.

@akcansoft
Last active December 17, 2023 13:36
Show Gist options
  • Save akcansoft/a4027e58220418708aac6eb0ddc13bc2 to your computer and use it in GitHub Desktop.
Save akcansoft/a4027e58220418708aac6eb0ddc13bc2 to your computer and use it in GitHub Desktop.
ALIGN komutunun No seçeneği otomatik girilir
; ALIGN komutunun "No" seçeneği otomatik girilir
; https://youtu.be/kNRPVahM4e8 videosunda kullanılan lisp kodlarıdır
; Mesut Akcan
; makcan@gmail.com
; www.youtube.com/mesutakcan
; mesutakcan.blogspot.com
; 03/06/2023
(defun c:AL2 (/ nesne kn1 hn1 kn2 hn2 kn3 hn3)
(if (setq nesne (ssget "_:S+.")) ;Bir nesne seç.
;Nesne seçili ise
(if (setq kn1 (getpoint "\n1. kaynak nokta:")) ;1. kaynak nokta belirle.
;1. kaynak nokta varsa
(if (setq hn1 (getpoint kn1 "\n1. hedef nokta:")) ;1. hedef nokta belirle.
;1. hedef nokta varsa
(progn
(grdraw kn1 hn1 4) ; geçici çizgi çiz. 4 = Turkuaz renk
(if (setq kn2 (getpoint "\n2. kaynak nokta:")) ;2. kaynak nokta belirle.
;2. kaynak nokta varsa
(if (setq hn2 (getpoint kn2 "\n2. hedef nokta:")) ;2. hedef nokta belirle.
;2. hedef nokta varsa
(progn
(grdraw kn2 hn2 4) ; geçici çizgi çiz. 4 = Turkuaz renk
(if (setq kn3 (getpoint "\n3. kaynak nokta veya <devam>:")) ;3. kaynak nokta belirle.
;3. kaynak nokta varsa
(if (setq hn3 (getpoint kn3 "\n3. hedef nokta:")) ;3. hedef nokta belirle.
;3. hedef nokta varsa. 3 nokta ile ALIGN
(command ".ALIGN" nesne "" kn1 hn1 kn2 hn2 kn3 hn3) ;ALIGN komutunu ver
)
;3. Kaynak nokta belirlenmeyip enter ile geçildiyse. 2 nokta ile ALIGN
(command ".ALIGN" nesne "" kn1 hn1 kn2 hn2 "" "n") ;ALIGN komutunu ver
)
)
)
)
)
)
)
)
(redraw) ;Çizimi tazele. Geçici çizgiler silinir.
(princ)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment