Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Revision Cloud - Fix Lisp

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
ryled
2113 Views, 2 Replies

Revision Cloud - Fix Lisp

I am new to lisp routines.  I currently have loaded one that runs the way I would like it to except for one feature.  In the bottom right corner of the square rectangle cloud it creates an oversized arch.   Unfortunately I have no LISP experience and though I've tried to figure it out I am having no luck.  If someone has the time to edit this and stop the creation of this oversized arch and have it a consistant square revision cloud that would be appreciated. 

;TIP1352.LSP:    CLOUD.LSP   Rectangular Cloud  (c)1997, P.K. Yousuf

; This Program is used for Clouding the revised/hold area.
;---------------------------------------------------------------------------
(prompt "\nProgram for CLOUDING a rectanagular area - by P.K.Yousuf")
(setq os (getvar "osmode"))
(graphscr) 

(defun c:cloud (/ os s1 d1 d2 d3 p1 p2 p3 p4 p5 pn ph)
(command "osmode" 0 "cmdecho" 0)
(prompt "\nProgram for CLOUDING with RECTANGULAR POINTS - by P.K.Yousuf")
;;;(princ "\n")
(setq p1 (getpoint "\nShow the Lower Left Corner: ")
                  p3 (getcorner p1 "\nShow the Upper Right Corner: ") 
      pn (getint "\nHow many arcs would you like in the width of the rectangle:  " )
      p2 (list (car p3) (cadr p1))
      p4 (list (car p1) (cadr p3))
      d1 (- (distance p1 p2) (distance p2 p3))
);===================================================Bottom side
(setq d3 ( / (distance p1 p2) pn)) 
    (setq ph (polar p1 (angle p1 p2) d3)) 
    (command "pline" p1 "w" 0 0 "a" "a" "130" ph "") (setq s1 (entlast))
(while (> (distance ph p2) (+ d3 1)) 
       (setq p5 ph)
       (setq ph (polar p5 (angle p1 p2) d3)) 
       (command "pline" p5 "a" "a" "130" ph "")
       (command "pedit" "l" "j" s1 "" "") (setq  s1 (entlast)))
       (setq p5 ph)   
             (setq ph (polar p2 (angle p2 p3) d3)) 
       (command "pline" p5 "a" "a" "180" ph "")
       (command "pedit" "l" "j" s1 "" "") (setq  s1 (entlast))
;==================================================Right side
(while (> (distance ph p3) d3) 
       (setq p5 ph)
       (setq ph (polar p5 (angle p2 p3) d3)) 
       (command "pline" p5 "a" "a" "130" ph "")
       (command "pedit" "l" "j" s1 "" "") (setq  s1 (entlast)))
       (setq p5 ph)   
             (setq ph (polar p3 (angle p3 p4) d3)) 
       (command "pline" p5 "a" "a" "180" ph "")
       (command "pedit" "l" "j" s1 "" "") (setq  s1 (entlast))
;==================================================Top side
(while (> (distance p4 ph) d3) 
       (setq p5 ph)
       (setq ph (polar p5 (angle p3 p4) d3)) 
       (command "pline" p5 "a" "a" "130" ph "")
       (command "pedit" "l" "j" s1 "" "") (setq  s1 (entlast)))
       (setq p5 ph)   
             (setq ph (polar p4 (angle p4 p1) d3)) 
       (command "pline" p5 "a" "a" "180" ph "")
       (command "pedit" "l" "j" s1 "" "") (setq  s1 (entlast))
;=================================================Left side
(while (> (distance p1 ph) d3) 
       (setq p5 ph)
       (setq ph (polar p5 (angle p4 p1) d3)) 
       (command "pline" p5 "a" "a" "130" ph "")
       (command "pedit" "l" "j" s1 "" "") (setq  s1 (entlast)))
       (command "pline" ph "a" "a" "130" p1 "")
       (command "pedit" "l" "j" s1 "" "")
       (command "osmode" os) 
)
(princ);---End of the program.

 I have also added an attachment of the lisp. 

 

