Author Topic: Getting rid of the RECTANG command's messages  (Read 2091 times)

0 Members and 1 Guest are viewing this topic.

iliekater

  • Guest
Getting rid of the RECTANG command's messages
« on: December 31, 2007, 05:24:27 PM »
I have created a lisp command that at some point prompts the user to specify the lower left corner of an about to be drawn rectangular . The width and length of the rectangular will be set automatically (by lisp code) , yet the user has to specify , by the previous point , where it likes to be created . Well , the command works fine , but I can't get rid of the AutoCAD's prompts for the dimensions of the rectangular . Although I am setting these dimensions by code , those messages still show up in the command line .
I have tried to modify the CMDECHO and the NOMUTT system variables , but those messages are still there !  :realmad:
« Last Edit: January 01, 2008, 01:28:50 PM by Daron »

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
Re: Getting rid of the RECTANG command's messages
« Reply #1 on: December 31, 2007, 05:36:59 PM »
You could create the rectangle in code without the use of the RECTANG command....

iliekater

  • Guest
Re: Getting rid of the RECTANG command's messages
« Reply #2 on: December 31, 2007, 05:47:28 PM »
Aaaahh , yeah . You are right . I quess I am much more stupid than I thought !  :lol: I will draw it with four points and the PLINE command !

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
Re: Getting rid of the RECTANG command's messages
« Reply #3 on: December 31, 2007, 06:33:35 PM »
You could take it a step further and not use the (command) function at all....check out the (entmake) thread in Show Your Stuff. And there's always the ActiveX method "AddLightweightPolyline" as well.

Edit-For some reason I couldn't locate the thread I was thinking of. But a search here for entmake & polyline should give you what you need.
« Last Edit: December 31, 2007, 06:42:42 PM by Jeff_M »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Getting rid of the RECTANG command's messages
« Reply #4 on: December 31, 2007, 07:14:54 PM »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Getting rid of the RECTANG command's messages
« Reply #5 on: December 31, 2007, 07:24:22 PM »
Here is one I just threw together.
Code: [Select]
(defun c:getrectangle (/ p1 p2)
  (if (and
        (setq p1 (getpoint "\nPick the rectangle corner."))
        (setq p2 (getcorner p1 "\nPick the corner."))

      )
    (progn
      (setq pt_lst (list p1 (list (car p1)(cadr p2)) p2 (list (car p2)(cadr p1))))
      ;;  Make LWpline by Gile
      (setq zdir (trans '(0 0 1) 1 0 t)
            elv  (caddr (trans (car pt_lst) 1 zdir))
      )
      (entmakex
        (append
          (list '(0 . "LWPOLYLINE")
                '(100 . "AcDbEntity")
                '(100 . "AcDbPolyline")
                (cons 90 (length pt_lst))
                '(70 . 1) ; 1 for closed 0 overwise
                (cons 38 elv)
                (cons 210 zdir)
          )
          (mapcar '(lambda (pt) (cons 10 (trans pt 1 zdir))) pt_lst)
        )
      )
    )
  )
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

iliekater

  • Guest
Re: Getting rid of the RECTANG command's messages
« Reply #6 on: January 01, 2008, 01:24:09 PM »
Thanks guys . You are gold .  :wink: