Pugazh 发表于 2022-7-5 12:55:12

Need Help! Rev-cloud Lisp!

Hi Everyone! Help me!
        I just modify Rev-Cloud Lisp using "RECTANG" Command.
        I want to change last step! we need after finish Rev-Cloud to set Rotation "0" in "RECTANG" Command. 
         
(defun C:Revc () (defun *error* (msg)    (if acDoc      (vla-endundomark acDoc)    )    (cond ((not msg))                                                   ; Normal exit          ((member msg '("Function cancelled" "quit / exit abort")))    ;or (quit)          ((princ (strcat "\n** Error: " msg " ** ")))    )                                                                   ; Fatal error, display it    (princ))(defun RtoD (nbrOfRadians)(/ (* nbrOfRadians 180.0) pi))(defun DtoR (nbrOfDegrees)(* (/ nbrOfDegrees 180.0) pi))   (if (not (tblsearch "LAYER" "REV"))      (entmakex '((0 . "LAYER")                  (100 . "AcDbSymbolTableRecord")                  (100 . "AcDbLayerTableRecord")                  (2 . "REV")                  (70 . 0)                  (62 . 10)                  (6 . "Continuous")                   )      )      )      (setvar 'clayer "REV")(setq oldosmode (getvar 'osmode))(setq ang (getvar 'snapang))(setvar 'osmode 0)(setq ang1 (cvunit ang "radians" "degrees"))(command "_.rectang" pause "R" ang1 pause)(while (> (getvar 'CmdActive) 0) (command pause))(setq rec (entlast))(setq arc (getvar 'DIMSCALE)) (initget "Yes No")(setq    cloud (getkword "Reverse Cloud direction : ")    cloud (cond (cloud) (T "No")); No for Enter)   (command "_.REVCLOUD" "_Style" "_Normal" "_Arc" (* arc 2.5) "" "_Object" rec cloud)   (command "_.rectang" "_none" "0,0" "R" 0 "_none" "0,0")   (setq del (entlast))   (command "_.erase" del "")   (setvar "clayer" "0")   (setvar 'osmode oldosmode)(vl-load-com)(princ) )         

Jef! 发表于 2022-7-5 13:34:54

Hi there!
        Between the (vl-load-com) and the (princ) lines (at the end), add these 2 lines
(command "_.rectang" "0,0" "R" "0" "1,1")(entdel (entlast))        it will leave the rotation of rectangle at 0 after execution.
        If this solves your problem, please mark this reply accordingly. Thanks and cheers.

Pugazh 发表于 2022-7-5 14:17:31

Hi Jef!
        Thanks for your's help!.Now it's working fine.
页: [1]
查看完整版本: Need Help! Rev-cloud Lisp!