Glad you got it sorted.
FWIW, you should localize your variables in you code like so:
(defun c:elptlw ( / ELEMENTO_N ENT LISTA_ENT MARGEN_ERROR NUEVALISTA_PT OBJ PT)
Never can have good enough Searchfoo Skills but is will take a little time to do this.
I am looking for something that is cost effective (including the free programs)
Something for the individual user that is not going to make a profit.
Thank you,
Sorry for not getting back to you sooner. That is what I was going for and I think I figured it out.
(defun c:sav (/ cpy sub)
(setq sub (strcat "ExportToAutoCAD-" (substr (rtos (getvar "CDATE") 2 0) 1)))
(cond
((zerop (getvar 'dwgtitled))
(princ "\nCurrent drawing is unsaved.")
)
((not (or (findfile (setq sub (strcat (getvar 'dwgprefix) sub))) (vl-mkdir sub)))
(princ (strcat "\nUnable to create directory " sub))
)
((progn
(princ "\nSaving current drawing...")
(command "_.qsave")
(setq cpy (strcat sub "\\" (substr (rtos (getvar "CDATE") 2 0) 1) "-ACAD-" (getvar 'dwgname)))
(if (findfile cpy)
(vl-cmdf "_.-exporttoautocad" "_F" "2010" "" cpy "_Y")
(vl-cmdf "_.-exporttoautocad" "_F" "2010" "" cpy)
)
)
)
(princ (strcat "\nUnable to expot drawing to: " cpy))
)
((princ (strcat "\nDrawing exported to: " cpy)))
(princ)
)
Thank you again for all your help!!!
Suppose this is your geometry:
When you're done, use the AUTOCONSTRAINT command (or optionally go here).
Go to Settings first, check the Coincident, Parallel, Tangent and Concentric while leaving the rest unchecked:
Click OK and select the whole red and white curves and enter.
Now you can move the white lines and the red ones will follow.
You can try this to remove duplicate vertices. Probably won't work on polylines that have bulges and did not fix the error in your sample drawing when creating the region.
(defun c:foo (/ a f o p r s)
;; RJP » 2021-08-02
;; Remove duplicate polyline vertexes
(cond ((setq s (ssget ":L" '((0 . "LWPOLYLINE"))))
(foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s)))
(setq p (vlax-get (setq o (vlax-ename->vla-object e)) 'coordinates)
r nil
f nil
)
(while (cadr p)
(setq r (cons (setq a (mapcar '+ p '(0 0))) r)
p (cddr p)
)
(while (equal a (mapcar '+ p '(0 0)) 1e-8)
(setq f (setq p (cddr p)))
(print "Duplicate Vertex Removed")
)
)
(and f (vlax-put o 'coordinates (apply 'append (reverse r))))
)
)
)
(princ)
)