Jump to content

Need Help! Rev-cloud Lisp!


Pugazh

Recommended Posts

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")))    ; <esc> 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 [Yes/No] <No>: ")
    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)
 )

 

Link to comment
Share on other sites

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.

  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...