loveboatcaptain Posted January 28, 2014 Share Posted January 28, 2014 I have a drawing that contains a map area to XY coordinates (MAP.dwg) I am trying to create a lisp that will create & insert a block by grabbing element info from the MAP.dwg area (using user input) to XY co-ordinates The lisp would need to open the MAP.dwg, copy elements from specified user XY co-ords, then insert as a block into the current drawing. I want the inserted block to be a consistent sized square. Can anyone help or has anyone done something similar? Quote Link to comment Share on other sites More sharing options...
pefi Posted January 28, 2014 Share Posted January 28, 2014 How far you're with the lisp? Quote Link to comment Share on other sites More sharing options...
loveboatcaptain Posted January 28, 2014 Author Share Posted January 28, 2014 I am currently using the below multiple lisps, one at a time, but want to automate it into one click. \\INSERTS UKMAP (defun C:insert_railmapuk ( ) (command "insunits" "4") (command "osmode" "0" ) (command "-layer" "set" "0" "") (command "-insert" "*UK" "0,0" "1" "0") (princ) ) \\INSERTS RAIL LOCATION MAP BOX (defun C:INSERTZZMAP ( ) (command "INSUNITS" "4") (command "-insert" "*scalemapmodel" pause "1" "0") (princ) ) \\CREATES MAP BLOCK (defun C:CREATEZZMAP ( ) (command "-BLOCK" "MAP" "Y" pause) (princ) ) \\DELETES UKMAP IGNORES MAP BLOCK (defun c:DELZZMAP (/ ss i sset e) (if (setq ss (ssget "_x" '((8 . "_ACM-BLCK-UKMAP-LANDLINE,_ACM-BLCK-UKMAP-RAIL,_ACM-BLCK-UKMAP-STATION,_ACM-BLCK-UKMAP-STATION NAME")))) (repeat (setq i (sslength ss)) (setq sset (ssname ss (setq i (1- i)))) (setq e (entget sset)) (if (not (eq (cdr (assoc 2 e))"MAP")) (entdel sset) ) ) (princ) ) (princ) ) \\SCALES MAP BLOCK IN PAPER SPACE (defun C:SCALEZZMAP ( ) (sssetfirst nil (ssget "_x" '((0 . "INSERT")(2 . "MAP")))) (command "SCALE" "p" "" "1059,397.2416" "0.01") (princ) ) \\INSERTS RED DOT (defun C:LOCATEZZMAP ( ) (command "insunits" "4") (command "osmode" "0" ) (command "-layer" "set" "0" "") (command "-insert" "*reddot" pause "1" "0") (princ) ) Quote Link to comment Share on other sites More sharing options...
BIGAL Posted January 29, 2014 Share Posted January 29, 2014 If you look into writing a script its pretty do able, just open master dwg it writes the xy to a txt file open second dwg via script block is inserted, you can do stuff like jump between dwgs code is it a bit more complex. A script can run multiple lisps one after each other. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.