操作系统磁贴参考
我的一位同事向我转发了一个lisp例程,该例程确定OS TQ平铺引用,然而,平铺引用显示在命令栏中。是否有一种方法可以在模型空间的屏幕上打印参考。提供的编码如下:
;*** TQMAP
; prog to work which tq square is req
; the path to the tq
sqs is in the prog
;if location of maps changes then this line has to change
@
;***
(defun C:TQ ()
(command "setvar" "insunits" "0")
(command "setvar"
"insunitsdefsource" "0")
(command "setvar" "insunitsdeftarget"
"0")
(graphscr)
(command "expert" "5")
(command "ucs" "save" "UCS1"
)
(command "ucs" "w" )
(setq P1 (getpoint "Pick suitable
point ")) ;co ord
(setq PEAST (car
P1)) ;eastings
(setq PNORTH (cadr
P1)) ;northings
(setq PEASTF (rtos
PEAST 2 0)) ;conversion to string
(setq
PNORTHF (rtos PNORTH 2 0))
(setq
TQEAST (substr PEASTF 2 2)) ;parts of
coords
(setq TQNORTH (substr PNORTHF 2 2))
(setq TQSQ (strcat TQEAST
TQNORTH)) ;name of map
(setq TQEASTSQ (atoi
(substr PEASTF 4 2)))
(setq TQNORTHSQ (atoi (substr PNORTHF 4 2)))
(if (and (<= TQEASTSQ 50)(<= TQNORTHSQ 50))
(setq
MAP "SW")
)
(if (and (<= TQEASTSQ 50)(> TQNORTHSQ 50))
(setq MAP
"NW")
)
(if (and (> TQEASTSQ 50)(<= TQNORTHSQ 50))
(setq MAP
"SE")
)
(if (and (> TQEASTSQ 50)(> TQNORTHSQ 50))
(setq MAP
"NE")
)
;
(setq REPLY (strcat
"Co-ordinates give TQ" TQSQ MAP))
(princ REPLY)
(print)
(setq MPATH
"//Regensw2k-svr01/basemaps/1250/") ;@path for os
maps
(setq DPATH (strcat MPATH "TQ" TQSQ MAP))
(command "-layer" "make" "xrefs" "")
(command "-xref" "O" DPATH "0,0" ""
"" "")
(command "ucs" "restore" "UCS1" )
(command "-LAYER" "F"
"*B_PT,*E_BY,*T_BY,*BMER,*G_PT,*PL_B,*GRID,*HTPT,*R_CL" "C" "252" "*tq*" "C"
"251" "*road" "C" "250" "*buildout,buildpk" "")
(command "-LAYER" "F"
"*8010010,*8010098,*8010321,*8010570,*8010571,*8010572,*8010573,*8010574,*8010575"
"C" "252" "*G80*" "C" "251" "*8010021" "C" "250" "*8010001" "" )
)
;*** TQMAP
; prog to work which tq square is req
; the path to the
tq sqs is in the prog
;if location of maps changes then this line has to
change @
;***
(defun C:TQL ()
(command "setvar" "insunits" "0")
(command "setvar"
"insunitsdefsource" "0")
(command "setvar" "insunitsdeftarget"
"0")
(graphscr)
(command "expert" "5")
(command "ucs" "save" "UCS1"
)
(command "ucs" "w" )
(setq P1 (getpoint "Pick
suitable point ")) ;co ord
(setq PEAST (car
P1)) ;eastings
(setq PNORTH (cadr
P1)) ;northings
(setq PEASTF (rtos
PEAST 2 0)) ;conversion to string
(setq
PNORTHF (rtos PNORTH 2 0))
(setq
TQEAST (substr PEASTF 2 2)) ;parts of
coords
(setq TQNORTH (substr PNORTHF 2 2))
(setq TQSQ (strcat TQEAST
TQNORTH)) ;name of map
(setq TQEASTSQ (atoi
(substr PEASTF 4 2)))
(setq TQNORTHSQ (atoi (substr PNORTHF 4 2)))
(if (and (<= TQEASTSQ 50)(<= TQNORTHSQ 50))
(setq
MAP "SW")
)
(if (and (<= TQEASTSQ 50)(> TQNORTHSQ 50))
(setq MAP
"NW")
)
(if (and (> TQEASTSQ 50)(<= TQNORTHSQ 50))
(setq MAP
"SE")
)
(if (and (> TQEASTSQ 50)(> TQNORTHSQ 50))
(setq MAP
"NE")
)
;
(setq REPLY (strcat
"Co-ordinates give TQ" TQSQ MAP))
(princ REPLY)
(print)
(setq MPATH
"P:/CGG/CAD/Data/Mapping/LBI/TQ-May2005/") ;@path
for os maps
(setq DPATH (strcat MPATH "TQ" TQSQ MAP))
(command "-layer" "make" "xrefs" "")
(command "-xref" "O" DPATH "0,0" ""
"" "")
(command "ucs" "restore" "UCS1" )
(command "-LAYER" "F"
"*B_PT,*E_BY,*T_BY,*BMER,*G_PT,*PL_B,*GRID,*HTPT,*R_CL" "C" "252" "*tq*" "C"
"251" "*road" "C" "250" "*buildout,buildpk" "")
(command "-LAYER" "F"
"*8010010,*8010098,*8010321,*8010570,*8010571,*8010572,*8010573,*8010574,*8010575"
"C" "252" "*G80*" "C" "251" "*8010021" "C" "250" "*8010001" "" )
(command "expert" "0")
)
;*** TQMAP
; prog to work which tq square is req
; the path to the
tq sqs is in the prog
;if location of maps changes then this line has to
change @
;***
(defun C:TQQl ()
(command "setvar" "insunits" "0")
(command "setvar"
"insunitsdefsource" "0")
(command "setvar" "insunitsdeftarget"
"0")
(graphscr)
(COMMAND "UCS" "W")
(SETQ TQ (getstring "\n TQ NUMBER ?
")) ;eastings
(setq MPATH
"P:/CGG/CAD/Data/Mapping/LBI/TQ-May2005/") ;@path
for os maps
(setq DPATH (strcat MPATH TQ))
(command "-layer" "make" "xrefs" "")
(command "-xref" "O" DPATH "0,0" ""
"" "")
(COMMAND "UCS" "P")
)
;*** TQMAP
; prog to work which tq square is req
; the path to the
tq sqs is in the prog
;if location of maps changes then this line has to
change @
;***
(defun C:TQQ ()
(command "setvar" "insunits" "0")
(command "setvar"
"insunitsdefsource" "0")
(command "setvar" "insunitsdeftarget"
"0")
(graphscr)
(COMMAND "UCS" "W")
(SETQ TQ (getstring "\n TQ NUMBER ?
")) ;eastings
(setq MPATH
"P:/CGG/CAD/Resources/OS-Data/") ;@path for os
maps
(setq DPATH (strcat MPATH TQ))
(command "-layer" "make" "xrefs" "")
(command "-xref" "O" DPATH "0,0" ""
"" "")
(COMMAND "UCS" "P")
(command "-LAYER" "F"
"*B_PT,*E_BY,*T_BY,*BMER,*G_PT,*PL_B,*GRID,*HTPT,*R_CL" "C" "253" "*tq*" "C"
"252" "*road" "")
(command "-LAYER" "F"
"*8010010,*8010098,*8010321,*8010570,*8010571,*8010572,*8010573,*8010574,*8010575"
"C" "253" "*G80*" "C" "251" "*8010021" "")
)
谢谢你们的帮助。 这是怎么回事?
;;;http://www.cadtutor.net/forum/showthread.php?94664-OS-tile-references
;*** TQMAP
; prog to work which tq square is req
; the path to the tq
sqs is in the prog
;if location of maps changes then this line has to change
@
;***
(defun C:TQ ()
(command "setvar" "insunits" "0")
(command "setvar"
"insunitsdefsource" "0")
(command "setvar" "insunitsdeftarget"
"0")
(graphscr)
(command "expert" "5")
(command "ucs" "save" "UCS1"
)
(command "ucs" "w" )
(setq P1 (getpoint "Pick suitable
point ")) ;co ord
(setq PEAST (car
P1)) ;eastings
(setq PNORTH (cadr
P1)) ;northings
(setq PEASTF (rtos
PEAST 2 0)) ;conversion to string
(setq
PNORTHF (rtos PNORTH 2 0))
(setq
TQEAST (substr PEASTF 2 2)) ;parts of
coords
(setq TQNORTH (substr PNORTHF 2 2))
(setq TQSQ (strcat TQEAST
TQNORTH)) ;name of map
(setq TQEASTSQ (atoi
(substr PEASTF 4 2)))
(setq TQNORTHSQ (atoi (substr PNORTHF 4 2)))
(if (and (<= TQEASTSQ 50)(<= TQNORTHSQ 50))
(setq
MAP "SW")
)
(if (and (<= TQEASTSQ 50)(> TQNORTHSQ 50))
(setq MAP
"NW")
)
(if (and (> TQEASTSQ 50)(<= TQNORTHSQ 50))
(setq MAP
"SE")
)
(if (and (> TQEASTSQ 50)(> TQNORTHSQ 50))
(setq MAP
"NE")
)
;
(setq REPLY (strcat
"Co-ordinates give TQ" TQSQ MAP))
(princ REPLY)
(print)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;PB - Metrix 2015
(SETQ DFLT 0)
(SETQ TXTHG (GETVAR "textsize"))
(PRINC "\nText Height: <")
(PRIN1 TXTHG)
(PRINC ">: ")
(SETQ THGT (GETDIST))
(IF (= THGT nil)
(SETQ THGT TXTHG)
)
; (SETQ PTXT (GETPOINT "\nLocate Text: "))
(setq old_layer (getvar "clayer")); Get current Layer
(SETVAR "cmdecho" 0)
;(setq PTXT (getvar "viewctr"))
(COMMAND "layer" "se" "text" "")
(COMMAND "text" P1 THGT "" REPLY)
(command "move" "last" "" PTXT pause)
(command "_layer" "S" old_layer ""); reset Layer
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq MPATH
"//Regensw2k-svr01/basemaps/1250/") ;@path for os
maps
(setq DPATH (strcat MPATH "TQ" TQSQ MAP))
(command "-layer" "make" "xrefs" "")
(command "-xref" "O" DPATH "0,0" ""
"" "")
(command "ucs" "restore" "UCS1" )
(command "-LAYER" "F"
"*B_PT,*E_BY,*T_BY,*BMER,*G_PT,*PL_B,*GRID,*HTPT,*R_CL" "C" "252" "*tq*" "C"
"251" "*road" "C" "250" "*buildout,buildpk" "")
(command "-LAYER" "F"
"*8010010,*8010098,*8010321,*8010570,*8010571,*8010572,*8010573,*8010574,*8010575"
"C" "252" "*G80*" "C" "251" "*8010021" "C" "250" "*8010001" "" )
)
;*** TQMAP
; prog to work which tq square is req
; the path to the
tq sqs is in the prog
;if location of maps changes then this line has to
change @
;***
(defun C:TQL ()
(command "setvar" "insunits" "0")
(command "setvar"
"insunitsdefsource" "0")
(command "setvar" "insunitsdeftarget"
"0")
(graphscr)
(command "expert" "5")
(command "ucs" "save" "UCS1"
)
(command "ucs" "w" )
(setq P1 (getpoint "Pick
suitable point ")) ;co ord
(setq PEAST (car
P1)) ;eastings
(setq PNORTH (cadr
P1)) ;northings
(setq PEASTF (rtos
PEAST 2 0)) ;conversion to string
(setq
PNORTHF (rtos PNORTH 2 0))
(setq
TQEAST (substr PEASTF 2 2)) ;parts of
coords
(setq TQNORTH (substr PNORTHF 2 2))
(setq TQSQ (strcat TQEAST
TQNORTH)) ;name of map
(setq TQEASTSQ (atoi
(substr PEASTF 4 2)))
(setq TQNORTHSQ (atoi (substr PNORTHF 4 2)))
(if (and (<= TQEASTSQ 50)(<= TQNORTHSQ 50))
(setq
MAP "SW")
)
(if (and (<= TQEASTSQ 50)(> TQNORTHSQ 50))
(setq MAP
"NW")
)
(if (and (> TQEASTSQ 50)(<= TQNORTHSQ 50))
(setq MAP
"SE")
)
(if (and (> TQEASTSQ 50)(> TQNORTHSQ 50))
(setq MAP
"NE")
)
;
(setq REPLY (strcat
"Co-ordinates give TQ" TQSQ MAP))
(princ REPLY)
(print)
(setq MPATH
"P:/CGG/CAD/Data/Mapping/LBI/TQ-May2005/") ;@path
for os maps
(setq DPATH (strcat MPATH "TQ" TQSQ MAP))
(command "-layer" "make" "xrefs" "")
(command "-xref" "O" DPATH "0,0" ""
"" "")
(command "ucs" "restore" "UCS1" )
(command "-LAYER" "F"
"*B_PT,*E_BY,*T_BY,*BMER,*G_PT,*PL_B,*GRID,*HTPT,*R_CL" "C" "252" "*tq*" "C"
"251" "*road" "C" "250" "*buildout,buildpk" "")
(command "-LAYER" "F"
"*8010010,*8010098,*8010321,*8010570,*8010571,*8010572,*8010573,*8010574,*8010575"
"C" "252" "*G80*" "C" "251" "*8010021" "C" "250" "*8010001" "" )
(command "expert" "0")
)
;*** TQMAP
; prog to work which tq square is req
; the path to the
tq sqs is in the prog
;if location of maps changes then this line has to
change @
;***
(defun C:TQQl ()
(command "setvar" "insunits" "0")
(command "setvar"
"insunitsdefsource" "0")
(command "setvar" "insunitsdeftarget"
"0")
(graphscr)
(COMMAND "UCS" "W")
(SETQ TQ (getstring "\n TQ NUMBER ?
")) ;eastings
(setq MPATH
"P:/CGG/CAD/Data/Mapping/LBI/TQ-May2005/") ;@path
for os maps
(setq DPATH (strcat MPATH TQ))
(command "-layer" "make" "xrefs" "")
(command "-xref" "O" DPATH "0,0" ""
"" "")
(COMMAND "UCS" "P")
)
;*** TQMAP
; prog to work which tq square is req
; the path to the
tq sqs is in the prog
;if location of maps changes then this line has to
change @
;***
(defun C:TQQ ()
(command "setvar" "insunits" "0")
(command "setvar"
"insunitsdefsource" "0")
(command "setvar" "insunitsdeftarget"
"0")
(graphscr)
(COMMAND "UCS" "W")
(SETQ TQ (getstring "\n TQ NUMBER ?
")) ;eastings
(setq MPATH
"P:/CGG/CAD/Resources/OS-Data/") ;@path for os
maps
(setq DPATH (strcat MPATH TQ))
(command "-layer" "make" "xrefs" "")
(command "-xref" "O" DPATH "0,0" ""
"" "")
(COMMAND "UCS" "P")
(command "-LAYER" "F"
"*B_PT,*E_BY,*T_BY,*BMER,*G_PT,*PL_B,*GRID,*HTPT,*R_CL" "C" "253" "*tq*" "C"
"252" "*road" "")
(command "-LAYER" "F"
"*8010010,*8010098,*8010321,*8010570,*8010571,*8010572,*8010573,*8010574,*8010575"
"C" "253" "*G80*" "C" "251" "*8010021" "")
) 你有一个Lisp程序的其他瓷砖吗?
P 嗨,至少,
不过,只要稍微修改一下,就需要一个箭头来指向单击的位置。文本可以是带arial字体的多行文本吗?
谢谢 我目前没有访问任何其他瓷砖以外的TQ瓷砖,然而,当我今晚回家时,我应该可以访问英国各地的其他瓷砖,我会试试,并让你知道结果。 唯一可行的方法是制作一个属性块并将其插入到“P1”中,属性包含变量“REPLY”。
也许有人会来,我现在有点忙。
P 嗨,至少,
尝试使用这些坐标548237099194,这是一个位于南部靠近海岸的Seaford。它在屏幕上显示坐标,得到TQ4891NW,而使用英国网格查找器,得到“TV 48237 99194”,因此TQ的值随TV而变化。因此,这个Lisp程序虽然可以说是伦敦地区,但它并没有覆盖整个英国。我将尝试获得每个TQ、TV或T的转角坐标?然后从那里拿走。
谢谢你的帮助。 您使用的lisp程序超出了其引用的参数。它的标题仅适用于TQ互动程序,因此您不应该期望它为您提供电视互动程序
如果您查看工作,它期望北距为六个有效数字,而您的示例只有五个有效数字(前导零不是有效数字),因此难怪它会给出意外的结果。
操作系统有一个很好的在线瓷砖查找器
页:
[1]