Placing a block on top of selected points

John Cutler

Usenet Archive
Joined
Dec 16, 2003
Messages
14
Reaction score
0
Hi, all --

I'm working with A2K Map, Win2000Pro....

I download GPS Lat/Long waypoints gathered in the field and, with another piece of software, create a script file (.scr) to plot them all on a layer (named something like "waypoints" and set current), as in:

_point
-94.59766,37.32756
_point
-94.59710,37.32750
_point
-94.59473,37.32734
_point
-94.59872,37.32577

I'm looking for a LISP routine that I can attach to a custom toolbar button which will allow the following process:

(a) create a layer (e.g., "waypoint symbols") to hold the symbols (see below) and make it current. I can do this prior to starting the LISP routine.

(b) select all the waypoint points with quickselect or whatever (the points can be selected before starting the LISP routine or as part of the routine)

(c) place a selected symbol (block) on top of each point, snapping the block's insertion point to each drawn point. The routine would open the path to all my blocks ("c:\orlt\related\mapping\" is the folder that opens when I click on Insert Block). The block can be selected on the fly.

(d) when the routine is completed, I can turn off the "waypoints" layer and leave the "waypoints symbols" layer on.

Anybody know of a routine that will do this?

Thanks,

John

)))))))
(o)-(o)
-----oo0---(_)---0oo--------------------------
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |

John Cutler -- Mapping/GIS Director,
Ozark Regional Land Trust
(Ozark Bioregion - MO/AR/KS/OK)
2435 Sweetwater Lane
Mansfield MO 65704
(417) 741-7363
 
This is untested but it should work.
The only thing you can't do is select the block.
It will have to be decided on before the routine starts.

Use:
(insblks <WAYPOINTS LAYER NAME> <DESIRED BLOCKNAME>)

(defun insblks (layname blkname / ss cnt clayer)
(setq clayer (getvar "clayer"))
;; (a) create a layer (e.g., "waypoint symbols") to hold the symbols (see ;; below) and make it current. I can do this prior to starting the LISP ;; routine (command ".layer" "m" "waypoint symbols" "")

;; (b) select all the waypoint points with quickselect or whatever (the points ;; can be selected before starting the LISP routine or as part of the routine) (setq ss (ssget "x" (list (cons 0 "POINT") (cons 8 layname)))) (setq ss (if ss ss (ssadd)))
(setq cnt 0)

;; (c) place a selected symbol (block) on top of each point, snapping the ;; block's insertion point to each drawn point. The routine would open the path ;; to all my blocks ("c:\orlt\related\mapping\" is the folder that opens when ;; I click on Insert Block). The block can be selected on the fly. ;; THE BLOCK CANNOT BE SELECTED ON THE FLY. ;; IT MUST BE ENTERED WITH THE COMMAND (repeat (sslength ss) (command ".insert" blkname (cdr (assoc 10 (entget (ssname ss cnt)))) "" "" "") (setq cnt (1+ cnt))
);end repeat

;; (d) when the routine is completed, I can turn off the "waypoints" layer and ;; leave the "waypoints symbols" layer on. (if (not (= clayer layname)) (command ".layer" "off" layname ""))

(setvar "clayer" clayer)
(princ)
)
 
Jim --

Thanks for the routine -- I'll try it out.

John

)))))))
(o)-(o)
-----oo0---(_)---0oo--------------------------
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |

John Cutler -- Mapping/GIS Director,
Ozark Regional Land Trust
(Ozark Bioregion - MO/AR/KS/OK)
2435 Sweetwater Lane
Mansfield MO 65704
(417) 741-7363
 
could you edit the script file to replace
_point
-94.59766,37.32756

with

_insert
<blockname>
-94.59766,37.32756
<x scale>
<y scale>
<rotation>
_point
@

cheers
Steve
 

Latest threads

Back
Top