乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 28|回复: 7

[编程交流] 操作系统磁贴参考

[复制链接]

33

主题

117

帖子

85

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
170
发表于 2022-7-5 18:21:37 | 显示全部楼层 |阅读模式
我的一位同事向我转发了一个lisp例程,该例程确定OS TQ平铺引用,然而,平铺引用显示在命令栏中。是否有一种方法可以在模型空间的屏幕上打印参考。
 
提供的编码如下:
 
  1. ;*** TQMAP
  2. ; prog to work which tq square is req
  3. ; the path to the tq
  4. sqs is in the prog
  5. ;if location of maps changes then this line has to change
  6. @
  7. ;***
  8. (defun C:TQ ()
  9. (command "setvar" "insunits" "0")
  10. (command "setvar"
  11. "insunitsdefsource" "0")
  12. (command "setvar" "insunitsdeftarget"
  13. "0")
  14. (graphscr)
  15. (command "expert" "5")
  16. (command "ucs" "save" "UCS1"
  17. )
  18. (command "ucs" "w" )   
  19. (setq P1 (getpoint "Pick suitable
  20. point "))    ;co ord
  21. (setq PEAST (car
  22. P1))       ;eastings
  23. (setq PNORTH (cadr
  24. P1))       ;northings
  25. (setq PEASTF (rtos
  26. PEAST 2 0))      ;conversion to string
  27. (setq
  28. PNORTHF (rtos PNORTH 2 0))     
  29. (setq
  30. TQEAST (substr PEASTF 2 2))     ;parts of
  31. coords
  32. (setq TQNORTH (substr PNORTHF 2 2))
  33. (setq TQSQ (strcat TQEAST
  34. TQNORTH))     ;name of map
  35. (setq TQEASTSQ (atoi
  36. (substr PEASTF 4 2)))
  37. (setq TQNORTHSQ (atoi (substr PNORTHF 4 2)))
  38. (if (and (<= TQEASTSQ 50)(<= TQNORTHSQ 50))
  39. (setq
  40. MAP "SW")
  41. )
  42. (if (and (<= TQEASTSQ 50)(> TQNORTHSQ 50))
  43. (setq MAP
  44. "NW")
  45. )
  46. (if (and (> TQEASTSQ 50)(<= TQNORTHSQ 50))
  47. (setq MAP
  48. "SE")
  49. )
  50. (if (and (> TQEASTSQ 50)(> TQNORTHSQ 50))
  51. (setq MAP
  52. "NE")
  53. )
  54.       ;
  55. (setq REPLY (strcat
  56. "Co-ordinates give TQ" TQSQ MAP))   
  57. (princ REPLY)
  58. (print)
  59. (setq MPATH
  60. "//Regensw2k-svr01/basemaps/1250/")    ;@  path for os
  61. maps
  62. (setq DPATH (strcat MPATH "TQ" TQSQ MAP))
  63. (command "-layer" "make" "xrefs" "")
  64. (command "-xref" "O" DPATH "0,0" ""
  65. "" "")
  66. (command "ucs" "restore" "UCS1" )
  67. (command "-LAYER" "F"
  68. "*B_PT,*E_BY,*T_BY,*BMER,*G_PT,*PL_B,*GRID,*HTPT,*R_CL" "C" "252" "*tq*" "C"
  69. "251" "*road" "C" "250" "*buildout,buildpk" "")
  70. (command "-LAYER" "F"
  71. "*8010010,*8010098,*8010321,*8010570,*8010571,*8010572,*8010573,*8010574,*8010575"
  72. "C" "252" "*G80*" "C" "251" "*8010021" "C" "250" "*8010001" "" )
  73. )
  74. ;*** TQMAP
  75. ; prog to work which tq square is req
  76. ; the path to the
  77. tq sqs is in the prog
  78. ;if location of maps changes then this line has to
  79. change @
  80. ;***
  81. (defun C:TQL ()
  82. (command "setvar" "insunits" "0")
  83. (command "setvar"
  84. "insunitsdefsource" "0")
  85. (command "setvar" "insunitsdeftarget"
  86. "0")
  87. (graphscr)
  88. (command "expert" "5")
  89. (command "ucs" "save" "UCS1"
  90. )
  91. (command "ucs" "w" )   
  92. (setq P1 (getpoint "Pick
  93. suitable point "))    ;co ord
  94. (setq PEAST (car
  95. P1))       ;eastings
  96. (setq PNORTH (cadr
  97. P1))       ;northings
  98. (setq PEASTF (rtos
  99. PEAST 2 0))      ;conversion to string
  100. (setq
  101. PNORTHF (rtos PNORTH 2 0))     
  102. (setq
  103. TQEAST (substr PEASTF 2 2))     ;parts of
  104. coords
  105. (setq TQNORTH (substr PNORTHF 2 2))
  106. (setq TQSQ (strcat TQEAST
  107. TQNORTH))     ;name of map
  108. (setq TQEASTSQ (atoi
  109. (substr PEASTF 4 2)))
  110. (setq TQNORTHSQ (atoi (substr PNORTHF 4 2)))
  111. (if (and (<= TQEASTSQ 50)(<= TQNORTHSQ 50))
  112. (setq
  113. MAP "SW")
  114. )
  115. (if (and (<= TQEASTSQ 50)(> TQNORTHSQ 50))
  116. (setq MAP
  117. "NW")
  118. )
  119. (if (and (> TQEASTSQ 50)(<= TQNORTHSQ 50))
  120. (setq MAP
  121. "SE")
  122. )
  123. (if (and (> TQEASTSQ 50)(> TQNORTHSQ 50))
  124. (setq MAP
  125. "NE")
  126. )
  127.       ;
  128. (setq REPLY (strcat
  129. "Co-ordinates give TQ" TQSQ MAP))
  130. (princ REPLY)
  131. (print)
  132. (setq MPATH
  133. "P:/CGG/CAD/Data/Mapping/LBI/TQ-May2005/")    ;@  path
  134. for os maps
  135. (setq DPATH (strcat MPATH "TQ" TQSQ MAP))
  136. (command "-layer" "make" "xrefs" "")
  137. (command "-xref" "O" DPATH "0,0" ""
  138. "" "")
  139. (command "ucs" "restore" "UCS1" )
  140. (command "-LAYER" "F"
  141. "*B_PT,*E_BY,*T_BY,*BMER,*G_PT,*PL_B,*GRID,*HTPT,*R_CL" "C" "252" "*tq*" "C"
  142. "251" "*road" "C" "250" "*buildout,buildpk" "")
  143. (command "-LAYER" "F"
  144. "*8010010,*8010098,*8010321,*8010570,*8010571,*8010572,*8010573,*8010574,*8010575"
  145. "C" "252" "*G80*" "C" "251" "*8010021" "C" "250" "*8010001" "" )
  146. (command "expert" "0")
  147. )
  148. ;*** TQMAP
  149. ; prog to work which tq square is req
  150. ; the path to the
  151. tq sqs is in the prog
  152. ;if location of maps changes then this line has to
  153. change @
  154. ;***
  155. (defun C:TQQl ()
  156. (command "setvar" "insunits" "0")
  157. (command "setvar"
  158. "insunitsdefsource" "0")
  159. (command "setvar" "insunitsdeftarget"
  160. "0")
  161. (graphscr)
  162. (COMMAND "UCS" "W")
  163. (SETQ TQ (getstring "\n TQ NUMBER ?
  164. "))     ;eastings
  165.    
  166. (setq MPATH
  167. "P:/CGG/CAD/Data/Mapping/LBI/TQ-May2005/")    ;@  path
  168. for os maps
  169. (setq DPATH (strcat MPATH TQ))
  170. (command "-layer" "make" "xrefs" "")
  171. (command "-xref" "O" DPATH "0,0" ""
  172. "" "")
  173. (COMMAND "UCS" "P")
  174. )
  175. ;*** TQMAP
  176. ; prog to work which tq square is req
  177. ; the path to the
  178. tq sqs is in the prog
  179. ;if location of maps changes then this line has to
  180. change @
  181. ;***
  182. (defun C:TQQ ()
  183. (command "setvar" "insunits" "0")
  184. (command "setvar"
  185. "insunitsdefsource" "0")
  186. (command "setvar" "insunitsdeftarget"
  187. "0")
  188. (graphscr)
  189. (COMMAND "UCS" "W")
  190. (SETQ TQ (getstring "\n TQ NUMBER ?
  191. "))     ;eastings
  192. (setq MPATH
  193. "P:/CGG/CAD/Resources/OS-Data/")    ;@  path for os
  194. maps
  195. (setq DPATH (strcat MPATH TQ))
  196. (command "-layer" "make" "xrefs" "")
  197. (command "-xref" "O" DPATH "0,0" ""
  198. "" "")
  199. (COMMAND "UCS" "P")
  200. (command "-LAYER" "F"
  201. "*B_PT,*E_BY,*T_BY,*BMER,*G_PT,*PL_B,*GRID,*HTPT,*R_CL" "C" "253" "*tq*" "C"
  202. "252" "*road" "")
  203. (command "-LAYER" "F"
  204. "*8010010,*8010098,*8010321,*8010570,*8010571,*8010572,*8010573,*8010574,*8010575"
  205. "C" "253" "*G80*" "C" "251" "*8010021" "")
  206. )

 
 
谢谢你们的帮助。
回复

使用道具 举报

2

主题

53

帖子

57

银币

初来乍到

Rank: 1

铜币
14
发表于 2022-7-5 18:34:17 | 显示全部楼层
这是怎么回事?
  1. ;;;http://www.cadtutor.net/forum/showthread.php?94664-OS-tile-references
  2. ;*** TQMAP
  3. ; prog to work which tq square is req
  4. ; the path to the tq
  5. sqs is in the prog
  6. ;if location of maps changes then this line has to change
  7. @
  8. ;***
  9. (defun C:TQ ()
  10. (command "setvar" "insunits" "0")
  11. (command "setvar"
  12. "insunitsdefsource" "0")
  13. (command "setvar" "insunitsdeftarget"
  14. "0")
  15. (graphscr)
  16. (command "expert" "5")
  17. (command "ucs" "save" "UCS1"
  18. )
  19. (command "ucs" "w" )   
  20. (setq P1 (getpoint "Pick suitable
  21. point "))    ;co ord
  22. (setq PEAST (car
  23. P1))       ;eastings
  24. (setq PNORTH (cadr
  25. P1))       ;northings
  26. (setq PEASTF (rtos
  27. PEAST 2 0))      ;conversion to string
  28. (setq
  29. PNORTHF (rtos PNORTH 2 0))     
  30. (setq
  31. TQEAST (substr PEASTF 2 2))     ;parts of
  32. coords
  33. (setq TQNORTH (substr PNORTHF 2 2))
  34. (setq TQSQ (strcat TQEAST
  35. TQNORTH))     ;name of map
  36. (setq TQEASTSQ (atoi
  37. (substr PEASTF 4 2)))
  38. (setq TQNORTHSQ (atoi (substr PNORTHF 4 2)))
  39. (if (and (<= TQEASTSQ 50)(<= TQNORTHSQ 50))
  40. (setq
  41. MAP "SW")
  42. )
  43. (if (and (<= TQEASTSQ 50)(> TQNORTHSQ 50))
  44. (setq MAP
  45. "NW")
  46. )
  47. (if (and (> TQEASTSQ 50)(<= TQNORTHSQ 50))
  48. (setq MAP
  49. "SE")
  50. )
  51. (if (and (> TQEASTSQ 50)(> TQNORTHSQ 50))
  52. (setq MAP
  53. "NE")
  54. )
  55.       ;
  56. (setq REPLY (strcat
  57. "Co-ordinates give TQ" TQSQ MAP))   
  58. (princ REPLY)
  59. (print)
  60. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  PB - Metrix 2015
  61. (SETQ DFLT 0)
  62. (SETQ TXTHG (GETVAR "textsize"))
  63. (PRINC "\nText Height: <")
  64. (PRIN1 TXTHG)
  65. (PRINC ">: ")
  66. (SETQ THGT (GETDIST))
  67. (IF (= THGT nil)
  68. (SETQ THGT TXTHG)
  69. )
  70. ; (SETQ PTXT (GETPOINT "\nLocate Text: "))
  71. (setq old_layer (getvar "clayer")); Get current Layer
  72. (SETVAR "cmdecho" 0)
  73. ;(setq PTXT (getvar "viewctr"))
  74. (COMMAND "layer" "se" "text" "")
  75. (COMMAND "text" P1 THGT "" REPLY)
  76. (command "move" "last" "" PTXT pause)
  77. (command "_layer" "S" old_layer ""); reset Layer
  78. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  79. (setq MPATH
  80. "//Regensw2k-svr01/basemaps/1250/")    ;@  path for os
  81. maps
  82. (setq DPATH (strcat MPATH "TQ" TQSQ MAP))
  83. (command "-layer" "make" "xrefs" "")
  84. (command "-xref" "O" DPATH "0,0" ""
  85. "" "")
  86. (command "ucs" "restore" "UCS1" )
  87. (command "-LAYER" "F"
  88. "*B_PT,*E_BY,*T_BY,*BMER,*G_PT,*PL_B,*GRID,*HTPT,*R_CL" "C" "252" "*tq*" "C"
  89. "251" "*road" "C" "250" "*buildout,buildpk" "")
  90. (command "-LAYER" "F"
  91. "*8010010,*8010098,*8010321,*8010570,*8010571,*8010572,*8010573,*8010574,*8010575"
  92. "C" "252" "*G80*" "C" "251" "*8010021" "C" "250" "*8010001" "" )
  93. )
  94. ;*** TQMAP
  95. ; prog to work which tq square is req
  96. ; the path to the
  97. tq sqs is in the prog
  98. ;if location of maps changes then this line has to
  99. change @
  100. ;***
  101. (defun C:TQL ()
  102. (command "setvar" "insunits" "0")
  103. (command "setvar"
  104. "insunitsdefsource" "0")
  105. (command "setvar" "insunitsdeftarget"
  106. "0")
  107. (graphscr)
  108. (command "expert" "5")
  109. (command "ucs" "save" "UCS1"
  110. )
  111. (command "ucs" "w" )   
  112. (setq P1 (getpoint "Pick
  113. suitable point "))    ;co ord
  114. (setq PEAST (car
  115. P1))       ;eastings
  116. (setq PNORTH (cadr
  117. P1))       ;northings
  118. (setq PEASTF (rtos
  119. PEAST 2 0))      ;conversion to string
  120. (setq
  121. PNORTHF (rtos PNORTH 2 0))     
  122. (setq
  123. TQEAST (substr PEASTF 2 2))     ;parts of
  124. coords
  125. (setq TQNORTH (substr PNORTHF 2 2))
  126. (setq TQSQ (strcat TQEAST
  127. TQNORTH))     ;name of map
  128. (setq TQEASTSQ (atoi
  129. (substr PEASTF 4 2)))
  130. (setq TQNORTHSQ (atoi (substr PNORTHF 4 2)))
  131. (if (and (<= TQEASTSQ 50)(<= TQNORTHSQ 50))
  132. (setq
  133. MAP "SW")
  134. )
  135. (if (and (<= TQEASTSQ 50)(> TQNORTHSQ 50))
  136. (setq MAP
  137. "NW")
  138. )
  139. (if (and (> TQEASTSQ 50)(<= TQNORTHSQ 50))
  140. (setq MAP
  141. "SE")
  142. )
  143. (if (and (> TQEASTSQ 50)(> TQNORTHSQ 50))
  144. (setq MAP
  145. "NE")
  146. )
  147.       ;
  148. (setq REPLY (strcat
  149. "Co-ordinates give TQ" TQSQ MAP))
  150. (princ REPLY)
  151. (print)
  152. (setq MPATH
  153. "P:/CGG/CAD/Data/Mapping/LBI/TQ-May2005/")    ;@  path
  154. for os maps
  155. (setq DPATH (strcat MPATH "TQ" TQSQ MAP))
  156. (command "-layer" "make" "xrefs" "")
  157. (command "-xref" "O" DPATH "0,0" ""
  158. "" "")
  159. (command "ucs" "restore" "UCS1" )
  160. (command "-LAYER" "F"
  161. "*B_PT,*E_BY,*T_BY,*BMER,*G_PT,*PL_B,*GRID,*HTPT,*R_CL" "C" "252" "*tq*" "C"
  162. "251" "*road" "C" "250" "*buildout,buildpk" "")
  163. (command "-LAYER" "F"
  164. "*8010010,*8010098,*8010321,*8010570,*8010571,*8010572,*8010573,*8010574,*8010575"
  165. "C" "252" "*G80*" "C" "251" "*8010021" "C" "250" "*8010001" "" )
  166. (command "expert" "0")
  167. )
  168. ;*** TQMAP
  169. ; prog to work which tq square is req
  170. ; the path to the
  171. tq sqs is in the prog
  172. ;if location of maps changes then this line has to
  173. change @
  174. ;***
  175. (defun C:TQQl ()
  176. (command "setvar" "insunits" "0")
  177. (command "setvar"
  178. "insunitsdefsource" "0")
  179. (command "setvar" "insunitsdeftarget"
  180. "0")
  181. (graphscr)
  182. (COMMAND "UCS" "W")
  183. (SETQ TQ (getstring "\n TQ NUMBER ?
  184. "))     ;eastings
  185.    
  186. (setq MPATH
  187. "P:/CGG/CAD/Data/Mapping/LBI/TQ-May2005/")    ;@  path
  188. for os maps
  189. (setq DPATH (strcat MPATH TQ))
  190. (command "-layer" "make" "xrefs" "")
  191. (command "-xref" "O" DPATH "0,0" ""
  192. "" "")
  193. (COMMAND "UCS" "P")
  194. )
  195. ;*** TQMAP
  196. ; prog to work which tq square is req
  197. ; the path to the
  198. tq sqs is in the prog
  199. ;if location of maps changes then this line has to
  200. change @
  201. ;***
  202. (defun C:TQQ ()
  203. (command "setvar" "insunits" "0")
  204. (command "setvar"
  205. "insunitsdefsource" "0")
  206. (command "setvar" "insunitsdeftarget"
  207. "0")
  208. (graphscr)
  209. (COMMAND "UCS" "W")
  210. (SETQ TQ (getstring "\n TQ NUMBER ?
  211. "))     ;eastings
  212. (setq MPATH
  213. "P:/CGG/CAD/Resources/OS-Data/")    ;@  path for os
  214. maps
  215. (setq DPATH (strcat MPATH TQ))
  216. (command "-layer" "make" "xrefs" "")
  217. (command "-xref" "O" DPATH "0,0" ""
  218. "" "")
  219. (COMMAND "UCS" "P")
  220. (command "-LAYER" "F"
  221. "*B_PT,*E_BY,*T_BY,*BMER,*G_PT,*PL_B,*GRID,*HTPT,*R_CL" "C" "253" "*tq*" "C"
  222. "252" "*road" "")
  223. (command "-LAYER" "F"
  224. "*8010010,*8010098,*8010321,*8010570,*8010571,*8010572,*8010573,*8010574,*8010575"
  225. "C" "253" "*G80*" "C" "251" "*8010021" "")
  226. )
回复

使用道具 举报

2

主题

53

帖子

57

银币

初来乍到

Rank: 1

铜币
14
发表于 2022-7-5 18:45:44 | 显示全部楼层
你有一个Lisp程序的其他瓷砖吗?
P
回复

使用道具 举报

33

主题

117

帖子

85

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
170
发表于 2022-7-5 18:50:53 | 显示全部楼层
嗨,至少,
 
不过,只要稍微修改一下,就需要一个箭头来指向单击的位置。文本可以是带arial字体的多行文本吗?
 
谢谢
回复

使用道具 举报

33

主题

117

帖子

85

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
170
发表于 2022-7-5 18:57:58 | 显示全部楼层
我目前没有访问任何其他瓷砖以外的TQ瓷砖,然而,当我今晚回家时,我应该可以访问英国各地的其他瓷砖,我会试试,并让你知道结果。
回复

使用道具 举报

2

主题

53

帖子

57

银币

初来乍到

Rank: 1

铜币
14
发表于 2022-7-5 19:09:59 | 显示全部楼层
唯一可行的方法是制作一个属性块并将其插入到“P1”中,属性包含变量“REPLY”。
 
也许有人会来,我现在有点忙。
 
P
回复

使用道具 举报

33

主题

117

帖子

85

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
170
发表于 2022-7-5 19:18:44 | 显示全部楼层
嗨,至少,
 
尝试使用这些坐标548237099194,这是一个位于南部靠近海岸的Seaford。它在屏幕上显示坐标,得到TQ4891NW,而使用英国网格查找器,得到“TV 48237 99194”,因此TQ的值随TV而变化。因此,这个Lisp程序虽然可以说是伦敦地区,但它并没有覆盖整个英国。我将尝试获得每个TQ、TV或T的转角坐标?然后从那里拿走。
 
谢谢你的帮助。
回复

使用道具 举报

8

主题

1133

帖子

1164

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-5 19:29:52 | 显示全部楼层
您使用的lisp程序超出了其引用的参数。它的标题仅适用于TQ互动程序,因此您不应该期望它为您提供电视互动程序
 
如果您查看工作,它期望北距为六个有效数字,而您的示例只有五个有效数字(前导零不是有效数字),因此难怪它会给出意外的结果。
 
操作系统有一个很好的在线瓷砖查找器
192143uzt2v73cytllfqqu.png
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-12 19:39 , Processed in 0.497784 second(s), 70 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表