Author Topic: Offset at different distance  (Read 1914 times)

0 Members and 1 Guest are viewing this topic.

aswin

  • Mosquito
  • Posts: 12
Offset at different distance
« on: March 21, 2017, 04:06:15 AM »
Hi friends...
is there any lisp to offset a line as per attachment ?
 
Abu Dhabi

ChrisCarlson

  • Guest
Re: Offset at different distance
« Reply #1 on: March 21, 2017, 08:01:02 AM »
Is there a ratio or formula that is consistent?

Grrr1337

  • Swamp Rat
  • Posts: 812
Re: Offset at different distance
« Reply #2 on: March 21, 2017, 08:26:12 AM »
Use this tool from Lee Mac, and adjust the offset factor.
(apply ''((a b c)(a b c))
  '(
    (( f L ) (apply 'strcat (f L)))
    (( L ) (if L (cons (chr (car L)) (f (cdr L)))))
    (72 101 108 108 111 32 87 111 114 108 100)
  )
)
vevo.bg

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Offset at different distance
« Reply #3 on: March 21, 2017, 08:57:43 AM »
THIS one too.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC


paulmcz

  • Bull Frog
  • Posts: 202
Re: Offset at different distance
« Reply #5 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)
  )

GDF

  • Water Moccasin
  • Posts: 2081
Re: Offset at different distance
« Reply #6 on: March 21, 2017, 04:41:38 PM »
Awesome
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

paulmcz

  • Bull Frog
  • Posts: 202
Re: Offset at different distance
« Reply #7 on: March 21, 2017, 07:26:57 PM »
Thanks GDF, laziness made me write it some time ago.

aswin

  • Mosquito
  • Posts: 12
Re: Offset at different distance
« Reply #8 on: March 22, 2017, 09:19:54 AM »
Thanks a lot friends.. really helpful lisps...  :-D
Abu Dhabi