TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: aswin on March 21, 2017, 04:06:15 AM

Title: Offset at different distance
Post by: aswin on March 21, 2017, 04:06:15 AM
Hi friends...
is there any lisp to offset a line as per attachment ?
 
Title: Re: Offset at different distance
Post by: ChrisCarlson on March 21, 2017, 08:01:02 AM
Is there a ratio or formula that is consistent?
Title: Re: Offset at different distance
Post by: Grrr1337 on March 21, 2017, 08:26:12 AM
Use this tool (http://www.lee-mac.com/dynamicoffset.html) from Lee Mac, and adjust the offset factor.
Title: Re: Offset at different distance
Post by: ronjonp on March 21, 2017, 08:57:43 AM
THIS (https://www.theswamp.org/index.php?topic=24688.msg297553#msg297553) one too.
Title: Re: Offset at different distance
Post by: Ketxu on March 21, 2017, 09:13:08 AM
And maybe http://www.cadtutor.net/forum/showthread.php?88234-Multi-Offset-with-Different-Distances&p=606023&viewfull=1#post606023
Title: Re: Offset at different distance
Post by: paulmcz on March 21, 2017, 03:12:04 PM
How about knurling lines?

Code: [Select]
;;; inserts, moves and rotates vertical knurling lines for side view of cylinder
(defun c:233 (/ di ip l n oort p1 p2 r ss u u1)
  (command "_.undo" "begin")
  (setq l    (getdist "\n Knurling line length: ")
r    (/ (getdist "\n Diameter: ") 2.0)
n    (getint "\n Number of knurling lines visible in side view: ")
u    (/ pi n)
ip   (list 0 0 0)
u1   u
ss   (ssadd)
oort (getvar "orthomode")
  )
  (repeat (- n 1)
    (setq di (- r (* r (cos u1)))
  p1 (polar ip 0 di)
  p2 (polar p1 (* pi 0.5) l)
  u1 (+ u1 u))
    (entmake (list (cons 0 "LINE")(cons 10 p1)(cons 11 p2)))
    (ssadd (entlast) ss)
  )
  (setvar "orthomode" 0)
  (command "move" ss "" ip pause)
  (command "rotate" ss "" (getvar "lastpoint") pause)
  (setvar "orthomode" oort)
  (command "_.undo" "end")
  (princ (strcat "\n Circle radius = " (rtos r 2 3)))
  (princ)
  )
Title: Re: Offset at different distance
Post by: GDF on March 21, 2017, 04:41:38 PM
Awesome
Title: Re: Offset at different distance
Post by: paulmcz on March 21, 2017, 07:26:57 PM
Thanks GDF, laziness made me write it some time ago.
Title: Re: Offset at different distance
Post by: aswin on March 22, 2017, 09:19:54 AM
Thanks a lot friends.. really helpful lisps...  :-D