บอร์ดแสดงวิสัยทัศน์ด้านGIS

GIS&LANDSCAPE CONSULTANT_______ HTTP://THAITOPO.PAGE.TL/
 
WEB-OFFICEWEB-OFFICE  ­THAIGARDEN  ­LAND8  ­THAIMAP  ­บ้านบ้าน  ­ช่วยเหลือช่วยเหลือ  ­ค้นหาค้นหา  ­สมัครสมาชิก(Register)สมัครสมาชิก(Register)  ­รายชื่อสมาชิกรายชื่อสมาชิก  ­กลุ่มผู้ใช้กลุ่มผู้ใช้  ­เข้าสู่ระบบ(Log in)เข้าสู่ระบบ(Log in)  
สร้างหัวข้อใหม่   ตอบShare | 
 

 lisp แก้ spline>pline

อ่านหัวข้อก่อนหน้า อ่านหัวข้อถัดไป Go down 
ผู้ตั้งข้อความ
thaitopo
Admin


จำนวนข้อความ: 1132
: 16
Localisation: chiengmai
Registration date: 24/10/2006

ตั้งหัวข้อเรื่อง: lisp แก้ spline>pline   Thu Dec 13, 2007 10:45 pm

lisp ᡩ spline>pline(SPLINE2PLINE.LSP 1.91 KB)
㪩?ӊѨ? s2p..........?Ŕ?Download

(?͹ download 仠?ŕ肹?ר͠file ໧? spline2pline.lsp ?釂?ФÑ?)

http://www.tempf.com/getfile.php?filekey=1197560419.47961_Spline2Pline.lsp&mime=text/plain

อ้างอิงจาก:
;;;CADALYST 06/05 Tip2039: Spline2Pline.lsp Spline to Polyline Conversion (c) Lloyd Beachy

;; Spline2Pline.lsp (c) 2005 Lloyd Beachy
;; Routine to convert splines to plines

(Defun C:S2P (/ ss pt# cmdecho osmode clayer count ent lay lng pt-list cnt)
(vl-load-com)
(setq ss (ssget '((0 . "spline")))
pt# (getint "Enter number of segments :")
cmdecho (getvar "cmdecho")
osmode (getvar "osmode")
clayer (getvar "clayer")
count 0 ;spline counter
);end setq
(if(null pt#)(setq pt# 100))
(setvar "cmdecho" 0)
(command ".undo" "begin") ;begin undo group
(setvar "osmode" 0)
(repeat(sslength ss) ;repeat for each spline
(setq ent (vlax-ename->vla-object (ssname ss count));change spline to vla-object
lay (vlax-get-property ent "layer") ;spline's layer
lng (vlax-curve-getDistAtPoint ent(vlax-curve-getEndPoint ent));length of spline
pt-list(list(vlax-curve-getStartPoint ent)) ;coords for start of spline
cnt 1.0 ;segment counter
);end setq
(repeat pt# ;repeat for each segment
(setq pt-list(cons(vlax-curve-getPointAtDist ent (* lng(/ cnt pt#)))pt-list));add segment's point to pt-list
(setq cnt(1 cnt)) ;counter to next segment
);end segment repeat
(setq cnt 0) ;pline counter
(setvar "clayer" lay) ;match spline's layer
(command ".pline" ;start "pline" command
(repeat(length pt-list) ;repeat for each point
(command(nth cnt pt-list)) ;enter current point
(setq cnt(1 cnt)) ;counter to next point
"" ;return value to close "pline" command
);end point repeat
);end command
(setq count(1 count)) ;counter to next spline
);end spline repeat
(command ".erase" ss "")
(setvar "osmode" osmode)
(setvar "clayer" clayer)
(command ".undo" "end") ;end of undo group
(setvar "cmdecho" cmdecho)
(princ) ;exit quietly
);end C:S2P
ขึ้นไปข้างบน Go down
ดูข้อมูลส่วนตัว http://thaitopo.PAGE.TL
 

lisp แก้ spline>pline

อ่านหัวข้อก่อนหน้า อ่านหัวข้อถัดไป ขึ้นไปข้างบน 
หน้า 1 จาก 1

Permissions of this forum:คุณไม่สามารถพิมพ์ตอบ
บอร์ดแสดงวิสัยทัศน์ด้านGIS :: VBA & LISP & BLOCKS : แบ่งปันแลกเปลี่ยน-
สร้างหัวข้อใหม่   ตอบ