工具箱相关
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

acadv202.lsp 44KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511
  1. (defun c:lgq()
  2. (setq bili (= 5 6))
  3. (setq point (getstring "\nChange size of point (y/n) ? :"))
  4. (setq size (getreal "\nScale factor <8.33> ? :"))
  5. (prin1)
  6. )
  7. (defun C:TB()
  8. (while (= bili nil)
  9. (setq bili (getint "input scale parameter:"))
  10. )
  11. (command "layer" "m" "8616" "c" "3""""")
  12. (setq zp (getpoint "Input Point Position , Please !"))
  13. (setq l1 (getstring "\nEnter Up Number:"))
  14. (setq l2 (getstring "\nEnter Down Number:"))
  15. (setq x (car zp))
  16. (setq y (cadr zp))
  17. (setq lma ( max (strlen l1) (strlen l2)))
  18. (SETQ LM (+ LMA 1.5))
  19. (setq ss (ssadd))
  20. (setq zp (list x (+ y (* 0.001875 bili))))
  21. (setq ap (list x (- y (* bili 0.001875))))
  22. (command "text" "j" "mc" zp (* bili 0.0024) 0 l1)
  23. (setq ss (ssadd (entlast) ss))
  24. (command "text" "j" "mc" ap (* 0.0024 bili) 0 l2)
  25. (setq ss (ssadd (entlast) ss))
  26. (setq lgq (* lm 0.001875 bili))
  27. (setq bp (list (- x (-(/ lgq 2 ) (* 0.0008 bili))) y))
  28. (setq cp (list (- (+ x (/ lgq 2)) (* 0.0008 bili)) y))
  29. (command "line" bp cp "")
  30. (setq ss (ssadd (entlast) ss))
  31. (COMMAND "MOVE" SS "" ZP)
  32. (prin1)
  33. )
  34. (defun C:CCH()
  35. (while (= bili nil)
  36. (setq bili (getint "input scale parameter:"))
  37. )
  38. (setq xg 0.002)
  39. (setq xk 0.0015)
  40. (if (< bili 2500) (progn
  41. (setq xg 0.0024)
  42. (setq xk 0.0018)
  43. )
  44. )
  45. (command "layer" "m" "9212" "c" "1""""")
  46. (setq l1 (getstring "\nEnter Up Number:"))
  47. (setq l2 (getstring "\nEnter Down Number:"))
  48. (setq zp (getpoint "Input Point Position , Please !"))
  49. (command "insert" "c:/maped/lib/ch" zp bili """")
  50. (setq x (car zp))
  51. (setq y (cadr zp))
  52. (setq lma ( max (strlen l1) (strlen l2)))
  53. (setq ss (ssadd))
  54. (setq zp (list x (+ y (* xk bili))))
  55. (setq ap (list x (- y (* bili xk))))
  56. (command "text" "j" "mc" zp (* bili xg) 0 l1)
  57. (setq ss (ssadd (entlast) ss))
  58. (command "text" "j" "mc" ap (* xg bili) 0 l2)
  59. (setq ss (ssadd (entlast) ss))
  60. (setq lgq (* lma xk bili))
  61. (setq bp (list (- x (-(/ lgq 2 ) (* 0.0008 bili))) y))
  62. (setq cp (list (- (+ x (/ lgq 2)) (* 0.0008 bili)) y))
  63. (command "line" bp cp "")
  64. (setq ss (ssadd (entlast) ss))
  65. (COMMAND "MOVE" SS "" ZP)
  66. (prin1)
  67. )
  68. (defun C:CCC()
  69. (while (= bili nil)
  70. (setq bili (getint "input scale parameter:"))
  71. )
  72. (setq xg 0.002)
  73. (setq xk 0.0015)
  74. (if (< bili 2500) (progn
  75. (setq xg 0.0024)
  76. (setq xk 0.0018)
  77. )
  78. )
  79. (command "layer" "m" "9212" "c" "1""""")
  80. (setq l1 (getstring "\nEnter Up Number:"))
  81. (setq l2 (getstring "\nEnter Down Number:"))
  82. (setq zp (getpoint "Input Point Position , Please !"))
  83. (if (< bili 2500) (command "insert" "c:/maped/lib/cc" zp bili """"))
  84. (if (> bili 2500) (command "insert" "c:/maped/lib/c3" zp bili """"))
  85. (setq x (car zp))
  86. (setq y (cadr zp))
  87. (setq lma ( max (strlen l1) (strlen l2)))
  88. (setq ss (ssadd))
  89. (setq zp (list x (+ y (* xk bili))))
  90. (setq ap (list x (- y (* bili xk))))
  91. (command "text" "j" "mc" zp (* bili xg) 0 l1)
  92. (setq ss (ssadd (entlast) ss))
  93. (command "text" "j" "mc" ap (* xg bili) 0 l2)
  94. (setq ss (ssadd (entlast) ss))
  95. (setq lgq (* lma xk bili))
  96. (setq bp (list (- x (-(/ lgq 2 ) (* 0.0008 bili))) y))
  97. (setq cp (list (- (+ x (/ lgq 2)) (* 0.0008 bili)) y))
  98. (command "line" bp cp "")
  99. (setq ss (ssadd (entlast) ss))
  100. (COMMAND "MOVE" SS "" ZP)
  101. (prin1)
  102. )
  103. (defun C:CCG()
  104. (while (= bili nil)
  105. (setq bili (getint "input scale parameter:"))
  106. )
  107. (setq xg 0.002)
  108. (setq xk 0.0015)
  109. (if (< bili 2500) (progn
  110. (setq xg 0.0024)
  111. (setq xk 0.0018)
  112. )
  113. )
  114. (command "layer" "m" "9212" "c" "1""""")
  115. (setq l1 (getstring "\nEnter Up Number:"))
  116. (setq l2 (getstring "\nEnter Down Number:"))
  117. (setq zp (getpoint "Input Point Position , Please !"))
  118. (if (< bili 2500) (command "insert" "c:/maped/lib/cg" zp bili """"))
  119. (if (> bili 2500) (command "insert" "c:/maped/lib/c5" zp bili """"))
  120. (setq x (car zp))
  121. (setq y (cadr zp))
  122. (setq lma ( max (strlen l1) (strlen l2)))
  123. (setq ss (ssadd))
  124. (setq zp (list x (+ y (* xk bili))))
  125. (setq ap (list x (- y (* bili xk))))
  126. (command "text" "j" "mc" zp (* bili xg) 0 l1)
  127. (setq ss (ssadd (entlast) ss))
  128. (command "text" "j" "mc" ap (* xg bili) 0 l2)
  129. (setq ss (ssadd (entlast) ss))
  130. (setq lgq (* lma xk bili))
  131. (setq bp (list (- x (-(/ lgq 2 ) (* 0.0008 bili))) y))
  132. (setq cp (list (- (+ x (/ lgq 2)) (* 0.0008 bili)) y))
  133. (command "line" bp cp "")
  134. (setq ss (ssadd (entlast) ss))
  135. (COMMAND "MOVE" SS "" ZP)
  136. (prin1)
  137. )
  138. (defun C:CCF()
  139. (while (= bili nil)
  140. (setq bili (getint "input scale parameter:"))
  141. )
  142. (setq xg 0.002)
  143. (setq xk 0.0015)
  144. (if (< bili 2500) (progn
  145. (setq xg 0.0024)
  146. (setq xk 0.0018)
  147. )
  148. )
  149. (command "layer" "m" "9212" "c" "1""""")
  150. (setq l1 (getstring "\nEnter Up Number:"))
  151. (setq l2 (getstring "\nEnter Down Number:"))
  152. (setq zp (getpoint "Input Point Position , Please !"))
  153. (if (< bili 2500) (command "insert" "c:/maped/lib/cf" zp bili """"))
  154. (if (> bili 2500) (command "insert" "c:/maped/lib/c5" zp bili """"))
  155. (setq x (car zp))
  156. (setq y (cadr zp))
  157. (setq lma ( max (strlen l1) (strlen l2)))
  158. (setq ss (ssadd))
  159. (setq zp (list x (+ y (* xk bili))))
  160. (setq ap (list x (- y (* bili xk))))
  161. (command "text" "j" "mc" zp (* bili xg) 0 l1)
  162. (setq ss (ssadd (entlast) ss))
  163. (command "text" "j" "mc" ap (* xg bili) 0 l2)
  164. (setq ss (ssadd (entlast) ss))
  165. (setq lgq (* lma xk bili))
  166. (setq bp (list (- x (-(/ lgq 2 ) (* 0.0008 bili))) y))
  167. (setq cp (list (- (+ x (/ lgq 2)) (* 0.0008 bili)) y))
  168. (command "line" bp cp "")
  169. (setq ss (ssadd (entlast) ss))
  170. (COMMAND "MOVE" SS "" ZP)
  171. (prin1)
  172. )
  173. (defun C:CCI()
  174. (while (= bili nil)
  175. (setq bili (getint "input scale parameter:"))
  176. )
  177. (setq xg 0.002)
  178. (setq xk 0.0015)
  179. (if (< bili 2500) (progn
  180. (setq xg 0.0024)
  181. (setq xk 0.0018)
  182. )
  183. )
  184. (command "layer" "m" "9212" "c" "1""""")
  185. (setq l1 (getstring "\nEnter Up Number:"))
  186. (setq l2 (getstring "\nEnter Down Number:"))
  187. (setq zp (getpoint "Input Point Position , Please !"))
  188. (if (< bili 2500) (command "insert" "c:/maped/lib/ci" zp bili """"))
  189. (if (> bili 2500) (command "insert" "c:/maped/lib/c7" zp bili """"))
  190. (setq x (car zp))
  191. (setq y (cadr zp))
  192. (setq lma ( max (strlen l1) (strlen l2)))
  193. (setq ss (ssadd))
  194. (setq zp (list x (+ y (* xk bili))))
  195. (setq ap (list x (- y (* bili xk))))
  196. (command "text" "j" "mc" zp (* bili xg) 0 l1)
  197. (setq ss (ssadd (entlast) ss))
  198. (command "text" "j" "mc" ap (* xg bili) 0 l2)
  199. (setq ss (ssadd (entlast) ss))
  200. (setq lgq (* lma xk bili))
  201. (setq bp (list (- x (-(/ lgq 2 ) (* 0.0008 bili))) y))
  202. (setq cp (list (- (+ x (/ lgq 2)) (* 0.0008 bili)) y))
  203. (command "line" bp cp "")
  204. (setq ss (ssadd (entlast) ss))
  205. (COMMAND "MOVE" SS "" ZP)
  206. (prin1)
  207. )
  208. (defun C:CCB()
  209. (while (= bili nil)
  210. (setq bili (getint "input scale parameter:"))
  211. )
  212. (setq xg 0.002)
  213. (setq xk 0.0015)
  214. (if (< bili 2500) (progn
  215. (setq xg 0.0024)
  216. (setq xk 0.0018)
  217. )
  218. )
  219. (command "layer" "m" "9212" "c" "1""""")
  220. (setq l1 (getstring "\nEnter Up Number:"))
  221. (setq l2 (getstring "\nEnter Down Number:"))
  222. (setq zp (getpoint "Input Point Position , Please !"))
  223. (if (< bili 2500) (command "insert" "c:/maped/lib/cb" zp bili """"))
  224. (if (> bili 2500) (command "insert" "c:/maped/lib/c1" zp bili """"))
  225. (setq x (car zp))
  226. (setq y (cadr zp))
  227. (setq lma ( max (strlen l1) (strlen l2)))
  228. (setq ss (ssadd))
  229. (setq zp (list x (+ y (* xk bili))))
  230. (setq ap (list x (- y (* bili xk))))
  231. (command "text" "j" "mc" zp (* bili xg) 0 l1)
  232. (setq ss (ssadd (entlast) ss))
  233. (command "text" "j" "mc" ap (* xg bili) 0 l2)
  234. (setq ss (ssadd (entlast) ss))
  235. (setq lgq (* lma xk bili))
  236. (setq bp (list (- x (-(/ lgq 2 ) (* 0.0008 bili))) y))
  237. (setq cp (list (- (+ x (/ lgq 2)) (* 0.0008 bili)) y))
  238. (command "line" bp cp "")
  239. (setq ss (ssadd (entlast) ss))
  240. (COMMAND "MOVE" SS "" ZP)
  241. (prin1)
  242. )
  243. (defun C:CCK()
  244. (while (= bili nil)
  245. (setq bili (getint "input scale parameter:"))
  246. )
  247. (command "layer" "m" "9212" "c" "1""""")
  248. (setq l1 (getstring "\nEnter Up Number:"))
  249. (setq l2 (getstring "\nEnter Down Number:"))
  250. (setq zp (getpoint "Input Point Position , Please !"))
  251. (command "insert" "c:/maped/lib/ck" zp bili """")
  252. (setq x (car zp))
  253. (setq y (cadr zp))
  254. (setq lma ( max (strlen l1) (strlen l2)))
  255. (setq ss (ssadd))
  256. (setq zp (list x (+ y (* 0.0015 bili))))
  257. (setq ap (list x (- y (* bili 0.0015))))
  258. (command "text" "j" "mc" zp (* bili 0.002) 0 l1)
  259. (setq ss (ssadd (entlast) ss))
  260. (command "text" "j" "mc" ap (* 0.002 bili) 0 l2)
  261. (setq ss (ssadd (entlast) ss))
  262. (setq lgq (* lma 0.0015 bili))
  263. (setq bp (list (- x (-(/ lgq 2 ) (* 0.0008 bili))) y))
  264. (setq cp (list (- (+ x (/ lgq 2)) (* 0.0008 bili)) y))
  265. (command "line" bp cp "")
  266. (setq ss (ssadd (entlast) ss))
  267. (COMMAND "MOVE" SS "" ZP)
  268. (prin1)
  269. )
  270. (defun C:3p()
  271. (graphscr)
  272. (setq pt1(getpoint"\nFirst point:"))
  273. (setq pt2(getpoint"\nSecond point:"))
  274. (setq pt3(getpoint"\nThird point:"))
  275. (setq x1 (car pt1))
  276. (setq x2 (car pt2))
  277. (setq x3 (car pt3))
  278. (setq y1 (cadr pt1))
  279. (setq y2 (cadr pt2))
  280. (setq y3 (cadr pt3))
  281. (setq x (- x2 x1))
  282. (setq y (- y2 y1))
  283. (setq x4 (- x3 x))
  284. (setq y4 (- y3 y))
  285. (setq pt4 (list x4 y4))
  286. (command "pline" pt1 pt2 pt3 pt4 "c")
  287. )
  288. (defun c:clean()
  289. (Gc)
  290. )
  291. (defun c:dellayer()
  292. (setq l (strcase(getstring "\nEnter layer to delete:")))
  293. (setq e (entnext))
  294. (while e
  295. (if(= l (cdr(assoc 8 (entget e))))
  296. (entdel e)
  297. )
  298. (setq e (entnext e))
  299. )
  300. )
  301. ;;;;;;;;;;;;;;;;;;;;;;;;;;; DouKan;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  302. (defun c:dk()
  303. (setq p (list 0 0))
  304. (command "insert" "c:/maped/lib/dk" p "" "" "")
  305. (setq pp (ssadd(entlast)))
  306. (command "erase" pp "")
  307. (setq ee (entsel "Select a DouKan ShangBianYuan:"))
  308. (setq e (car ee))
  309. (setq ppp (ssadd))
  310. (setq ppp ee)
  311. (command "measure" ppp "B""dk""y""1.5")
  312. )
  313. ;;;;;;;;;;;;;;;;;;;;;;;;;;; JiaGuDouKan;;;;;;;;;;;;;;;;;;;;;;;;;;;
  314. (defun c:jgdk()
  315. (setq p (list 0 0))
  316. (command "insert" "c:/maped/lib/jg" p "" "" "")
  317. (setq pp (ssadd(entlast)))
  318. (command "erase" pp "")
  319. 8 (setq ee (entsel "Select a DouKan ShangBianYuan:"))
  320. (setq e (car ee))
  321. (setq ppp (ssadd))
  322. (setq ppp ee)
  323. (command "measure" ppp "B""jg""y""3")
  324. )
  325. (defun c:end (/ a)
  326. (setq a (getvar "cmdecho"))
  327. (setvar "cmdecho" 0)
  328. (initget "Yes No")
  329. (if (= (getkword "\nEND the drawing session? Yes/<No>: ") "Yes")
  330. (command "save" "" "quit" "y")
  331. (princ "\nYou must enter Yes to END a drawing session.")
  332. )
  333. (if a (setvar "cmdecho" a))
  334. 2 (princ)
  335. )
  336. ;;;;;;;;;;;;;;;;;;;;;;;;;;; XuanYa;;;;;;;;;;;;;;;;;;;;;;;;;;;
  337. (defun c:xy()
  338. (setq p (list 0 0))
  339. (command "insert" "c:/maped/lib/g8" p "" "" "")
  340. (setq pp (ssadd(entlast)))
  341. (command "erase" pp "")
  342. (setq ee (entsel "XuanZe a XuanYa ShangBianYuan:"))
  343. (setq e (car ee))
  344. (setq ppp (ssadd))
  345. (setq ppp ee)
  346. (command "measure" ppp "B""g8""y""7.5")
  347. (princ)
  348. )
  349. ;;;;;;;;;;;;;;;;;;;;;;;;;;; XuanYa;;;;;;;;;;;;;;;;;;;;;;;;;;;
  350. (defun c:dy()
  351. (command "layer" "m" "9553" "c" "1""""")
  352. (while (= bili nil)
  353. (setq bili (getint "\nEnter scale :"))
  354. )
  355. (setq p1 (getpoint "\nEnter first point :"))
  356. (setq p2 (getpoint "\nEnter second point :"))
  357. (setq dd(distance p1 p2))
  358. (setq ddd(* (/ dd bili) 1000))
  359. (while (<= ddd 3)
  360. (command "insert" "c:/maped/lib/gg3" p1 (/ dd 0.004) (getorient p1) """")
  361. )
  362. (while (<= ddd 10)
  363. (command "insert" "c:/maped/lib/g9" p1 (/ dd 0.004) (getorient p1) """")
  364. )
  365. (while (<= ddd 20)
  366. (command "insert" "c:/maped/lib/gg20" p1 (/ dd 0.004) (getorient p1) """")
  367. )
  368. (while (> ddd 20)
  369. (command "insert" "c:/maped/lib/gg30" p1 (/ dd 0.004) (getorient p1) """")
  370. )
  371. (princ1)
  372. )
  373. ;;;;;;;;;;;;;;;;;;;;;;;;;;; XiePo;;;;;;;;;;;;;;;;;;;;;;;;;;;
  374. (defun c:xp()
  375. (princ "Select Top Line And Bottom Line Of XiePo !")
  376. (command "hatch" "triang""25""")
  377. )
  378. (defun c:a()
  379. (command "pline" "end")
  380. )
  381. (defun c:xyx()
  382. (setq p (list 0 0))
  383. (command "insert" "c:/maped/lib/xyx" p "" "" "")
  384. (setq pp (ssadd(entlast)))
  385. (command "erase" pp "")
  386. (setq ee (entsel "XuanZe a XuanYa ShangBianYuan:"))
  387. (setq e (car ee))
  388. (setq ppp (ssadd))
  389. (setq ppp ee)
  390. (command "measure" ppp "B""xyx""y""7.5")
  391. (princ)
  392. )
  393. (DEFUN S::STARTUP()
  394. (SETQ ENVV (GETENV "CAMEXE"))
  395. (IF (= ENVV nil) (SETQ ENVV "") (SETQ ENVV (STRCAT ENVV "\\")))
  396. (SETQ MENX ENVV)
  397. (SETQ ODOSNP 0 CCLAYER (GETVAR "CLAYER") ODPDM 0)
  398. (SETQ NAME (GETVAR "DWGNAME"))
  399. (SETQ NAME (STRCAT NAME ".ASC"))
  400. (setq bilichi 1000)
  401. (SETQ DTF (OPEN NAME "r"))
  402. (IF (/= DTF nil)
  403. (PROGN
  404. (SETQ BILICHI (ATOI (READ-LINE DTF)))
  405. (CLOSE DTF)
  406. )
  407. )
  408. (SETVAR "LTSCALE" BILICHI)
  409. (SETQ ENVV (STRCAT MENX "order"))
  410. (if(= (ads) nil) (XLOAD ENVV))
  411. (SETQ SYMV (GETENV "CAMLIB"))
  412. (IF (= SYMV nil) (SETQ SYMV "") (SETQ SYMV (STRCAT SYMV "\\")))
  413. (PRINC)
  414. (load "appload")
  415. )
  416. (DEFUN MYERROR (SMG)
  417. (COMMAND "OSNAP" "off")
  418. (COMMAND "LAYER" "S" CCLAYER "")
  419. (SETVAR "EXPERT" 1)
  420. (PRINC " ** ERROR ** ")
  421. (PRINC SMG)
  422. (SETQ *ERROR* SERROR)
  423. (PRINC)
  424. )
  425. (DEFUN LRDCHAR(MSG DCHAR CH / D)
  426. (IF (NOT DCHAR) (SETQ D "Y") (SETQ D DCHAR))
  427. (PRINC MSG)
  428. (IF(NOT CH) (SETQ CH CH)
  429. (PROGN
  430. (PRINC " (")
  431. (PRINC CH)
  432. (PRINC " )")
  433. )
  434. )
  435. (PRINC " <")
  436. (PRINC D)
  437. (PRINC ">:")
  438. (IF (NOT CH)
  439. (SETQ CCHAR (GETSTRING " "))
  440. (PROGN
  441. (INITGET 0 CH)
  442. (SETQ CCHAR (GETKWORD " "))
  443. )
  444. )
  445. (IF (OR (= CCHAR "") (NOT CCHAR)) (SETQ CCHAR D))
  446. )
  447. (DEFUN C:tbcover()
  448. (SETQ ENVV (STRCAT MENX "cover"))
  449. (XLOAD ENVV)
  450. (C:cover)
  451. (XUNLOAD ENVV)
  452. (princ)
  453. )
  454. (DEFUN C:cal()
  455. (SETQ ENVV (STRCAT MENX "cal"))
  456. (XLOAD ENVV)
  457. (C:cal)
  458. (XUNLOAD ENVV)
  459. (princ)
  460. )
  461. (DEFUN C:itematch()
  462. (SETQ ENVV (STRCAT MENX "itematch"))
  463. (XLOAD ENVV)
  464. (C:itematch)
  465. (princ)
  466. )
  467. (DEFUN C:prematch()
  468. (SETQ ENVV (STRCAT MENX "prematch"))
  469. (XLOAD ENVV)
  470. (setq retval (C:pre))
  471. (if (= retval nil) (setq retval 0))
  472. (xunload ENVV)
  473. (if (= retval 2) (command "quit" "y"))
  474. (princ)
  475. )
  476. (DEFUN C:cleanx()
  477. (SETQ ENVV (STRCAT MENX "cleanx"))
  478. (XLOAD ENVV)
  479. (C:cleanxy)
  480. (XUNLOAD ENVV)
  481. (princ)
  482. )
  483. (DEFUN C:mpdarc()
  484. (SETQ ENVV (STRCAT MENX "arcinfor"))
  485. (XLOAD ENVV)
  486. (C:arcinfor)
  487. (XUNLOAD ENVV)
  488. (princ)
  489. )
  490. (DEFUN C:postmtch()
  491. (SETQ ENVV (STRCAT MENX "postmtch"))
  492. (XLOAD ENVV)
  493. (setq retval (C:post))
  494. (if (= retval nil) (setq retval 0))
  495. (xunload ENVV)
  496. (if (= retval 1) (command "quit" "y"))
  497. (princ)
  498. )
  499. (DEFUN C:lineSYM()
  500. (SETQ ENVV (STRCAT MENX "linet"))
  501. (XLOAD ENVV)
  502. (C:LINET)
  503. (XUNLOAD ENVV)
  504. (princ)
  505. )
  506. (DEFUN C:LM()
  507. (SETQ ENVV (STRCAT MENX "linet"))
  508. (XLOAD ENVV)
  509. (C:LINET)
  510. (XUNLOAD ENVV)
  511. (PRINC)
  512. )
  513. (DEFUN C:L_SYM_T()
  514. (SETQ ENVV (STRCAT MENX "linett"))
  515. (XLOAD ENVV)
  516. (C:LINETT)
  517. (XUNLOAD ENVV)
  518. (princ)
  519. )
  520. (DEFUN C:SMOOTH()
  521. (SETQ ENVV (STRCAT MENX "linet"))
  522. (XLOAD ENVV)
  523. (C:autospl)
  524. (XUNLOAD ENVV)
  525. (princ)
  526. )
  527. (DEFUN C:SML()
  528. (SETQ ENVV (STRCAT MENX "linet"))
  529. (XLOAD ENVV)
  530. (C:pk_point)
  531. (XUNLOAD ENVV)
  532. (princ)
  533. )
  534. (DEFUN C:JXINPUT()
  535. (SETQ ENVV (STRCAT MENX "dwgtrf"))
  536. (XLOAD ENVV)
  537. (C:TRANSF)
  538. (XUNLOAD ENVV)
  539. (princ)
  540. )
  541. (DEFUN C:AUTOMTCH()
  542. (SETQ ENVV (STRCAT MENX "autojb"))
  543. (XLOAD ENVV)
  544. (C:AUTOJB)
  545. (princ)
  546. )
  547. (DEFUN C:P&TEXT()
  548. (SETQ ENVV (STRCAT MENX "hs_list"))
  549. (XLOAD ENVV)
  550. (C:p&text)
  551. (princ)
  552. )
  553. (DEFUN C:HS_list()
  554. (SETQ ENVV (STRCAT MENX "hs_list"))
  555. (XLOAD ENVV)
  556. (C:hs_list)
  557. (princ)
  558. )
  559. (DEFUN C:hs_coor()
  560. (SETQ ENVV (STRCAT MENX "hs_list"))
  561. (XLOAD ENVV)
  562. (C:hs_coor)
  563. (princ)
  564. )
  565. (DEFUN C:XSQUARE()
  566. (SETQ ENVV (STRCAT MENX "AUTOGFW"))
  567. (XLOAD ENVV)
  568. (C:AUTOGFW)
  569. (XUNLOAD ENVV)
  570. (princ)
  571. )
  572. (DEFUN C:STD_OUT()
  573. (SETQ ENVV (STRCAT MENX "STD_OUT"))
  574. (XLOAD ENVV)
  575. (C:STD_OUT)
  576. (XUNLOAD ENVV)
  577. (princ)
  578. )
  579. (DEFUN C:STD_IN()
  580. (SETQ ENVV (STRCAT MENX "STD_IN"))
  581. (XLOAD ENVV)
  582. (C:STD_IN)
  583. (XUNLOAD ENVV)
  584. (princ)
  585. )
  586. (DEFUN C:SET2()
  587. (SETQ ENVV (STRCAT MENX "SET2"))
  588. (XLOAD ENVV)
  589. (C:SET2)
  590. )
  591. (DEFUN C:QMTCH()
  592. (C:QAUTOJB)
  593. (XUNLOAD ENVV)
  594. (COMMAND "QUIT" "Y")
  595. )
  596. (DEFUN C:FDEM()
  597. (SETQ ENVV (STRCAT MENX "FFDEM"))
  598. (XLOAD ENVV)
  599. (C:FDEM)
  600. (princ)
  601. )
  602. (DEFUN C:DPTIN()
  603. (SETQ ENVV (STRCAT MENX "FFDEM"))
  604. (XLOAD ENVV)
  605. (C:DPTIN)
  606. (princ)
  607. )
  608. (DEFUN C:ADJUST()
  609. (SETQ ENVV (STRCAT MENX "RELE"))
  610. (LOAD ENVV)
  611. (C:ADJUST)
  612. (princ)
  613. )
  614. (DEFUN C:HOUSTCH()
  615. (SETQ ENVV (STRCAT MENX "TANG"))
  616. (XLOAD ENVV)
  617. (C:HOUSTCH)
  618. (princ)
  619. )
  620. (DEFUN C:movela()
  621. (SETQ ENVV (STRCAT MENX "mpd_zhng"))
  622. (XLOAD ENVV)
  623. (C:movela)
  624. (princ)
  625. )
  626. (DEFUN C:mergela()
  627. (SETQ ENVV (STRCAT MENX "mpd_zhng"))
  628. (XLOAD ENVV)
  629. (C:mergela)
  630. (princ)
  631. )
  632. (DEFUN C:SINSRT()
  633. (SETQ ENVV (STRCAT MENX "TANG"))
  634. (XLOAD ENVV)
  635. (C:SINSRT)
  636. (princ)
  637. )
  638. (DEFUN C:MINSRT()
  639. (SETQ ENVV (STRCAT MENX "TANG"))
  640. (XLOAD ENVV)
  641. (C:MINSRT)
  642. (princ)
  643. )
  644. (DEFUN C:AREADIM()
  645. (SETQ ENVV (STRCAT MENX "TANG"))
  646. (XLOAD ENVV)
  647. (C:AREADIM)
  648. (princ)
  649. )
  650. (DEFUN C:AREASYM()
  651. (SETQ ENVV (STRCAT MENX "TANG"))
  652. (XLOAD ENVV)
  653. (C:AREASYM)
  654. (princ)
  655. )
  656. (DEFUN C:SYMSYM()
  657. (command "VSLIDE" (strcat symv "SYM"))
  658. (princ)
  659. )
  660. (DEFUN C:SYM123T()
  661. (command "VSLIDE" (strcat symv "123T"))
  662. (princ)
  663. )
  664. (DEFUN C:SYMC()
  665. (command "VSLIDE" (strcat symv "C"))
  666. (princ)
  667. )
  668. (DEFUN C:SYMHS()
  669. (command "VSLIDE" (strcat symv "HS"))
  670. (princ)
  671. )
  672. (DEFUN C:SYMI()
  673. (command "VSLIDE" (strcat symv "I"))
  674. (princ)
  675. )
  676. (DEFUN C:SYMO()
  677. (command "VSLIDE" (strcat symv "O"))
  678. (princ)
  679. )
  680. (DEFUN C:SYMPR()
  681. (command "VSLIDE" (strcat symv "PR"))
  682. (princ)
  683. )
  684. (DEFUN C:SYMVG()
  685. (command "VSLIDE" (strcat symv "VG"))
  686. (princ)
  687. )
  688. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  689. (defun C:fe(/ ZP X XX AP)
  690. (while (= BILI nil)
  691. (setq BILI (getreal "Input scale parameter:"))
  692. )
  693. (command "layer" "m" "9212" "c" "32""""")
  694. (setq zp (getpoint "Input Point Position , Please !"))
  695. (setq z1 (car zp))
  696. (setq z2 (cdr zp))
  697. (setq zp1 (cons z1 z2))
  698. (command "insert" "c:/maped/lib/aa" zp1 (* 2.5 bili) """")
  699. (setq x (car zp))
  700. (setq xx (+ x (* bili 0.001)))
  701. (setq ap (subst xx x zp))
  702. (command "text" "j" "ml" ap (* bili 0.002) 0 )
  703. (princ)
  704. )
  705. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  706. (defun c:1300()
  707. (command "layer" "m" "1300" "c" "3""""")
  708. )
  709. (defun c:8615()
  710. (command "layer" "m" "8615" "c" "3""""")
  711. )
  712. (defun c:8610()
  713. (command "layer" "m" "8610" "c" "3""""")
  714. )
  715. (defun c:2100()
  716. (command "layer" "m" "2100" "c" "1""""")
  717. )
  718. (defun c:2440()
  719. (command "layer" "m" "2440" "c" "1""""")
  720. )
  721. (defun c:9120()
  722. (command "layer" "m" "9120" "c" "2""""")
  723. )
  724. (defun c:9110()
  725. (command "layer" "m" "9110" "c" "7""""")
  726. )
  727. (defun c:zdm1()
  728. (while (= bili nil)
  729. (setq bili (getint "输入横比例尺:"))
  730. (setq biliv (getint "输入纵比例尺:"))
  731. )
  732. (setq kk (/ bili biliv))
  733. (setq loop "y")
  734. (while (= loop "y")
  735. (setq xy (getpoint "输入累距和高程 S,H !:"))
  736. (setq s (car xy))
  737. (setq h (cadr xy))
  738. (setq h (* h kk))
  739. (setq xy (list s h))
  740. (command "layer" "m" "dm" "c" "5""""")
  741. (command "insert" "c:/maped/lib/p2" xy bili """")
  742. (while (> s 0)
  743. (command "line" xy0 xy "")
  744. (setq s 0)
  745. )
  746. (setq xy0 xy)
  747. )
  748. (prin1)
  749. )
  750. (defun c:sectionv()
  751. (while (= bilih nil)
  752. (setq bilih (getint "输入断面图的横比例尺: "))
  753. )
  754. (while (= biliv nil)
  755. (setq biliv (getint "输入断面图的纵比例尺: "))
  756. )
  757. (setq scale (/ bilih biliv))
  758. (setq j 0)
  759. (setq sum 0)
  760. (setq xg "n")
  761. (setq xg (getstring "\n要修改错误吗 ? :(Y/N)"))
  762. (if (= xg "y") (progn
  763. (setq j 10)
  764. (setq sum (- sum s1))
  765. )
  766. )
  767. (setq loop "y")
  768. (while (= loop "y")
  769. (setq xy (getpoint "\n输入断面点的坐标--X,Y !"))
  770. (setq H (getreal "\n输入断面点的高程--H !"))
  771. (if (= j 0)
  772. (setq xy0 xy)
  773. )
  774. (setq s1 (distance xy xy0))
  775. (setq xy0 xy)
  776. (setq sum (+ sum s1))
  777. (setq xyz (list sum (* h scale)))
  778. (command "layer" "m" "dm" "c" "5""""")
  779. (if (/= xg "y") (progn
  780. (command "insert" "c:/maped/lib/p2" xyz bilih """")
  781. (if (/= j 0)
  782. (command "line" xyz0 xyz "")
  783. )
  784. )
  785. )
  786. (setq xg "n")
  787. (setq j 10)
  788. (setq xyz0 xyz)
  789. )
  790. (prin1)
  791. )
  792. (defun c:bzt()
  793. (while (= bilih nil)
  794. (setq bilih (getint "\n输入断面图的比例尺: "))
  795. )
  796. (setq loop "y")
  797. (setq j 0)
  798. (while (= loop "y")
  799. (command "layer" "m" "dm" "c" "5""""")
  800. (setq l1 (getstring "\n输入纵断面点点号 : "))
  801. (setq xy (getpoint "\n输入纵断面点的坐标--X,Y !"))
  802. (setq bb 0)
  803. (setq bx (getstring "\n没有横断面吗 ?大写Y/<N> :"))
  804. (if (/= bx "Y") (progn
  805. (setq bb (getreal "\n输入方位角 :"))
  806. (setq bb (* bb (/ 3.1415926 180)))
  807. )
  808. )
  809. (setq x (car xy))
  810. (setq y (cadr xy))
  811. (setq x1 (- x (* 100 (cos bb))))
  812. (setq y1 (- y (* 100 (sin bb))))
  813. (setq x2 (+ x (* 100 (cos bb))))
  814. (setq y2 (+ y (* 100 (sin bb))))
  815. (setq xy1 (list y1 x1))
  816. (setq xy2 (list y2 x2))
  817. (setq xy (list y x))
  818. (if (/= j 0)
  819. (command "line" xy0 xy "")
  820. )
  821. (if (/= bb 0)
  822. (command "line" xy1 xy2 "")
  823. )
  824. (setq zp (list (+ y (* 0.003 bilih)) x))
  825. (command "insert" "c:/maped/lib/p2" xy bilih """")
  826. (command "layer" "m" "zj" "c" "1""""")
  827. (command "text" "j" "mc" zp (* bilih 0.002) 0 l1)
  828. (setq j 10)
  829. (setq xy0 xy)
  830. )
  831. (prin1)
  832. )
  833. (defun c:dtk()
  834. (command "layer" "m" "dtk" "c" "7""""")
  835. )
  836. (defun c:dkz()
  837. (command "layer" "m" "dkz" "c" "1""""")
  838. )
  839. (defun c:zb()
  840. (command "layer" "m" "zb""")
  841. (while (= bili nil)
  842. (setq bili (getreal "\n输入成图比例尺分母 :"))
  843. )
  844. (setq tf5 (getstring "\n是50×50的图幅吗? 输入Y或N :"))
  845. (setq xxx 0.003)
  846. (setq yyy 0.0018)
  847. (setq hv "v")
  848. (setq dh 0)
  849. (setq daihao (getstring "\有带号吗? 输入Y或N :"))
  850. (if (= daihao "y")
  851. (setq dh (getreal "\n输入带号 :"))
  852. )
  853. (setq xybl (getpoint "\n输入图幅在CAD中的西南角坐标y,x :"))
  854. (setq hv (getstring "\n图幅是横向<H>或是纵向<V>? :"))
  855. (setq y0 (+ (car xybl) (* dh 1e6)))
  856. (setq x0 (cadr xybl))
  857. (setq ybl (car xybl))
  858. (setq xbl (cadr xybl))
  859. (setq lo 1)
  860. (setq bl 1)
  861. (setq cs 0.4)
  862. (if (= tf5 "y") (setq cs 0.5))
  863. (if (< bili 1000) (setq bl 2))
  864. (while (<= lo 4)
  865. (setq cx 1)
  866. (setq cy 1)
  867. (if (or (= lo 1) (= lo 4)) (setq cx 0))
  868. (if (or (= lo 2) (= lo 1)) (setq cy 0))
  869. (if (= hv "v") (progn
  870. (setq xz (+ (* (* 0.5 cx) bili) x0))
  871. (setq yz (+ (* (* cs cy) bili) y0))
  872. (setq y (+ (* (* 0.5 cx) bili) xbl))
  873. (setq x (+ (* (* cs cy) bili) ybl))
  874. )
  875. )
  876. (if (= hv "h") (progn
  877. (setq xz (+ (* (* cs cx) bili) x0))
  878. (setq yz (+ (* (* 0.5 cy) bili) y0))
  879. (setq y (+ (* (* cs cx) bili) xbl))
  880. (setq x (+ (* (* 0.5 cy) bili) ybl))
  881. )
  882. )
  883. (setq xz (fix xz))
  884. (setq yz (fix yz))
  885. (setq xz (itoa xz))
  886. (setq yz (itoa yz))
  887. (setq xz1 " ")
  888. (setq yz1 " ")
  889. (setq xln (strlen xz))
  890. (setq yln (strlen yz))
  891. (if ( > xln 5) ( progn
  892. (setq xz1 (substr xz 1 (- xln 5)))
  893. (setq xz2 (substr xz (- xln 4) 2))
  894. (setq xz3 (substr xz (- xln 2) bl))
  895. ) ;end progn else
  896. ( progn
  897. (setq xz2 (substr xz 1 (- xln 3)))
  898. (setq xz3 (substr xz (- xln 2) bl))
  899. )
  900. )
  901. (setq xz2 (strcat xz2 "." xz3))
  902. (if ( > yln 5) ( progn
  903. (setq yz1 (substr yz 1 (- yln 5)))
  904. (setq yz2 (substr yz (- yln 4) 2))
  905. (setq yz3 (substr yz (- yln 2) bl))
  906. ); end progn else
  907. ( progn
  908. (setq yz2 (substr yz 1 (- yln 3)))
  909. (setq yz3 (substr yz (- yln 2) bl))
  910. )
  911. )
  912. (setq yz2 (strcat yz2 "." yz3))
  913. (setq x1 (- x (* bili (+ 0.0042 (* 0.00135 (strlen yz1))))))
  914. (setq x2 (- x (* bili 0.0042)))
  915. (setq x3 (- x (* bili (+ (* 0.00225 (- (strlen xz2) 1)) (* 0.00135 (strlen xz1))))))
  916. (setq x3 (+ x3 (* bili 0.0001)))
  917. (setq x4 (- x (* bili (* 0.00225 (- (strlen xz2) 1)))))
  918. (if ( or (= lo 3) (= lo 4)) ( progn
  919. (setq x3 (+ x (* bili 0.0002)))
  920. (setq x3 (+ x3 (* bili 0.0001)))
  921. (setq x4 (+ x (* bili (+ (* (strlen xz1) 0.00135) 0.0002))))
  922. )
  923. )
  924. (setq yy 0.012)
  925. (if (>= bili 5000) (setq yy 0.0095))
  926. (setq y1 (- y (* bili (- yy 0.003))))
  927. (setq y2 (- y (* bili (- yy 0.0024))))
  928. (setq y3 (+ y (* bili 0.0027)))
  929. (setq y4 (+ y (* bili 0.0021)))
  930. (if (or ( = lo 2) (= lo 3)) (progn
  931. (setq y1 (+ y (* bili (- yy 0.0018))))
  932. (setq y2 (+ y (* bili (- yy 0.0024))))
  933. )
  934. )
  935. (setq pylx 0.0004)
  936. (setq pyld 0.0009)
  937. (if (or (= lo 1) (= lo 2)) (progn
  938. (setq pylx 0)
  939. (setq pyld 0.0004)
  940. )
  941. )
  942. (setq xy1 (list x1 y1))
  943. (setq xy2 (list x2 y2))
  944. (setq xy3 (list (- x3 (* pylx bili)) y3))
  945. (setq xy4 (list (- x4 (* pyld bili)) y4))
  946. (command "text" "j" "ml" xy1 (* bili yyy) 0 yz1)
  947. (command "text" "j" "ml" xy2 (* bili xxx) 0 yz2)
  948. (command "text" "j" "ml" xy3 (* bili yyy) 0 xz1)
  949. (command "text" "j" "ml" xy4 (* bili xxx) 0 xz2)
  950. (setq lo (+ lo 1))
  951. )
  952. (setq loop "y")
  953. (setq zjg 3)
  954. (if (= tf5 "y") (setq zjg 4))
  955. (while (and (>= bili 5000) (= loop "y"))
  956. (setq lo 1)
  957. (setq cx10 (* bili 0.1))
  958. (if (= hv "v") (progn
  959. (setq zx 4)
  960. (setq zy zjg)
  961. )
  962. )
  963. (if (= hv "h") (progn
  964. (setq zx zjg)
  965. (setq zy 4)
  966. )
  967. )
  968. (while (<= lo zy)
  969. (setq yz5 (+ y0 (* cx10 lo)))
  970. (setq x (- (+ ybl (* cx10 lo)) 21))
  971. (setq yz5 (fix yz5))
  972. (setq yz5 (itoa yz5))
  973. (setq ly (strlen yz5))
  974. (setq y1 (substr yz5 (- ly 4) 2))
  975. (setq y2 (substr yz5 (- ly 2) 1))
  976. (setq yz (strcat y1 "." y2))
  977. (setq yx (- xbl 35.5))
  978. (setq ys (+ xbl (+ 35.5 (* cx10 (+ zx 1)))))
  979. (setq y10 (list x yx))
  980. (setq y9 (list x ys))
  981. (command "text" "j" "ml" y10 (* bili xxx) 0 yz)
  982. (command "text" "j" "ml" y9 (* bili xxx) 0 yz)
  983. (setq lo (+ lo 1))
  984. )
  985. (setq lo 1)
  986. (while (<= lo zx)
  987. (setq xz5 (+ x0 (* cx10 lo)))
  988. (setq y (+ (+ xbl (* cx10 lo)) 10.5))
  989. (setq xz5 (fix xz5))
  990. (setq xz5 (itoa xz5))
  991. (setq ly (strlen xz5))
  992. (setq y1 (substr xz5 (- ly 4) 2))
  993. (setq y2 (substr xz5 (- ly 2) 1))
  994. (setq xz (strcat y1 "." y2))
  995. (setq xl (- ybl 39))
  996. (setq xr (+ ybl (+ 6 (* cx10 (+ zy 1)))))
  997. (setq x10 (list xl y))
  998. (setq x9 (list xr y))
  999. (command "text" "j" "ml" x10 (* bili xxx) 0 xz)
  1000. (command "text" "j" "ml" x9 (* bili xxx) 0 xz)
  1001. (setq lo (+ lo 1))
  1002. )
  1003. (setq loop "n")
  1004. )
  1005. (princ)
  1006. )
  1007. (defun c:8613()
  1008. (command "layer" "m" "8613" "c" "3""""")
  1009. )
  1010. (defun c:8611()
  1011. (command "layer" "m" "8611" "c" "3""""")
  1012. )
  1013. (defun c:8612()
  1014. (command "layer" "m" "8612" "c" "3""""")
  1015. )
  1016. (defun c:9111()
  1017. (command "layer" "m" "9111" "c" "7""""")
  1018. )
  1019. (defun c:9121()
  1020. (command "layer" "m" "9121" "c" "2""""")
  1021. )
  1022. (defun c:zj1(/ name ename ee e pl elev0 xy1 x1 y1 a aa ang elev1 txt)
  1023. (command "layer" "m" "9121-sym" "c" "1""""")
  1024. ;(SETQ BILI nil)
  1025. (while (= BILI nil)
  1026. (setq BILI (getint "Input scale parameter:"))
  1027. )
  1028. (setq name nil)
  1029. (while (not(or (= name "LINE")(= name "POLYLINE")))(progn
  1030. (setq ename nil)
  1031. (setq ee (entsel "Select a DengGaoXian:"))
  1032. (setq e (car ee))
  1033. (if e(progn
  1034. (setq pl (entget e))
  1035. (SETQ ELEV0 (caddr(cdr(assoc 10 pl))))
  1036. (setq name (cdr(assoc 0 pl)))
  1037. (setq ename e)
  1038. (if(or(= name "LINE")(= name "POLYLINE"))(progn
  1039. (princ(strcat "\n"name"selected\n"))
  1040. );end progn else
  1041. (progn (princ "\nThat's not a DengGaoXian,it's a ")(princ name)(princ "\n"))
  1042. );end if
  1043. );end progn
  1044. ;else
  1045. (princ "\nNothing Selected\n")
  1046. );end if
  1047. ));end while
  1048. (setq xy1 (car(cdr ee)))
  1049. (setq x1 (car xy1))
  1050. (setq y1 (car(cdr xy1)))
  1051. (setq a(list x1 y1 0))
  1052. (setq aa(list x1 y1))
  1053. (setq ang nil)
  1054. (while (= ang nil)
  1055. (setq ang (getangle aa "Select Second Point:"))
  1056. )
  1057. (princ (strcat "\nInput elev<" (rtos elev0) ">"))
  1058. (setq ELEV1 (getreal))
  1059. (if (not elev1) (setq elev1 elev0))
  1060. (setq ang (* ang 57.2958))
  1061. (setq txt (itoa (fix elev1)))
  1062. (command "layer" "m" "9121-SYM""")
  1063. (command "text" "j" "ml" a (* bili 0.002) ang txt)
  1064. (princ)
  1065. )
  1066. (defun c:zb1()
  1067. (command "layer" "m" "zb""")
  1068. (while (= bili nil)
  1069. (setq bili (getreal "\n输入成图比例尺分母 :"))
  1070. )
  1071. (setq tf5 (getstring "\n是50×50的图幅吗? 输入Y或N :"))
  1072. (setq xxx 0.003)
  1073. (setq yyy 0.0018)
  1074. (setq hv "v")
  1075. (setq dh 0)
  1076. (setq daihao (getstring "\有带号吗? 输入Y或N :"))
  1077. (if (= daihao "y")
  1078. (setq dh (getreal "\n输入带号 :"))
  1079. )
  1080. (setq xybl (getpoint "\n输入图幅在CAD中的西南角坐标y,x :"))
  1081. (setq hv (getstring "\n图幅是横向<H>或是纵向<V>? :"))
  1082. (setq y0 (+ (car xybl) (* dh 1e6)))
  1083. (setq x0 (cadr xybl))
  1084. (setq ybl (car xybl))
  1085. (setq xbl (cadr xybl))
  1086. (setq lo 1)
  1087. (setq bl 1)
  1088. (setq cs 0.4)
  1089. (if (= tf5 "y") (setq cs 0.5))
  1090. (if (< bili 1000) (setq bl 2))
  1091. (while (<= lo 4)
  1092. (setq cx 1)
  1093. (setq cy 1)
  1094. (if (or (= lo 1) (= lo 4)) (setq cx 0))
  1095. (if (or (= lo 2) (= lo 1)) (setq cy 0))
  1096. (if (= hv "v") (progn
  1097. (setq xz (+ (* (* 0.5 cx) bili) x0))
  1098. (setq yz (+ (* (* cs cy) bili) y0))
  1099. (setq y (+ (* (* 0.5 cx) bili) xbl))
  1100. (setq x (+ (* (* cs cy) bili) ybl))
  1101. )
  1102. )
  1103. (if (= hv "h") (progn
  1104. (setq xz (+ (* (* cs cx) bili) x0))
  1105. (setq yz (+ (* (* 0.5 cy) bili) y0))
  1106. (setq y (+ (* (* cs cx) bili) xbl))
  1107. (setq x (+ (* (* 0.5 cy) bili) ybl))
  1108. )
  1109. )
  1110. (setq xz (fix xz))
  1111. (setq yz (fix yz))
  1112. (setq xz (itoa xz))
  1113. (setq yz (itoa yz))
  1114. (setq xz1 " ")
  1115. (setq yz1 " ")
  1116. (setq xln (strlen xz))
  1117. (setq yln (strlen yz))
  1118. (if ( > xln 5) ( progn
  1119. (setq xz1 (substr xz 1 (- xln 5)))
  1120. (setq xz2 (substr xz (- xln 4) 2))
  1121. (setq xz3 (substr xz (- xln 2) bl))
  1122. ) ;end progn else
  1123. ( progn
  1124. (setq xz2 (substr xz 1 (- xln 3)))
  1125. (setq xz3 (substr xz (- xln 2) bl))
  1126. )
  1127. )
  1128. (setq xz2 (strcat xz2 ))
  1129. (if ( > yln 5) ( progn
  1130. (setq yz1 (substr yz 1 (- yln 5)))
  1131. (setq yz2 (substr yz (- yln 4) 2))
  1132. (setq yz3 (substr yz (- yln 2) bl))
  1133. ); end progn else
  1134. ( progn
  1135. (setq yz2 (substr yz 1 (- yln 3)))
  1136. (setq yz3 (substr yz (- yln 2) bl))
  1137. )
  1138. )
  1139. (setq yz2 (strcat yz2 ))
  1140. (setq x1 (- x (* bili (+ 0.0042 (* 0.00135 (strlen yz1))))))
  1141. (setq x2 (- x (* bili 0.0042)))
  1142. (setq x3 (- x (* bili (+ (* 0.00225 (- (strlen xz2) 1)) (* 0.00135 (strlen xz1))))))
  1143. (setq x3 (+ x3 (* bili 0.0001)))
  1144. (setq x4 (- x (* bili (* 0.00225 (- (strlen xz2) 1)))))
  1145. (if ( or (= lo 3) (= lo 4)) ( progn
  1146. (setq x3 (+ x (* bili 0.0002)))
  1147. (setq x3 (+ x3 (* bili 0.0001)))
  1148. (setq x4 (+ x (* bili (+ (* (strlen xz1) 0.00135) 0.0002))))
  1149. )
  1150. )
  1151. (setq yy 0.012)
  1152. (if (> bili 5000) (setq yy 0.008))
  1153. (setq y1 (- y (* bili (- yy 0.003))))
  1154. (setq y2 (- y (* bili (- yy 0.0024))))
  1155. (setq y3 (+ y (* bili 0.0027)))
  1156. (setq y4 (+ y (* bili 0.0021)))
  1157. (if (or ( = lo 2) (= lo 3)) (progn
  1158. (setq y1 (+ y (* bili (- yy 0.0018))))
  1159. (setq y2 (+ y (* bili (- yy 0.0024))))
  1160. )
  1161. )
  1162. (setq pylx 0.0004)
  1163. (setq pyld 0.0009)
  1164. (if (or (= lo 1) (= lo 2)) (progn
  1165. (setq pylx 0)
  1166. (setq pyld 0.0004)
  1167. )
  1168. )
  1169. (setq xy1 (list (+ x1 40) y1))
  1170. (setq xy2 (list (+ x2 40) y2))
  1171. (if (or (= lo 1) (= lo 2)) (progn
  1172. (setq xy3 (list (- (- x3 (* pylx bili)) 20) y3))
  1173. (setq xy4 (list (- (- x4 (* pyld bili)) 20) y4))
  1174. )
  1175. )
  1176. (if (or (= lo 3) (= lo 4)) (progn
  1177. (setq xy3 (list (+ (- x3 (* pylx bili)) 10) y3))
  1178. (setq xy4 (list (+ (- x4 (* pyld bili)) 10) y4))
  1179. )
  1180. )
  1181. (command "text" "j" "ml" xy1 (* bili yyy) 0 yz1)
  1182. (command "text" "j" "ml" xy2 (* bili xxx) 0 yz2)
  1183. (command "text" "j" "ml" xy3 (* bili yyy) 0 xz1)
  1184. (command "text" "j" "ml" xy4 (* bili xxx) 0 xz2)
  1185. (setq lo (+ lo 1))
  1186. )
  1187. (setq loop "y")
  1188. (setq zjg 3)
  1189. (if (= tf5 "y") (setq zjg 4))
  1190. (while (and (> bili 5000) (= loop "y"))
  1191. (setq lo 1)
  1192. (setq cx10 (* bili 0.1))
  1193. (if (= hv "v") (progn
  1194. (setq zx 4)
  1195. (setq zy zjg)
  1196. )
  1197. )
  1198. (if (= hv "h") (progn
  1199. (setq zx zjg)
  1200. (setq zy 4)
  1201. )
  1202. )
  1203. (while (<= lo zy)
  1204. (setq yz5 (+ y0 (* cx10 lo)))
  1205. (setq x (- (+ ybl (* cx10 lo)) 0))
  1206. (setq yz5 (fix yz5))
  1207. (setq yz5 (itoa yz5))
  1208. (setq ly (strlen yz5))
  1209. (setq y1 (substr yz5 (- ly 4) 2))
  1210. (setq y2 (substr yz5 (- ly 2) 1))
  1211. (setq yz (strcat y1 ))
  1212. (setq yx (- xbl 50.5))
  1213. (setq ys (+ xbl (+ 50.5 (* cx10 (+ zx 1)))))
  1214. (setq y10 (list x yx))
  1215. (setq y9 (list x ys))
  1216. (command "text" "j" "ml" y10 (* bili xxx) 0 yz)
  1217. (command "text" "j" "ml" y9 (* bili xxx) 0 yz)
  1218. (setq lo (+ lo 1))
  1219. )
  1220. (setq lo 1)
  1221. (while (<= lo zx)
  1222. (setq xz5 (+ x0 (* cx10 lo)))
  1223. (setq y (+ (+ xbl (* cx10 lo)) 20.5))
  1224. (setq xz5 (fix xz5))
  1225. (setq xz5 (itoa xz5))
  1226. (setq ly (strlen xz5))
  1227. (setq y1 (substr xz5 (- ly 4) 2))
  1228. (setq y2 (substr xz5 (- ly 2) 1))
  1229. (setq xz (strcat y1 ))
  1230. (setq xl (- ybl 59))
  1231. (setq xr (+ ybl (+ 6 (* cx10 (+ zy 1)))))
  1232. (setq x10 (list xl y))
  1233. (setq x9 (list xr y))
  1234. (command "text" "j" "ml" x10 (* bili xxx) 0 xz)
  1235. (command "text" "j" "ml" x9 (* bili xxx) 0 xz)
  1236. (setq lo (+ lo 1))
  1237. )
  1238. (setq loop "n")
  1239. )
  1240. (princ)
  1241. )
  1242. (defun c:posd();展地形点
  1243. (setq f (strcase(getstring "\n输入文件名:")))
  1244. (if ( = (findfile f) nil)
  1245. (progn
  1246. (print "Bad file name !")
  1247. (quit)
  1248. )
  1249. (progn
  1250. (setq a (open f "r"))
  1251. )
  1252. )
  1253. (setq BILICHI (getreal "输入成图比例尺:"))
  1254. (setq ws (getint"高程点位数:"))
  1255. (setq c (read-line a))
  1256. (while (/= c nil)
  1257. (progn
  1258. (setq L (strlen c))
  1259. (SETQ CN 1)
  1260. (SETQ CM 1)
  1261. (SETQ D NIL)
  1262. (while (< cn L)
  1263. (if(= (substr c cn 1) ",")
  1264. (PROGN
  1265. (if (= cm 1) (setq c1 cn))
  1266. (if (= cm 2) (setq c2 cn))
  1267. (if (= cm 3) (setq c3 cn))
  1268. (if (= cm 4) (setq c4 cn))
  1269. (SETQ CM (+ CM 1))
  1270. )
  1271. )
  1272. (SETQ CN (+ CN 1))
  1273. )
  1274. (setq pn (substr c 1 (- c1 1)))
  1275. (setq x (atof(substr c (+ c1 1) (- c2 1))))
  1276. (setq y (atof(substr c (+ c2 1) (- c3 1))))
  1277. (setq z (atof(substr c (+ c3 1) l)))
  1278. (setq zz ( atof(substr c (+ c3 1) l)))
  1279. (if (= 1 ws) (setq zz4 (* zz 10)))
  1280. (if (= 2 ws) (setq zz4 (* zz 100)))
  1281. (setq zz5 (itoa(fix zz4)))
  1282. (setq cd2 (strlen zz5))
  1283. (setq zz1 (substr zz5 1 (- cd2 ws)))
  1284. (setq zz2 (substr zz5 (+ (- cd2 ws) 1) ws))
  1285. (setq zz6 (strcat zz1 "." zz2))
  1286. (setq xyz (list y x z))
  1287. (command "layer" "m" "dxd" "c" "7""""")
  1288. (command "insert" "c:/maped/lib/aa" xyz bilichi ""0)
  1289. (setq yy (+ y (* bilichi 0.0003)))
  1290. (setq xyzc (list (+ yy (* bilichi 0.0015 )) x z))
  1291. (command "text" "j" "ml" xyzc (* bilichi 0.002)"0" zz6)
  1292. (setq xyzz (list (+ yy (* bilichi 0.0015 )) (- x (* bilichi 0.003)) z))
  1293. (command "layer" "m" "dm" "c" "3""""")
  1294. (command "text" "j" "ml" xyzz (* bilichi 0.002)"0" pn)
  1295. )
  1296. (setq c (read-line a))
  1297. )
  1298. (PRIN1)
  1299. )
  1300. (defun c:hdm();展断面点
  1301. (setq f (strcase(getstring "\n输入文件名:")))
  1302. (if ( = (findfile f) nil)
  1303. (progn
  1304. (print "Bad file name !")
  1305. (quit)
  1306. )
  1307. (progn
  1308. (setq a (open f "r"))
  1309. )
  1310. )
  1311. (setq bilichi (getint "输入横比例尺:"))
  1312. (setq biliv (getint "输入纵比例尺:"))
  1313. (setq kk (/ bilichi biliv))
  1314. (setq ws (getint"高程点位数:"))
  1315. (setq c (read-line a))
  1316. (while (/= c nil)
  1317. (progn
  1318. (setq L (strlen c))
  1319. (SETQ CN 1)
  1320. (SETQ CM 1)
  1321. (SETQ D NIL)
  1322. (while (< cn L)
  1323. (if(= (substr c cn 1) ",")
  1324. (PROGN
  1325. (if (= cm 1) (setq c1 cn))
  1326. (if (= cm 2) (setq c2 cn))
  1327. (if (= cm 3) (setq c3 cn))
  1328. (if (= cm 4) (setq c4 cn))
  1329. (SETQ CM (+ CM 1))
  1330. )
  1331. )
  1332. (SETQ CN (+ CN 1))
  1333. )
  1334. (setq pn (substr c 1 (- c1 1)))
  1335. (setq x (atof(substr c (+ c1 1) (- c2 1))))
  1336. (setq y (atof(substr c (+ c2 1) (- c3 1))))
  1337. (setq z (atof(substr c (+ c3 1) l)))
  1338. (setq zz ( atof(substr c (+ c3 1) l)))
  1339. (if (= 1 ws) (setq zz4 (* zz 10)))
  1340. (if (= 2 ws) (setq zz4 (* zz 100)))
  1341. (setq zz5 (itoa(fix zz4)))
  1342. (setq cd2 (strlen zz5))
  1343. (setq zz1 (substr zz5 1 (- cd2 ws)))
  1344. (setq zz2 (substr zz5 (+ (- cd2 ws) 1) ws))
  1345. (setq zz6 (strcat zz1 "." zz2))
  1346. (setq yyy (* kk y))
  1347. (setq xyz (list x yyy z))
  1348. (command "layer" "m" "dxd" "c" "5""""")
  1349. (command "insert" "c:/maped/lib/p2" xyz bilichi ""0)
  1350. (setq yy (+ yyy (* bilichi 0.0003)))
  1351. (setq xyzc (list x (+ yyy (* bilichi 0.0015 )) z))
  1352. (command "layer" "m" "dm" "c" "7""""")
  1353. (command "text" "j" "ml" xyzc (* bilichi 0.002)"0" pn)
  1354. )
  1355. (setq c (read-line a))
  1356. )
  1357. (PRIN1)
  1358. )
  1359. (defun c:zdm();展断面点
  1360. (setq f (strcase(getstring "\n输入文件名:")))
  1361. (if ( = (findfile f) nil)
  1362. (progn
  1363. (print "Bad file name !")
  1364. (quit)
  1365. )
  1366. (progn
  1367. (setq a (open f "r"))
  1368. )
  1369. )
  1370. (setq bilichi (getint "输入横比例尺:"))
  1371. (setq biliv (getint "输入纵比例尺:"))
  1372. (setq qsg (getint "输入起始高程:"))
  1373. (setq kk (/ bilichi biliv))
  1374. (setq qsgg (* kk qsg))
  1375. (setq ws (getint"高程点位数:"))
  1376. (setq c (read-line a))
  1377. (while (/= c nil)
  1378. (progn
  1379. (setq L (strlen c))
  1380. (SETQ CN 1)
  1381. (SETQ CM 1)
  1382. (SETQ D NIL)
  1383. (while (< cn L)
  1384. (if(= (substr c cn 1) ",")
  1385. (PROGN
  1386. (if (= cm 1) (setq c1 cn))
  1387. (if (= cm 2) (setq c2 cn))
  1388. (if (= cm 3) (setq c3 cn))
  1389. (if (= cm 4) (setq c4 cn))
  1390. (SETQ CM (+ CM 1))
  1391. )
  1392. )
  1393. (SETQ CN (+ CN 1))
  1394. )
  1395. (setq pn (substr c 1 (- c1 1)))
  1396. (setq x (atof(substr c (+ c1 1) (- c2 1))))
  1397. (setq y (atof(substr c (+ c2 1) (- c3 1))))
  1398. (setq z (atof(substr c (+ c3 1) l)))
  1399. (setq zz ( atof(substr c (+ c3 1) l)))
  1400. (if (= 1 ws) (setq zz4 (* y 10)))
  1401. (if (= 2 ws) (setq zz4 (* y 100)))
  1402. (setq zz5 (itoa(fix zz4)))
  1403. (setq cd2 (strlen zz5))
  1404. (setq zz1 (substr zz5 1 (- cd2 ws)))
  1405. (setq zz2 (substr zz5 (+ (- cd2 ws) 1) ws))
  1406. (setq zz6 (strcat zz1 "." zz2))
  1407. (setq yyy (* kk y))
  1408. (setq xyz (list x yyy z))
  1409. (command "layer" "m" "dxd" "c" "5""""")
  1410. (command "insert" "c:/maped/lib/p2" xyz bilichi ""0)
  1411. (setq yy (+ yyy (* bilichi 0.0003)))
  1412. (setq xyzc (list x (+ yyy (* bilichi 0.0015 )) z))
  1413. (command "layer" "m" "dm" "c" "7""""")
  1414. (command "text" "j" "ml" xyzc (* bilichi 0.002)"0" pn)
  1415. (setq x99 (list x (+ qsgg (* (- 0 0.035) bilichi))))
  1416. (setq y99 (list x (+ qsgg (* (- 0 0.0345) bilichi))))
  1417. (command "line" x99 y99 "")
  1418. (setq x99 (list x (+ qsgg (* (- 0 0.0195) bilichi))))
  1419. (setq y99 (list x (+ qsgg (* (- 0 0.0205) bilichi))))
  1420. (command "line" x99 y99 "")
  1421. (setq x99 (list x (+ qsgg (* (- 0 0.0105) bilichi))))
  1422. (setq y99 (list x (+ qsgg (* (- 0 0.010) bilichi))))
  1423. (command "line" x99 y99 "")
  1424. (setq y99 (list x (+ qsgg (* (- 0 0.0335) bilichi))))
  1425. (command "text" "j" "ml" y99 (* bilichi 0.003)"90" zz6)
  1426. (setq y99 (list x (+ qsgg (* (- 0 0.0185) bilichi))))
  1427. (command "text" "j" "ml" y99 (* bilichi 0.003)"90" pn)
  1428. )
  1429. (setq c (read-line a))
  1430. )
  1431. (PRIN1)
  1432. )
  1433. (defun c:fft();展地形点
  1434. (setq f (strcase(getstring "\n输入文件名:")))
  1435. (if ( = (findfile f) nil)
  1436. (progn
  1437. (print "Bad file name !")
  1438. (quit)
  1439. )
  1440. (progn
  1441. (setq a (open f "r"))
  1442. )
  1443. )
  1444. (setq BILICHI (getreal "输入成图比例尺:"))
  1445. (setq ws (getint"高程点位数:"))
  1446. (setq c (read-line a))
  1447. (while (/= c nil)
  1448. (progn
  1449. (setq L (strlen c))
  1450. (SETQ CN 1)
  1451. (SETQ CM 1)
  1452. (SETQ D NIL)
  1453. (while (< cn L)
  1454. (if(= (substr c cn 1) ",")
  1455. (PROGN
  1456. (if (= cm 1) (setq c1 cn))
  1457. (if (= cm 2) (setq c2 cn))
  1458. (if (= cm 3) (setq c3 cn))
  1459. (if (= cm 4) (setq c4 cn))
  1460. (SETQ CM (+ CM 1))
  1461. )
  1462. )
  1463. (SETQ CN (+ CN 1))
  1464. )
  1465. (setq pn (substr c 1 (- c1 1)))
  1466. (setq x (atof(substr c (+ c1 1) (- c2 1))))
  1467. (setq y (atof(substr c (+ c2 1) (- c3 1))))
  1468. (setq z (atof(substr c (+ c3 1) l)))
  1469. (setq zz ( atof(substr c (+ c3 1) l)))
  1470. (if (= 1 ws) (setq zz4 (* zz 10)))
  1471. (if (= 2 ws) (setq zz4 (* zz 100)))
  1472. (setq zz5 (itoa(fix zz4)))
  1473. (setq cd2 (strlen zz5))
  1474. (setq zz1 (substr zz5 1 (- cd2 ws)))
  1475. (setq zz2 (substr zz5 (+ (- cd2 ws) 1) ws))
  1476. (setq zz6 (strcat zz1 "." zz2))
  1477. (setq xyz (list y x z))
  1478. (command "layer" "m" "dxd" "c" "7""""")
  1479. (command "insert" "c:/maped/lib/p2" xyz bilichi ""0)
  1480. (setq yy (+ y (* bilichi 0.0003)))
  1481. (setq xyzc (list (+ yy (* bilichi 0.0015 )) x z))
  1482. (command "text" "j" "ml" xyzc (* bilichi 0.002)"0" pn)
  1483. (setq xyzz (list (+ yy (* bilichi 0.0015 )) (- x (* bilichi 0.003)) z))
  1484. (command "layer" "m" "dm" "c" "3""""")
  1485. )
  1486. (setq c (read-line a))
  1487. )
  1488. (PRIN1)
  1489. )
  1490. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;