Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: revcloud lisp

  1. #1
    Member
    Join Date
    2002-09
    Location
    Greeley, CO
    Posts
    44
    Login to Give a bone
    0

    Default revcloud lisp

    I am so close at getting this complete it is really bothering me. There is only one thing I need this routine to do and that is pause right after it sets my revcloud arc lengths. So the user can either start drawing the revcloud or hit O to select objects. By default I have put "O" to select objects and the lisp routine works perfect. But that's not the command that should be there. Putting PAUSE in place of "O" doesn't work and this is where I am stuck. I would use get object, but we don't have any lisp routines that use that function so I am not sure where I would place that line in this lisp.

    Code:
    (setq oldlay (getvar "clayer"))
    (setq a (getvar "cannoscalevalue"))
    (COMMAND "-LAYER" "M" "MEREVISION" "C" "4" "" "S" "MEREVISION" "")
    (setq ss (
    	  cond
    	   ((= a (/ 1.0 192.0)) 50.0) 		;1/16th scale sets arc length to 50
    	   ((= a (/ 1.0 128.0)) (/ 135.0 4.0))	;3/32th scale sets arc length to 33.75
    	   ((= a (/ 1.0 96.0)) 25.0)		;1/8th scale sets arc length to 25
    	   ((= a (/ 1.0 64.0)) (/ 75.0 4.0))	;3/16th scale sets arc length to 18.75
    	   ((= a (/ 1.0 48.0)) (* 25.0 0.5))	;1/4 scale sets arc length to 12.5
    	   ((= a 1.0) (/ 1.0 4.0))		;1:1 scale sets arc length to .25
    	   ((= a (/ 1.0 240.0)) 75.0)		;1:20 scale sets arc length to 75
    	   ((= a (/ 1.0 480.0)) 100.0)		;1:40 scale sets arc length to 100
    	   ((= a (/ 1.0 24.0)) (* 25 0.25))	;1/2 scale sets arc length to 6.25
    	 )
    )
    
      (setq
        i  0
        rrr (ssget
           )
      )
      (progn
        (while (< i (sslength rrr))
          (setq X (ssname rrr i))
          (COMMAND "revcloud" "style" "calligraphy" "a" SS SS "O" X "N")
          (setq i (+ 1 i))
        )
      )
    
    (setvar "clayer" oldlay)

  2. #2
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: revcloud lisp

    I don't think that the values of your (ss) are working and return with a value, so recheck them out.

    Here is the main procedure for the command revcloud in Lisp with two options.
    Code:
      (initget 0 "Yes No")
          (if (eq "Yes" (getkword "\n Object Selection <Path> [Yes No]: <No> "))
    	(progn
    	  (setq x (car (entsel "\n Select object :")))
                 (COMMAND "_.revcloud" "style" "calligraphy" "a" 1 1 "_o" X "" "" "N"))
          (progn
    	(command "_.revcloud" "A" 1 1 (while (> (getvar "CmdActive") 0) (command pause)))
    	)
     )
    Good luck

    Tharwat

  3. #3
    I could stop if I wanted to
    Join Date
    2007-05
    Location
    Brookfield WI
    Posts
    331
    Login to Give a bone
    0

    Default Re: revcloud lisp

    Have you though of having an option right away where the user chooses to create the revcloud via rectangle, circle, or polyline? Then using last object created as the revclouds object.

    example from forum search
    Code:
    (cond
        ((= inp "Rectangle")
         (setq p1 (getpoint "\nSpecify first corner point: "))
         (setq p2 (getcorner p1 "\nSpecify other corner point: "))
         (setvar "plinewid" 0)
         (command "rectang" p1 p2)
         (command "._REVCLOUD" "a" arc "" "O" (entlast) "N")
        )

  4. #4
    Member
    Join Date
    2002-09
    Location
    Greeley, CO
    Posts
    44
    Login to Give a bone
    0

    Default Re: revcloud lisp

    d_m_hopper - Though I see the use in this lisp, that's not the direction we would like to take it. It's bad enough our engineers can't remember you can select an object to make that a could boundary so this might be a little much for them.

    tharwat313 - I'm trying to incorporate your lines of text into my lisp routine but am having a hard time getting it to work. I changed the "1 1" to "ss ss" and it works, but I don't have the ability to select multiple objects so I am working to get that fixed.

    The scale in the routine seems to be working fine for me. Change the annotation scale and the arcs will change size when the routine is run (using the original code I posted).

    The whole idea of this lisp is to do 3 things. 1) revert back to previous layer the user was on prior to drawing the revcloud. 2) Automatically set the cloud length so they don't have to worry about what scale they are in. 3) Have the ability to make this look no different than the standard revcloud command by having the command line function like "Specify start point or (Arc length/Object/Style) <object>: "
    Part 3 is the part I am having trouble with.

    If anyone else has any more suggestions please feel free to post them. This is still a work in progress. I will post results when it is complete.

  5. #5
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: revcloud lisp

    Quote Originally Posted by CAD Brad View Post

    tharwat313 - I'm trying to incorporate your lines of text into my lisp routine but am having a hard time getting it to work. I changed the "1 1" to "ss ss" and it works, but I don't have the ability to select multiple objects so I am working to get that fixed.
    So here is the multiple Selection set as you wanted .

    So you can add your scales values that you included in your first post as best as you want.

    Code:
     (defun c:THrev ( / i o ss x )
       ;THARWAT Nov 04.2010
          (if (eq "Yes" (progn (initget 0 "Yes No")(getkword "\n Object Selection <Path> [Yes No]: <No> ")))
    	(progn
    	  (setq i 0)
    	    (setq o (ssget "_:L" '((0 . "CIRCLE,LWPOLYLINE"))))
    	     (setq ss (sslength o))
    	        (repeat ss
    		  (setq x (ssname o (setq i (1+ i))))	  
                 (command "_.revcloud" "style" "calligraphy" "a" 1 1 "_o" o ""))
    	  )
          (progn
    	(command "_.revcloud" "A" 1 1 (while (> (getvar "CmdActive") 0) (command pause)))
    	)
              )
       (princ)
       )
    Good luck

    Tharwat

  6. #6
    AUGI Addict
    Join Date
    2008-02
    Posts
    1,141
    Login to Give a bone
    0

    Default Re: revcloud lisp

    Quote Originally Posted by tharwat313 View Post
    Code:
    (eq "Yes" (progn (initget 0 "Yes No")(getkword "\n Object Selection <Path> [Yes No]: <No> ")))
    You are really getting some miles out of that snippet. LoL

  7. #7
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: revcloud lisp

    Quote Originally Posted by alanjt View Post
    You are really getting some miles out of that snippet. LoL
    Thanks a lot Alanjt.

    I swear. I did know that you would indicate to it.

    Tharwat

  8. #8
    AUGI Addict
    Join Date
    2008-02
    Posts
    1,141
    Login to Give a bone
    0

    Default Re: revcloud lisp

    Quote Originally Posted by tharwat313 View Post
    Thanks a lot Alanjt.

    I swear. I did know that you would indicate to it.

    Tharwat
    BTW, you don't need to wrap it within progn. The only reason I used that was due to the statement being wrapped in and. Just put the initget before your if statement.

  9. #9
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: revcloud lisp

    Quote Originally Posted by alanjt View Post
    BTW, you don't need to wrap it within progn. The only reason I used that was due to the statement being wrapped in and. Just put the initget before your if statement.
    Exactly. the same as my post No # 2.

    Appreciated a lot.

  10. #10
    Member
    Join Date
    2002-09
    Location
    Greeley, CO
    Posts
    44
    Login to Give a bone
    0

    Default Re: revcloud lisp

    Alright. So far so good. I got the scale working properly. It looks like we both had SS in our routines that were conflicting so I made mine SSS.

    The only thing I see people whining about is the fact that they have to answer a yes or no question rather than just start drawing. If there is any other way to get back to this --> "Specify start point or (Arc length/Object/Style) <object>: " when the command it started, that would be MUCH preferred. Otherwise this looks good. Thanks tharwat.

    Code:
    (defun c:THAR ( / i o ss x oldlay sss )
    (setq oldlay (getvar "clayer"))
    (setq a (getvar "cannoscalevalue"))
    (COMMAND "-LAYER" "M" "EEREVISION" "C" "4" "" "S" "EEREVISION" "")
    (setq sss (
    	  cond
    	   ((= a (/ 1.0 192.0)) 50.0) 		;1/16th scale sets arc length to 50
    	   ((= a (/ 1.0 128.0)) (/ 135.0 4.0))	;3/32th scale sets arc length to 33.75
    	   ((= a (/ 1.0 96.0)) 25.0)		;1/8th scale sets arc length to 25
    	   ((= a (/ 1.0 64.0)) (/ 75.0 4.0))	;3/16th scale sets arc length to 18.75
    	   ((= a (/ 1.0 48.0)) (* 25.0 0.5))	;1/4 scale sets arc length to 12.5
    	   ((= a 1.0) (/ 1.0 4.0))		;1:1 scale sets arc length to .25
    	   ((= a (/ 1.0 240.0)) 75.0)		;1:20 scale sets arc length to 75
    	   ((= a (/ 1.0 480.0)) 100.0)		;1:40 scale sets arc length to 100
    	   ((= a (/ 1.0 24.0)) (* 25 0.25))	;1/2 scale sets arc length to 6.25
    	 )
    )
       ;THARWAT Nov 04.2010 [forums.augi.com/showthread.php?p=1108252#post1108252]
          (if (eq "Yes" (progn (initget 0 "Yes No")(getkword "\n Object Selection <Path> [Yes No]: <No> ")))
    	(progn
    	  (setq i 0)
    	    (setq o (ssget "_:L" '((0 . "CIRCLE,LWPOLYLINE"))))
    	     (setq ss (sslength o))
    	        (repeat ss
    		  (setq x (ssname o (setq i (1+ i))))	  
                 (command "_.revcloud" "style" "calligraphy" "a" SSS SSS "_o" o ""))
    	  )
          (progn
    	(command "_.revcloud" "A" SSS SSS (while (> (getvar "CmdActive") 0) (command pause)))
    	)
              )
       (princ)
    (setvar "clayer" oldlay)
       )

Page 1 of 2 12 LastLast

Similar Threads

  1. RevCloud LISP Help
    By michael.viall919828 in forum AutoLISP
    Replies: 7
    Last Post: 2012-12-20, 07:48 PM
  2. Old RevCloud cmd
    By SSGRichDAV in forum AutoCAD Customization
    Replies: 8
    Last Post: 2012-12-20, 05:13 AM
  3. Replies: 10
    Last Post: 2012-10-01, 04:02 PM
  4. RevCloud
    By amanda.bulmer-thresh in forum AutoLISP
    Replies: 14
    Last Post: 2009-02-08, 06:27 PM
  5. Write a LISP routine to enhance the revcloud command
    By melissa.j.seidel in forum AutoLISP
    Replies: 7
    Last Post: 2005-11-14, 06:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •