[求助]请问高手,铁路线应该怎么画???
偶在画一个地图不知铁路线该怎么画(一段黑、一段白的)
是不是有什么图库可以下载,直接应用呀?
还是要自己定义线型?
多谢拉!! 你能把你要画的样图发个么? 用多段线画,向两边偏移(成三条线),然后把中间的线改用虚线线型以及改变其线宽。 是这样的
能给个电子版的么? 还有黑白的长度有什么规定么? 这样行吗?
怎么画的呀? 写了个程序给你,可以把样条曲线编辑成你例图中的效果 ;把spline变成铁路线示图<BR>;ljc 2004.3<BR>(DEFUN O1O( name cd / cm tc os q zd qd ang qdz zdy w1 w2 w3 w4 p1p2 p3 p4 ) ;name--spline的图元名 cd铁路线的宽度<BR> (setq cm(getvar "cmdecho") tc(getvar "clayer") os(getvar "osmode"))<BR> (command "osnap" "off")<BR> (setq cd(/ cd 2))<BR> (setq q(entget name))<BR> (setq Zd (cdr(assoc 10 q)))<BR> (setq qd (cdr(LAST q))) <BR> (SETQ ANG (ANGLE QD ZD))<BR> (SETQ qdz (polar qd (+ ANG ( / PI 2)) cd))<BR> (setq qdy (polar qd (- ANG ( / PI 2)) cd))<BR> (command "offset" cd name qdz "")<BR> (setq w1(entlast)) <BR> (setq p1 (cdr(assoc 10 (entget w1))))<BR> (setq p2 (cdr(last (entget w1))))<BR> (command "offset" cd name qdy "") <BR> (setq w2(entlast)) <BR> (setq p4 (cdr(assoc 10 (entget w2))))<BR> (setq p3 (cdr(last (entget w2)))) <BR> (command "line" p1 p4 "") (setq w3(entlast)) <BR> (command "line" p2 p3 "") (setq w4(entlast)) <BR> (command "-bhatch" "p" "solid" "s" w1 w2 w3 w4 "" "")<BR> (command "erase" w1 w2 w3 w4 name "")<BR> (setvar "cmdecho" cm)<BR> (setvar "osmode" os)<BR> (setvar "clayer" tc)<BR>)<BR>(defun c:tl( / line n0 j linex q qd zd cdd ang qdz dqy)<BR> (setq cm(getvar "cmdecho") tc(getvar "clayer") os(getvar "osmode"))<BR> (command "osnap" "off")<BR> (print "请选择铁路线:") (print)<BR> (setq line (ssget '((0 . "SPLINE"))))<BR> (setq ds(getint "请输黑白段长度:"))<BR> (setq cd(getreal "请输入绘制铁路线的宽度:"))<BR> (command "ucs" "" "")<BR> (command "erase" (ssget "x" '((0 . "point"))) "")<BR> (setq n0 (sslength line))<BR> (setq j 0 n2 0)<BR> (repeat n0<BR> (setq linex (ssname line j)) <BR> (setq cdd(/ cd 2))<BR> (setq q(entget linex))<BR> (setq Zd (cdr(assoc 10 q)))<BR> (setq qd (cdr(LAST q))) <BR> (SETQ ANG (ANGLE QD ZD))<BR> (SETQ qdz (polar qd (+ ANG ( / PI 2)) (* 10 cd)))<BR> (setq qdy (polar qd (- ANG ( / PI 2)) (* 10 cd)))<BR> (command "offset" cdd linex qdz linex qdy "")<BR> (command "measure" linex ds "")<BR> (command)<BR> (setq point (ssget "x" '((0 . "point"))))<BR> (setq n (sslength point))<BR> (setq i 0 ii 0)<BR> (repeat n<BR> (setq p1 (cdr(assoc 10 (entget(ssname point i)))))<BR> (command "erase" (ssname point i) "") <BR> (command "zoom" "w" (polar p1 (* pi 0.75) ds ) (polar p1 (* pi -0.25) ds ) )<BR> (command "break" (list (car p1) (cadr p1) (caddr p1)) "@" )<BR> (if (= 2 ii) (setq ii 0))<BR> (if (= 0 ii) (o1o (entlast) cd) (command "erase" (entlast) ""))<BR> (setq ii (1+ ii)) <BR> (setq i (+ i 1))<BR> ) <BR> (setq j (+ j 1)) <BR> (if (= 2 ii) (o1o linex cd) (command "erase" linex ""))<BR> )<BR> (command "zoom" "e" "")<BR>(setvar "cmdecho" cm)<BR> (setvar "osmode" os)<BR> (setvar "clayer" tc)<BR>)<BR>(print "敲入tL运行程序---LJC") (PRINT)
页:
[1]
2