Thank you!

Tags (1)
2 REPLIES 2
Message 2 of 3
marko_ribar
in reply to: ryled

Here, I think I've corrected this issue...

 

;TIP1352.LSP:    CLOUD.LSP   Rectangular Cloud  (c)1997, P.K. Yousuf

; This Program is used for Clouding the revised/hold area.
;---------------------------------------------------------------------------
(defun c:cloud (/ os s1 d1 d2 d3 p1 p2 p3 p4 p5 pn ph)
(setq os (getvar "osmode"))
(command "osmode" 0 "cmdecho" 0)
(prompt "\nProgram for CLOUDING with RECTANGULAR POINTS - by P.K.Yousuf")
(terpri)
(setq p1 (getpoint "\nShow the Lower Left Corner: ")
                  p3 (getcorner p1 "\nShow the Upper Right Corner: ") 
      pn (getint "\nHow many arcs would you like in the width of the rectangle:  " )
      p2 (list (car p3) (cadr p1))
      p4 (list (car p1) (cadr p3))
      d1 (- (distance p1 p2) (distance p2 p3))
);===================================================Bottom side
(setq d3 ( / (distance p1 p2) pn)) 
    (setq ph (polar p1 (angle p1 p2) d3)) 
    (command "pline" p1 "w" 0 0 "a" "a" "130" ph "") (setq s1 (entlast))
(while (> (distance ph p2) d3) 
       (setq p5 ph)
       (setq ph (polar p5 (angle p1 p2) d3)) 
       (command "pline" p5 "a" "a" "130" ph "")
       (command "pedit" "l" "j" s1 "" "") (setq  s1 (entlast)))
       (setq p5 ph)   
             (setq ph (polar p2 (angle p2 p3) d3)) 
       (command "pline" p5 "a" "a" "180" ph "")
       (command "pedit" "l" "j" s1 "" "") (setq  s1 (entlast))
;==================================================Right side
(while (> (distance ph p3) d3) 
       (setq p5 ph)
       (setq ph (polar p5 (angle p2 p3) d3)) 
       (command "pline" p5 "a" "a" "130" ph "")
       (command "pedit" "l" "j" s1 "" "") (setq  s1 (entlast)))
       (setq p5 ph)   
             (setq ph (polar p3 (angle p3 p4) d3)) 
       (command "pline" p5 "a" "a" "180" ph "")
       (command "pedit" "l" "j" s1 "" "") (setq  s1 (entlast))
;==================================================Top side
(while (> (distance p4 ph) d3) 
       (setq p5 ph)
       (setq ph (polar p5 (angle p3 p4) d3)) 
       (command "pline" p5 "a" "a" "130" ph "")
       (command "pedit" "l" "j" s1 "" "") (setq  s1 (entlast)))
       (setq p5 ph)   
             (setq ph (polar p4 (angle p4 p1) d3)) 
       (command "pline" p5 "a" "a" "180" ph "")
       (command "pedit" "l" "j" s1 "" "") (setq  s1 (entlast))
;=================================================Left side
(while (> (distance p1 ph) d3) 
       (setq p5 ph)
       (setq ph (polar p5 (angle p4 p1) d3)) 
       (command "pline" p5 "a" "a" "130" ph "")
       (command "pedit" "l" "j" s1 "" "") (setq  s1 (entlast)))
       (command "pline" ph "a" "a" "130" p1 "")
       (command "pedit" "l" "j" s1 "" "")
       (command "osmode" os) 
       (princ)
)

 HTH, M.R.

Marko Ribar, d.i.a. (graduated engineer of architecture)
Message 3 of 3
ryled
in reply to: marko_ribar

Thank you Marko.  Thats what I was looking to do.  I'd ask what you did but I would not understand your answer, I've yet to dive into learning lisp routines.  Thanks again!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost