Arkitera Forum  
Geri Git   Arkitera Forum > Mimarlık ve Bilişim > Yazılımlar > AutoCAD

Yanıt
 
Konu Araçları Modları Görüntüle
Eski 28-09-2005, 15:17   #1
Forum Üyesi
 
gagulik'in Avatar'ı
 
Kayıt Tarihi: 09-06-2005
Mesaj: 46
Spline I Polyline Cevirmek

Spline eğrilerini polyline nasıl çevirebilirim tesekkurler
gagulik offline   Alıntı Yaparak Yanıtla
Eski 28-09-2005, 15:27   #2
Arkitera Üyesi
 
etic'in Avatar'ı
 
Kayıt Tarihi: 27-07-2004
Mesaj: 598
polyline'ı spline'a çevirebiliyorum ama spline'ı polyline'a çeviremiyorum daha doğrusu polyline'daki keskin hatlar yuvarlaniyor diyelim. çünkü çizgilerin özelliğine baktığında yine polyline olarak gözüküyor.
gagulik bende senin gibi bu sorunun cevabını merak etmekteyim.
__________________
Sen seni üzme !
etic Şu anda online   Alıntı Yaparak Yanıtla
Eski 28-09-2005, 21:03   #3
omr
Arkitera Üyesi
 
Kayıt Tarihi: 17-08-2005
Mesaj: 75
ne yapmak için pline diye sorabilir miyim? amacınıza göre bir çözüm bulunabilir belki.
omr offline   Alıntı Yaparak Yanıtla
Eski 29-09-2005, 02:13   #4
Forum Üyesi
 
Kayıt Tarihi: 16-01-2005
Mesaj: 30
yeni metin belgesi açın aşağıdaki metni pasteleyin dosyanın uzantısını lsp yapın.




;;CADALYST 12/03 AutoLISP Solutions SPLINE-TO-PLINE.LSP
;;(c) 2003 Tony Hotchkiss

(defun spline-to-pline (/ i)
(vl-load-com)
(setq *thisdrawing* (vla-get-activedocument
(vlax-get-acad-object)
) ;_ end of vla-get-activedocument
*modelspace* (vla-get-ModelSpace *thisdrawing*)
) ;_ end of setq
(setq spline-list (get-spline))
(setq i (- 1))
(if spline-list
(progn
(setq msg "\nNumber of segments <100>: ")
(initget 6)
(setq num (getint msg))
(if (or (= num 100) (= num nil))
(setq num 100)
) ;_ end of if
(repeat (length spline-list)
(setq splobj (nth (setq i (1+ i)) spline-list))
(convert-spline splobj num)
) ;_ end of repeat
) ;_ end of progn
) ;_ end of if
) ;_ end of spline-to-pline

(defun get-spline (/ spl-list obj spline no-ent i)
(setq spl-list nil
obj nil
spline "AcDbSpline"
selsets (vla-get-selectionsets *thisdrawing*)
ss1 (vlax-make-variant "ss1")
) ;_ end of setq
(if (= (vla-get-count selsets) 0)
(setq ssobj (vla-add selsets ss1))
) ;_ end of if
(vla-clear ssobj)
(setq no-ent 1)
(while no-ent
(prompt "\nSelect splines: ")
(vla-Selectonscreen ssobj)
(if (> (vla-get-count ssobj) 0)
(progn
(setq no-ent nil)
(setq i (- 1))
(repeat (vla-get-count ssobj)
(setq
obj (vla-item ssobj
(vlax-make-variant (setq i (1+ i)))
) ;_ end of vla-item
) ;_ end of setq
(cond
((= (vlax-get-property obj "ObjectName") spline)
(setq spl-list
(append spl-list (list obj))
) ;_ end of setq
)
) ;_ end-of cond
) ;_ end of repeat
) ;_ end of progn
(prompt "\nNo entities selected, try again.")
) ;_ end of if
(if (and (= nil no-ent) (= nil spl-list))
(progn
(setq no-ent 1)
(prompt "\nNo splines selected.")
(quit)
) ;_ end of progn
) ;_ end of if
) ;_ end of while
(vla-delete (vla-item selsets 0))
spl-list
) ;_ end of get-spline

