Jump to content

Whats wrong in this macro?


asos2000

Recommended Posts

i created a CUI macro to draw a revcloud

^C^Cpline;revcloud;arc;500;500;object;last;;

 

the macro draws the pline and dont apply the revcloud command

Link to comment
Share on other sites

I am creating a CUI for the company I working in

What I want is, the user draws lines (pline) then those lines converted to revcloud .

 

I want to use the arc lengh as a standard for all user.

 

Any suggestions

Revcloud.JPG

Link to comment
Share on other sites

When constructing a rev-cloud from a polyline, the polyline must be closed. I had two mins so this LISP will accomplish the same thing:

 

; Polyline Revcloud by Lee McDonnell 21/12/2008

(defun c:prev (/ *error* l1 l2)

   (defun *error* (msg)
   (setvar "cmdecho" 1)
   (if (= msg "")
       (princ "\nFunction Complete.")
       (princ "\nError or Esc Pressed!")
   ) ;_  end if
   (princ)
   ) ;_  end defun

   (setvar "cmdecho" 0)
   (prompt "\nConstruct Polyline.")
   (command "_pline")
   (while (> (getvar "cmdactive") 0) (command pause))
   (setq l1 (entlast))
   (command "_pedit" l1 "c" "")
   (setq l2 (entlast))
   (prompt "\nReverse Cloud Direction? [Yes/No]: ")
   (command "_revcloud" "o" l2 pause)
   (*error* "")
   (princ)
) ;_  end defun

Link to comment
Share on other sites

Well, lets just say that it would be awkward to use a macro to accomplish the same task, as the macro would have to make sure that the polyline was closed before performing the conversion to a rev cloud - I would personally opt for LISP.

Link to comment
Share on other sites

Personally I like LISP but when dealing with more than 60 PCs and load the lisp on all of that.

In that case I prefer to make a CUI button (the menu is shared on server)

 

we can use that to be sure the pline is closed

 

^C^Cpline;pe;last;close;;revcloud;arc;500;500;object;last;;
Link to comment
Share on other sites

Maybe for existing polyline:

 

; Polyline Rev-cloud by Lee McDonnell (Polyline Selection) - 21/12/2008

(defun c:prev2 (/ *error* ent ent1)

   (defun *error* (msg)
   (setvar "cmdecho" 1)
   (if (= msg "")
       (princ "\nFunction Complete.")
       (princ "\nError or Esc Pressed!")
   ) ;_  end if
   (princ)
   ) ;_  end defun

   (setvar "cmdecho" 0)
   (while
   (setq ent (entsel "\nSelect Polyline: "))
      (command "_pedit" ent "c" "")
      (setq ent1 (entlast))
      (prompt "\nReverse Direction of Cloud? [Yes/No] <No> : ")
      (command "_revcloud" "O" ent1 pause)
   ) ;_  end while
   (*error* "")
   (princ)
) ;_  end defun

 

(got a bit carried away :P)

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...