Author Topic: Supress command line  (Read 2465 times)

0 Members and 1 Guest are viewing this topic.

mohobrien

  • Guest
Supress command line
« on: October 17, 2006, 10:56:19 AM »
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:
Code: [Select]
;;; 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





David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4076
Re: Supress command line
« Reply #1 on: October 17, 2006, 11:00:44 AM »
would turning echo off help?
cmdecho = 0
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

mohobrien

  • Guest
Re: Supress command line
« Reply #2 on: October 17, 2006, 11:16:40 AM »
God, I think I need the paper bag for an avatar. Thanks Cmduh.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4076
Re: Supress command line
« Reply #3 on: October 17, 2006, 11:49:16 AM »
No problem

I really like this avatar b/c half the time I ask questions that can be answered 'Duh!
Which by the way is how I got my nickname in the first place
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)