> 1 <
| Yazar | İleti |
|
meteyus
[5] Üsteğmen
49 ileti |
#38486 03.07.2008 15:51 GMT |
|
aşagıdaki lispte sadece secilen objelerin mesajla uzunlugunu vermektedir. bunu bir objeyı sectıgımızde ıstedıgımız noktaya uzunlugunu yazmasını nasıl yapabiliriz. kolay gelsin
(defun c:uo () (setvar "modemacro" "Archme Design by --> EhYa <--") (vl-load-com) (setq secim (ssget '((-4 . "<OR") (0 . "LINE") (0 . "LWPOLYLINE") (0 . "ARC") (0 . "ELLIPSE") (0 . "SPLINE") (0 . "CIRCLE") (-4 . "OR>") ) ) ) (if (= secim nil) (progn ) (progn (setq sayim (sslength secim)) (setq toplami 0 c 0 ) (while (< c sayim) (setq teksecim (ssname secim c)) (setq tanimi (cdr (assoc 0 (entget teksecim)))) (if (= tanimi "ARC") (progn (setq data (vlax-ename->vla-object teksecim)) (setq uz-bul (vla-get-arclength data)) (setq toplami (+ toplami uz-bul)) )) (if (or (= tanimi "LINE")(= tanimi "LWPOLYLINE")(= tanimi "POLYLINE")) (progn (setq data (vlax-ename->vla-object teksecim)) (setq uz-bul (vla-get-length data)) (setq toplami (+ toplami uz-bul)) ) ) (if (= tanimi "CIRCLE") (progn (setq data (vlax-ename->vla-object teksecim)) (setq uz-bul (vla-get-circumference data)) (setq toplami (+ toplami uz-bul)))) (if (or (= tanimi "ELLIPSE")(= tanimi "SPLINE")) (progn (command "._area" "e" teksecim) (setq uz-bul (getvar "perimeter")) (setq toplami (+ toplami uz-bul)))) (setq c (+ c 1)) ) (alert (strcat "\nToplam Uzunluk: " (rtos (/ toplami 100) 2 2)" metre")) ) ) (princ) )
|
|
|
ehya
[70] Editör
1955 ileti |
#38487 03.07.2008 16:05 GMT |
|
müsait bir zamanda eklerim..
ya da vakti olan bir arkadaş eklerse o da olur..
|
|
|
meteyus
[5] Üsteğmen
49 ileti |
#38490 03.07.2008 16:26 GMT |
|
teşekkürler ehya kardeş
|
|
|
Harbi65
[10] Binbaşı
464 ileti |
#38491 03.07.2008 16:31 GMT |
|
Nesne seçtikten sonra nokta gösterdiğin yere yazar. Nokta göstermez Enterla geçersen önce ki gibi sadece ekranda gösterir... Umarım istediğin gibi olmuştur.
Kod: (defun c:uo ()
;(setvar "modemacro" "Archme Design by --> EhYa <--") (vl-load-com) (setq yaz_yk 15.0) (setq secim (ssget '((-4 . "<OR") (0 . "LINE") (0 . "LWPOLYLINE") (0 . "ARC") (0 . "ELLIPSE") (0 . "SPLINE") (0 . "CIRCLE") (-4 . "OR>") ) ) ) (if (= secim nil) (progn ) (progn (setq sayim (sslength secim)) (setq toplami 0 c 0 ) (while (< c sayim) (setq teksecim (ssname secim c)) (setq tanimi (cdr (assoc 0 (entget teksecim)))) (if (= tanimi "ARC") (progn (setq data (vlax-ename->vla-object teksecim)) (setq uz-bul (vla-get-arclength data)) (setq toplami (+ toplami uz-bul)) ) ) (if (or (= tanimi "LINE") (= tanimi "LWPOLYLINE") (= tanimi "POLYLINE") ) (progn (setq data (vlax-ename->vla-object teksecim)) (setq uz-bul (vla-get-length data)) (setq toplami (+ toplami uz-bul)) ) ) (if (= tanimi "CIRCLE") (progn (setq data (vlax-ename->vla-object teksecim)) (setq uz-bul (vla-get-circumference data)) (setq toplami (+ toplami uz-bul)) ) ) (if (or (= tanimi "ELLIPSE") (= tanimi "SPLINE")) (progn (command "._area" "e" teksecim) (setq uz-bul (getvar "perimeter")) (setq toplami (+ toplami uz-bul)) ) ) (setq c (+ c 1)) ) (setq yz_nkt (getpoint "\n Yazının yerleşeceği noktayı gösterin:")) (if (= yz_nkt nil) (progn (alert (strcat "\nToplam Uzunluk: " (rtos (/ toplami 100) 2 2) " metre" ) ) ) (progn (command "_text" "_st" "standard" "j" "_mc" yz_nkt yaz_yk 0 (strcat (rtos (/ toplami 100) 2 2) " metre")) ) ) ) ) (princ) )
_________________________________________________________________________________________ |
|
|
meteyus
[5] Üsteğmen
49 ileti |
#38494 03.07.2008 16:38 GMT |
|
teşekkürler Harbi65 kardeş çok işime yaradı
Alıntı
|
|
|
simsek77
[2] Asteğmen |
#38517 04.07.2008 15:47 GMT |
|
Eline sağlık kardeş sağolasın. Ellerin dert görmesin. Ehya'ya da teşekkürler. Hazırladığı bu güzel lispler için.
|
|
|
izmank
[2] Asteğmen |
#38973 14.07.2008 23:07 GMT |
|
teşekkürler, elinize sağlık
|
> 1 <










