TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: jtm2020hyo on February 22, 2019, 10:50:24 PM

Title: create a boundary around solid hatch
Post by: jtm2020hyo on February 22, 2019, 10:50:24 PM
I need to create a boundary around all solid hatch inside the drawing (nested/dynamic/regular blocks and external solid hatch)

Title: Re: create a boundary around solid hatch
Post by: CAB on February 23, 2019, 07:32:17 AM
https://goo.gl/CZCXUx
Title: Re: create a boundary around solid hatch
Post by: Crank on February 23, 2019, 09:42:44 AM
https://jtbworld.com/autocad-hatchb-lsp (https://jtbworld.com/autocad-hatchb-lsp)
Title: Re: create a boundary around solid hatch
Post by: jtm2020hyo on February 24, 2019, 11:31:46 AM
https://jtbworld.com/autocad-hatchb-lsp (https://jtbworld.com/autocad-hatchb-lsp)


I tried "HATCHB.LSP Free AutoLISP for AutoCAD" but I actually does not work with SOLIDs
Title: Re: create a boundary around solid hatch
Post by: jtm2020hyo on February 24, 2019, 11:34:07 AM
https://goo.gl/CZCXUx

0 results for a lisp-routine to generate  BOUNDARY polyline around a SOLID
Title: Re: create a boundary around solid hatch
Post by: ronjonp on February 24, 2019, 07:36:31 PM
I need to create a boundary around all solid hatch inside the drawing (nested/dynamic/regular blocks and external solid hatch)
You asked for boundary around solid hatch then asked for boundary around a solid? Which is it?
Title: Re: create a boundary around solid hatch
Post by: jtm2020hyo on February 25, 2019, 09:29:18 AM
I need to create a boundary around all solid hatch inside the drawing (nested/dynamic/regular blocks and external solid hatch)
You asked for boundary around solid hatch then asked for boundary around a solid? Which is it?


mmm... it's not the same?
Title: Re: create a boundary around solid hatch
Post by: ronjonp on February 25, 2019, 09:42:12 AM
I need to create a boundary around all solid hatch inside the drawing (nested/dynamic/regular blocks and external solid hatch)
You asked for boundary around solid hatch then asked for boundary around a solid? Which is it?


mmm... it's not the same?
A SOLID is different object than a SOLID hatch.
Title: Re: create a boundary around solid hatch
Post by: jtm2020hyo on February 27, 2019, 09:11:23 AM
my request is for the SOLID.

I need to generate polyline around SOLID in nested blocks and find another code-routine to delete them all.
Title: Re: create a boundary around solid hatch
Post by: hmspe on February 27, 2019, 05:12:57 PM
Perhaps post #3 in http://www.theswamp.org/index.php?topic=45099.msg502994#msg502994
Title: Re: create a boundary around solid hatch
Post by: ronjonp on February 28, 2019, 11:48:10 AM
Here's a version of that code without command calls. If you want it to work on your example drawing at the Autodesk forum, explode all your blocks.
https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/create-a-boundary-around-solid-hatch/m-p/8619452#M381543
Code - Auto/Visual Lisp: [Select]
  1. (defun c:foo (/ a b c d s)
  2.   ;; RJP » 2019-02-28
  3.   ;; Trace solids and delete
  4.   (if (setq s (ssget ":L" '((0 . "solid"))))
  5.     (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s)))
  6.       (setq a (vl-remove-if-not '(lambda (x) (vl-position (car x) '(10 11 12 13))) (entget e)))
  7.       (mapcar 'set '(a b c d) (mapcar 'cdr a))
  8.       (entmakex (list '(0 . "LWPOLYLINE")
  9.                       '(100 . "AcDbEntity")
  10.                       (assoc 8 (entget e))
  11.                       '(100 . "AcDbPolyline")
  12.                       '(90 . 4)
  13.                       '(43 . 0)
  14.                       '(70 . 1)
  15.                       (cons 10 a)
  16.                       (cons 10 b)
  17.                       (cons 10 d)
  18.                       (cons 10 c)
  19.                       (assoc 210 (entget e))
  20.                 )
  21.       )
  22.       (entdel e)
  23.     )
  24.   )
  25.   (princ)
  26. )
Title: Re: create a boundary around solid hatch
Post by: Dilan on March 11, 2019, 04:19:11 AM
Link to source code.https://jtbworld.com/autocad-hatchb-lsp
Note that code with a copy write should not be posted without the authors permission.Please post a link to the source instead.
Title: Re: create a boundary around solid hatch
Post by: jtm2020hyo on March 21, 2019, 04:41:00 PM
Perhaps post #3 in http://www.theswamp.org/index.php?topic=45099.msg502994#msg502994


In your link, I found the solution for solid...

...but what about SOLIDs in NESTED BLOCKs, Dynamics BLOCKS and Regular blocks?