Author Topic: Close open areas in hatches where text was via lisp?  (Read 517 times)

0 Members and 1 Guest are viewing this topic.

dropurbritches

  • Mosquito
  • Posts: 2
Close open areas in hatches where text was via lisp?
« on: June 30, 2024, 05:28:27 AM »
Instead of dragging each vertex and closing each open area in the hatch, does anyone know of a faster way?  I will have hundreds of drawings with open areas where there was once text. Any help would be very much appreciated!

ribarm

  • Gator
  • Posts: 3327
  • Marko Ribar, architect
Re: Close open areas in hatches where text was via lisp?
« Reply #1 on: June 30, 2024, 10:08:20 AM »
First of all, with linear hatchings like you showed in picture, HATCHGENERATEBOUNDARY command won't work well like if there was SOLID hatchings. But it's on you to try to recreate boundary, you can also try it throungh HATCHEDIT command... When you get boundary, or if you already had them stored in some layer, good for you, but if you don't have them, consider overdrawing boundaries - perhaps with removing (erasing) old and using BPOLY with picking point - this is fastest method... Then go to BHATCH command, select boundary and use inherit properties from old perforated hatchings... When hatching created new hatch, select both back and top hatchings, use ERASE command and use "r" remove "l" last entity (hatch)... I doubt there is faster way to remedy openings from old texts...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube


Marco Jacinto

  • Newt
  • Posts: 50
Re: Close open areas in hatches where text was via lisp?
« Reply #3 on: July 01, 2024, 11:45:22 AM »
Try this code:
Code - Auto/Visual Lisp: [Select]
  1. ;;(f:hatch_removeislands [hatch object]) - remove *ALL* islands from a hatch object
  2.  
  3. (defun f:hatch_removeislands (en / elst at skip xlst)
  4. (setq elst (entget en))
  5. (while elst
  6. (setq at (car elst))
  7. ((= (car at) 75)
  8. (setq xlst (append xlst (list at))
  9. skip nil
  10. )
  11. )
  12. (skip)
  13. ((= (car at) 91)
  14. (setq xlst (append xlst (list (cons 91 1))))
  15. )
  16. ((= (car at) 97)
  17. (setq xlst (append xlst (list at))
  18. skip T
  19. );setq
  20. )
  21. (T
  22. (setq xlst (append xlst (list at)))
  23. )
  24. );cond
  25. (setq elst (cdr elst))
  26. );while
  27. (entmod xlst)
  28. (entupd en)
  29. en
  30. )
founded here: https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-inner-loop-from-a-hatch-object/td-p/1799618

edit @kerry : add AutoLisp code formatting tag [code=cadlisp-7]
« Last Edit: July 02, 2024, 05:12:46 PM by kdub_nz »