Author Topic: Offset automatic - Help please  (Read 1004 times)

0 Members and 1 Guest are viewing this topic.

fabiocosta81

  • Mosquito
  • Posts: 6
Offset automatic - Help please
« on: September 23, 2023, 09:49:19 AM »
How can I create a lisp that does this drawing? It's a polyline that has a thickness of 0.04 and has this overlap, I can use the red line to offset 0.08 and build it, but I would like to automate.
ONLY THE PINK LINES.
« Last Edit: September 23, 2023, 10:38:38 AM by fabiocosta81 »

fabiocosta81

  • Mosquito
  • Posts: 6
Re: Offset automatic - Help please
« Reply #1 on: September 23, 2023, 10:37:57 AM »
I managed to make it this far

(DEFUN c:man ()

     (SETQ objeto (CAR (ENTSEL "\nSelecione o objeto: ")))

     (setq p1 (getpoint "\n-->Clique no lado do Afastamento: "))
     (command "offset" 0.08 objeto p1 "")

     (SETQ dadoslinha (entget (ENTLAST)))
     (SETQ novalinha (SUBST (CONS 8 "MANTA") (ASSOC 8 dadoslinha) dadoslinha))
     (SETQ novalinha (SUBST (CONS 43 0.04)(ASSOC 43 novalinha)novalinha))
     (ENTMOD novalinha)
     (command "offset" 0.08 (entlast) p1 "")
)

BIGAL

  • Swamp Rat
  • Posts: 1346
  • 40 + years of using Autocad
Re: Offset automatic - Help please
« Reply #2 on: September 23, 2023, 07:34:27 PM »
Look at the break point and do just that break at 2 points.
Offset the right hand pline
Draw a line from the top pline at an angle join to top pline
fillet line to new offset
trim new line to right of arc

Need to think about best way to approach task maybe pick 2 points.

Need a dwg so can see all of the pline.
« Last Edit: September 23, 2023, 07:53:11 PM by BIGAL »
A man who never made a mistake never made anything

fabiocosta81

  • Mosquito
  • Posts: 6
Re: Offset automatic - Help please
« Reply #3 on: September 23, 2023, 09:11:23 PM »
(DEFUN c:man ()

     (SETQ osnape (GETVAR "osmode"))
     (SETVAR "osmode" 0)
 
     (SETQ objeto (CAR (ENTSEL "\nSelecione o objeto: ")))

     (setq p1 (getpoint "\n-->Clique no lado do Afastamento: "))
     (command "offset" 0.08 objeto p1 "")

     (SETQ dadoslinha (entget (ENTLAST)))
     (SETQ novalinha (SUBST (CONS 8 "MANTA") (ASSOC 8 dadoslinha) dadoslinha))
     (SETQ novalinha (SUBST (CONS 43 0.04)(ASSOC 43 novalinha)novalinha))
     (ENTMOD novalinha)
     (command "offset" 0.08 (entlast) p1 "")

     (SETVAR "osmode" 1)
     (setq p2 (getpoint "\n-->Clique vértice da sobreposição Horizoltal: "))
     (setq p3 (getpoint "\n-->Clique vértice da sobreposição Vertical: "))
     (setq p4 (polar p3 (* 90 (/ pi 180)) 1))
     (setq p5 (list (+ (car p4)0.1)(+ (cadr p4)0.05)(caddr p4)))
     (setq p6 (list (- (car p4)0.02)(+ (cadr p4)0.05)(caddr p4)))

     (SETVAR "osmode" 0)
     (command "xline" "v" (polar p2 0 1)"")
     (command "xline" "h" p4 "")
     (command "xline" "h" (polar p3 (* 90 (/ pi 180)) 1.1)"")
     (command "trim" "f" "" p5 p6 "")
     (SETVAR "osmode" osnape)
)