Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

this will not redraw when I exit the command

1 REPLY 1
Reply
Message 1 of 2
cadking2k5
310 Views, 1 Reply

this will not redraw when I exit the command

this will not redraw obj when I exit the command if I hit ESC IT WILL

 

(DEFUN C:CHF ()
  (command "undo" "BE")
(setq osm (getvar "osmode"))
  (setvar "osmode" 0)
  (defun *error* (msg)
    (if objs (foreach pol objs (redraw pol 4)))
    (cond ((not msg))                                                   ; Normal exit
          ((member msg '("Function cancelled" "quit / exit abort")))    ; <esc> or (quit)
          ((princ (strcat "\n** Error: " msg " ** ")))                  ; Fatal error, display it
    )
    (princ)
  )
  (setq obj (entsel "\nSelect object:"))
  (setq pol (car obj))
  (setq pt (cadr obj))
  (setq ptn (osnap pt "NEA"))
  (setq pt (vlax-curve-getClosestPointTo (vlax-ename->vla-object pol) pt))
  (setq objs (cons pol objs))
  (redraw pol 3)
  (foreach obj1 '(a)
    (while (setq obj1 (entsel "\nSelect part of object to change: "))
      (setq pt1 (cadr obj1))
      (setq pol1 (car obj1))
      (setq pt1n (osnap pt1 "NEA"))
      (setq int (vlax-invoke
          (vlax-ename->vla-object (car obj))
          "intersectwith"
          (vlax-ename->vla-object (car obj1))
          acExtendBoth)
    )
      (setq int1 (list (car int) (cadr int) (caddr int)))
      (setq int2 (cdddr int))
        (cond
    ((= ang1 ang2 ang3)
     (command "line" end1 int1 "")
     )
    ((and(= ang2 ang3)(/= ang1 ang2)(/= ang1 ang3))
     (command "line" end1 int2 "")
     )
     ((and(= ang1 ang2)(/= ang3 ang1)(/= ang3 ang2))
     (command "line" end2 int2 "")
     )
       ((and(= ang1 ang3)(/= ang2 ang1)(/= ang2 ang3))
     (command "line" end2 int1 "")
     )
    (if (null a)
     (command cancel)
     )
    )
      (setvar "osmode" 183)
      (command "undo" "E")
      (princ)
      )
    )
  )

1 REPLY 1
Message 2 of 2
pbejse
in reply to: cadking2k5


@cadking2k5 wrote:

this will not redraw obj when I exit the command if I hit ESC IT WILL

 

(DEFUN C:CHF ()
...


      (princ)
      )
    )(*error* nil) (princ)
  )


 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost