Jump to content

Lsp route to be modified


VisDak

Recommended Posts

Hi to all,

 

Good Day, I have some old Lisp route the will shade on round plan or symbol by a ramp up on plan, kindly see the image:

 

(defun c:shd ()(setq old_error  *error* *error* ai_error)
(setq cecho (getvar "cmdecho"))
(setvar "cmdecho" 0)(command "_.UNDO" "_GROUP")
(initget (+ 1 2 )(setq fpt (getpoint "\nStarting Point of Shade ? "))
(initget (+ 1 2 )(setq spt (getpoint "\nEnd Point of Line Shade ? " fpt))
(initget (+ 1 2 )(setq opt (getpoint "\nDirection of Line Shade ? " fpt))
(setq dis (abs (distance fpt opt)))(setq hmany 1000)
(command "line" fpt spt "")(setq flc (entlast))
(setq coeff (/ dis 1000))(repeat hmany
(if (< (* coeff 1.25) dis)(progn (setq coeff (* coeff 1.25))
(command "offset" coeff flc opt "")
(prompt (strcat "\rDRAWING IN PROGRESS, PLEASE WAIT... "
(rtos (* (/ (float (* coeff 1.24))(float dis))100.000) 2 0)" %")) )))
(command "_.UNDO" "_E")(setvar "cmdecho" cecho)(princ))

 

the image "1" represent the route that i have, on image "2" is the one i need to be revised by it means, i like to be have this route "image 2" that i will use on circular to rectangular connection symbol it will be perfect on gredient deviding a line, please help me if you have some additional/revised to this route,

 

thanks to all

shade.jpg

Link to comment
Share on other sites

Like this:

 

(defun c:shd  (/ old_error *error* cecho fpt
                spt opt dis ang hmany flc)
 
 (setq old_error *error*
       *error*   ai_error)
 (setq cecho (getvar "cmdecho"))
 (setvar "cmdecho" 0)
 (command "_.UNDO" "_GROUP")
 (initget (+ 1 2 )
 (setq fpt (getpoint "\nStarting Point of Shade ? "))
 (initget (+ 1 2 )
 (setq spt (getpoint "\nEnd Point of Line Shade ? " fpt))
 (initget (+ 1 2 )
 (setq opt (getpoint "\nDirection of Line Shade ? " fpt))
 (setq dis (abs (distance fpt opt)))
 (setq ang (angle fpt opt))
 (setq hmany 1000)
 (command "line" fpt spt "")
 (setq flc (entlast))
 (setq coeff (/ dis 1000.))
 (repeat hmany
   (if (< (setq coeff (* coeff 1.25)) dis)
     (progn
       (command "_line" "_non" fpt "_non" (polar spt ang coeff) "")
       (princ (strcat "\rDRAWING IN PROGRESS, PLEASE WAIT... "
                      (rtos (* (/ (* coeff 1.24) dis) 100.) 2 0) "%")))))
 (command "_.UNDO" "_E")
 (setvar "cmdecho" cecho)
 (princ))

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