Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/22/2024 in all areas

  1. 1 point
  2. So... this can process more lines at a time. (defun c:pp() (setq dist 2.0 lines (ssget '((0 . "LINE"))) n (sslength lines)) (repeat n (setq l1 (ssname lines (setq n (1- n))) line (entget l1) pa (cdr (assoc 10 line)) pb (cdr (assoc 11 line)) lay (assoc 8 line) len (distance pa pb) rl (/ dist len) pc (mapcar '(lambda(a b)(+ b (* rl (- a b)))) pa pb) pd (mapcar '(lambda(a b)(- a (* rl (- a b)))) pa pb) ) (entmake (list '(0 . "LINE")(cons 10 pb)(cons 11 pc)'(62 . 2) lay )) (entmake (list '(0 . "LINE")(cons 10 pa)(cons 11 pd)'(62 . 2) lay )) (entdel l1) ) )
    1 point
  3. (defun c:pp() (setq oldLine (car (entsel "select line to be extended ")) line (entget oldLine) dist 2.0 pa (cdr (assoc 10 line)) pb (cdr (assoc 11 line)) lay (assoc 8 line) len (distance pa pb) rl (/ dist len) pc (mapcar '(lambda(a b)(+ b (* rl (- b a)))) pa pb) pd (mapcar '(lambda(a b)(- a (* rl (- b a)))) pa pb) ) (entmake (list '(0 . "LINE")(cons 10 pb)(cons 11 pc)'(62 . 2) lay )) (entmake (list '(0 . "LINE")(cons 10 pa)(cons 11 pd)'(62 . 2) lay )) (entdel oldLine) ) This will delete the original line.
    1 point
  4. (defun c:pp() (setq line (entget (car (entsel "select line to be extended "))) dist 2.0 pa (cdr (assoc 10 line)) pb (cdr (assoc 11 line)) lay (assoc 8 line) len (distance pa pb) rl (/ dist len) pc (mapcar '(lambda(a b)(+ b (* rl (- b a)))) pa pb) pd (mapcar '(lambda(a b)(- a (* rl (- b a)))) pa pb) ) (entmake (list '(0 . "LINE")(cons 10 pb)(cons 11 pc)'(62 . 2) lay )) (entmake (list '(0 . "LINE")(cons 10 pa)(cons 11 pd)'(62 . 2) lay )) )
    1 point
×
×
  • Create New...