(defun convert-spline (splobj n / i)
(setq point-list nil
2Dpoint-list nil
z-list nil
spl-lyr (vlax-get-property splobj 'Layer)
startSpline (vlax-curve-getStartParam splobj)
endSpline (vlax-curve-getEndParam splobj)
i (- 1)
) ;_ end of setq
(repeat (+ n 1)
(setq i (1+ i))
(setq p (vlax-curve-getPointAtParam
splobj
(* i
(/ (- endspline startspline) n)
) ;_ end of *
) ;_ end of vlax-curve-getPointAtParam
) ;_ end of setq
(setq 2Dp (list (car p) (cadr p))
2Dpoint-list (append 2Dpoint-list 2Dp)
point-list (append point-list p)
z (caddr p)
z-list (append z-list (list z))
) ;_ end of setq
) ;_ end of repeat
(setq summ (apply '+ z-list))
(setq arraySpace
(vlax-make-safearray
vlax-vbdouble ; element type
(cons 0
(- (length point-list) 1)
) ; array dimension
) ;_ end of vlax-make-safearray
) ;_ end of setq
(setq vert-array (vlax-safearray-fill arraySpace point-list))
(vlax-make-variant vert-array)
(if (and (= :vlax-true (vlax-get-property splobj 'IsPLanar))
(= summ 0.0)
) ;_ end of and
(setq plobj (add-polyline
2Dpoint-list
vla-AddLightweightPolyline
) ;_ end of add-polyline
) ;_ end of setq
(setq plobj (add-polyline
point-list
vla-Add3DPoly
) ;_ end of add-polyline
) ;_ end of setq
) ;_ end of if
(vlax-put-property plobj 'Layer spl-lyr)
(vla-delete splobj)
(vlax-release-object splobj)
) ;_ end of convert-spline

(defun add-polyline (pt-list poly-func)
(setq arraySpace
(vlax-make-safearray
vlax-vbdouble
(cons 0
(- (length pt-list) 1)
) ; array dimension
) ;_ end of vlax-make-safearray
) ;_ end of setq
(setq vertex-array
(vlax-safearray-fill arraySpace pt-list)
) ;_ end of setq
(vlax-make-variant vertex-array)
(setq plobj (poly-func
*modelspace*
vertex-array
) ;_ end of poly-func
) ;_ end of setq
) ;_ end of add-polyline

(defun c:s2p ()
(spline-to-pline)
(princ)
) ;_ end of c:s2p

(prompt
"SPLINE-TO-PLINE by Tony Hotchkiss. Enter S2P to start"
) ;_ end of prompt



komut:s2p
burada offline   Alıntı Yaparak Yanıtla
Eski 29-09-2005, 07:43   #5
Forum Üyesi
 
rocktuel'in Avatar'ı
 
Kayıt Tarihi: 10-05-2003
Mesaj: 358
Ben daha pratik bir yol söyleyeyim... O SPLINE'ı tek başına seçerek WBLOCK komutu ile dışarıya DXF uzantısı ile kaydedin. Sonra da açın... POLYLINE'a döndüğünü göreceksiniz...
rocktuel offline   Alıntı Yaparak Yanıtla
Eski 30-09-2005, 12:05   #6
Forum Üyesi
 
gagulik'in Avatar'ı
 
Kayıt Tarihi: 09-06-2005
Mesaj: 46
lisp icin tesekkur ederim ....
dxf olarak atınca cizgiler bozuluyor yinede teşekkürler
gagulik offline   Alıntı Yaparak Yanıtla
Eski 02-10-2005, 14:17   #7
Forum Üyesi
 
neuyuz'in Avatar'ı
 
Kayıt Tarihi: 02-10-2004
Mesaj: 88
spline

slm
sevgili roctüel değini yaptığımda 3d polyline 'a dönüştürüyor.normal polyline 'çeviremezmiyiz.
neuyuz offline   Alıntı Yaparak Yanıtla
Yanıt

Yerimi olarak kaydedin


Şu an bu konuyu izleyen aktif kullanıcılar: 1 (0 üye ve 1 misafir)
 
Konu Araçları
Modları Görüntüle

Mesaj Yazma Hakları
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Açık
[IMG] kodu Açık
HTML kodu Kapalı
Trackbacks are Açık
Pingbacks are Açık
Refbacks are Kapalı


Tüm saatler GMT +3. şu anda saat 14:16.


Powered by vBulletin® |Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177