Jump to content

Recommended Posts

Posted (edited)

I was doing alot of wipeout and was not enjoying the typing to create them when i wanted to select the same things each time.

 

I wrote this lisp to help me speed the process up.

 

It is very simple and is great for showing how you can use lisp to create short cuts for autocad comands.

 

I would love the recive comment/critesim for this lisp and anything to help be better understand lisp.

;wipeout shotcut
(defun c:wp()
 (setq pl1
 (entsel "\nSelect closed polyline to convert to wipeout:")
);setq
(command "wipeout" "polyline" pl1 "yes")
 (command "change" "last" "" "properties" "color" "green" "")
);defun

 

one of this issue i had with is lisp is the command function. If you want an ENTER you have to "" not " ".

Edited by SunnyTurtle
copy and paste error
Posted

It is better to check if the selected entity reach our requirements and after that we can implement the action on it. :)

 

Check is out ....

 

(defun c:wp (/ pl1)
 (if (and (setq
            pl1 (entsel "\nSelect closed polyline to convert to wipeout:")
          )
          (vlax-curve-Isclosed (car pl1))
     )
   (progn
     (command "_.wipeout" "_polyline" pl1 "yes")
     (command "_.change" "last" "" "properties" "color" "green" "")
   )
   (princ)
 )
 (princ)
)

 

Tharwat

Posted

Why not use a background mask on mtext instead of using a wipeout?

Posted
Why not use a background mask on mtext instead of using a wipeout?

 

Good point Dink .

 

That's what came to my mind but there is a small problem with it is that when the entity is mtext and its width is wilder than its characters , the background going

to follow the width of the mtext and not the width of all chars in a text .

 

Tharwat

Posted

Sunny & Tharwat's lisp no effect with cirlce or pline ( line + arc ). you can combine with my lisp ( for circle ) & develope more... Good luck

(Defun c:WC ()
(command "undo" "be")
(setq luubatdiem (getvar "osmode"))
(setvar "osmode" 0)

(Princ "\nHay chon CIRCLE :")
(setq XX (ssget '((0 . "CIRCLE"))))

(setq L 0)
(setq M (sslength XX))
(while (< L M)
(setq DT (ssname XX L))
(setq DT (entget DT))
(setq TAM (cdr (assoc 10 DT)))
(setq BANKINH (cdr (assoc 40 DT)))

(command ".polygon" "30" TAM "" BANKINH) 
(command ".wipeout" "" "last" "y") 

(setq L (1+ L))
)

(setvar "osmode" luubatdiem)
(command "undo" "end")
(Princ)
) 

Posted
Sunny & Tharwat's lisp no effect with cirlce or pline .....
(Defun c:WC ()

 

Really ????

 

By the way , cool name for the routine . :D

Posted
Why not use a background mask on mtext instead of using a wipeout?

Yes i always use a background mask for text it is just a whole lot simpler.

But i used the wipeout for other things like Blocking out the road under a Bridge

Sunny & Tharwat's lisp no effect with cirlce or pline

Just to clarify Tharwat's and mine only work on closed pline.

Posted (edited)

Hi again i just was using the lisp and decided that i could improve it to make it more user friendly.

if you select a ployline that is not closed, (as these can not become wipeouts). it will display an error message.

Is there a way you can make this come up next to the mouse if you have dianmic imput on?

Thanks you guy are awsome as ussual.

(defun c:wp (/ pl1)
 (if (and (setq
            pl1 (entsel "\nSelect closed polyline to convert to wipeout:")
          )
          (vlax-curve-Isclosed (car pl1))
     );and
   (progn
     (command "_.wipeout" "_polyline" pl1 "yes")
     (command "_.change" "last" "" "properties" "color" "green" "")
   );progn
   (prompt "\nERROR ployline not closed!")
 );if
 (princ)
);defun

So ive used prompt in this one but it is not distinctive enother to tell me theres an error

the display says

ERROR not closed ployline

Command:

and how would i get it to display on the bottom line i.e. where "command:" is

i would like this becasue it is make is more easy see

Edited by SunnyTurtle
update
  • 2 years later...
Posted (edited)

Thank you for the code, I've changed and added one line to this to suit my needs.

 

(command "_.wipeout" "_polyline" pl1 "yes")

(command "_.change" "last" "" "properties" "color" "T" "255,255,255" "")

(command "DRAWORDER" "last" "" "back" "")

 

Basically the color is now 255,255,255. Just means the wipeout line will appear not to print.

Draworder to send it to back. I used it mostly inside blocks but this is generally how it works best.

Edited by 3dwannab

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