Jump to content

Inserting OS tiles using lisp routine


Baber62

Recommended Posts

This routine was functional a couple of weeks ago. Now it's giving me the following error:

 

*Invalid*

; error: Function cancelled

 

I have tried changing the path of where the OS tiles are stored but nothing seems to be working. I would appreciate if someone could look into this.

 

(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 "\nPick 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 "D:/LB SOUTHWARK/Southwark CAD files/Latest 500m2 tiles")

;"//lbs-spatial01/spatialdata/Mapping/Raw_Data/OS MasterMap/Southwark and environs coverage/DWG/Latest 500m2 tiles/")    ;@  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")


)

Link to comment
Share on other sites

Thanks Roy_043 that did the trick.

 

Changed the following line:

 

(setq MPATH "D:/LB SOUTHWARK/Southwark CAD files/Latest 500m2 tiles")

 

to

 

(setq MPATH "D:/LB SOUTHWARK/Southwark CAD files/Latest 500m2 tiles/")

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...