I use the following to be able to enter pline coordinates into any drawing regardless of the coordinate system and datum used. It saves having to query in to translate from one coord system to another. However it is ugly. Is there a way to eliminate the pline prompts from the command line? Also, is there a way to disable the on screen pick?
Command: TRANSFORM
Enter a point: -104,55
pline
Specify start point:
Current line-width is 0.0000
Specify next point or [Arc/Halfwidth/Length/Undo/Width]:
Next point:
;;; Usage: To draw a lwpline using any coordinate format by
;;; transforming the data to the current coordinate
;;; system.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun c:transform (/ *error* coord inputcrdsys
categories systems dialogshow category
)
(vl-load-com)
(setq categories (ade_projlistctgy))
(setq systems (ade_projlistcrdsysts (car categories)))
(setq dialogshow T) ;set flag
(setq transform_dcl_id (load_dialog "transform.dcl"))
;initialise dialog box
(if transform_dcl_id ;check dcl exists
(new_dialog "transform" transform_dcl_id) ;load into memory
(setq dialogshow nil) ;if not exit
) ;if
(start_list "cats")
(mapcar 'add_list categories)
(end_list)
(start_list "sys")
(mapcar 'add_list systems)
(end_list)
(action_tile
"cats"
(strcat
"(setq category (nth (atoi $value) categories))"
"(setq systems (ade_projlistcrdsysts category))"
"(start_list \"sys\")" ;start list box
"(mapcar 'add_list systems)" ;add names from list
"(end_list)" ;end list box
)
)
(action_tile
"cancel"
"(done_dialog)"
)
(action_tile
"accept"
(strcat
"(setq inputcrdsys (nth (atoi(get_tile \"sys\")) systems))"
"(done_dialog)" ; set flag to run routine
)
) ;action tile
(start_dialog) ;display dialog
(unload_dialog transform_dcl_id) ;unload dialog
(ade_projsetsrc inputcrdsys)
(if (= (ade_projgetwscode) "")
(command "_adesetcrdsys")
)
(ade_projsetdest (ade_projgetwscode))
(setq coord (ade_projptforward (getpoint "\nEnter a point: ")))
;;; this is the start point
(command "pline" coord)
;;; draw line from start point
(while (/= coord nil) ; repeat
(setq coord (ade_projptforward (getpoint "\nNext point: ")))
(command coord) ; enter next point or end
) ; end while
(princ)
) ; end defun
(defun *error* (msg)
(if (member
msg
'("console break" "Function cancelled" "quit / exit abort")
)
(setq *error* outtahere)
)
)
(defun outtahere (errmsg /)
(setq *error* temperr)
(princ)
)
transform : dialog { //dialog name
label = "Transformer 1.1 " ; //give it a label
: paragraph { //define paragraph
: text_part { //define text
label = "Pick the input data format. As long as the command is running,"; //give it some text
} //end text
: text_part { //define text
label = "you may enter coordinates in a foreign coordinate system."; //give it some text
} //end text
} //end paragraph
: spacer { //define space
height = 1; //define height
} //end spacer
: column{
: popup_list{
key = "cats";
label = "Coordinate Category:";
width = 60;
multiple_select = false; //disallow multiple select
}
: popup_list{
key = "sys";
label = "Coordinate System: ";
width = 60;
multiple_select = false; //disallow multiple select
}
: spacer { //define space
height = 1; //define height
} //end spacer
ok_cancel; //predefined OK/Cancel button
}
} //end dialog