Author Topic: Create a Hatch  (Read 1565 times)

0 Members and 1 Guest are viewing this topic.

Fabricio28

  • Swamp Rat
  • Posts: 670
Create a Hatch
« on: January 17, 2014, 06:57:39 AM »
Hi guys,

How Can I make a hatch with that dimension 0.625 x 1.25 meters??

Thank in advance.

Rob...

  • King Gator
  • Posts: 3824
  • Take a little time to stop and smell the roses.
Re: Create a Hatch
« Reply #1 on: January 17, 2014, 07:05:32 AM »
Draw a rectangle and hatch it?
CAD Tech

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Fabricio28

  • Swamp Rat
  • Posts: 670
Re: Create a Hatch
« Reply #3 on: January 17, 2014, 07:58:50 AM »
@ RobDraw
Thank you for suggestion. I'll try this out.

@ CAB
I don't know how to use that code to create my own hatch ( rectangle  0.625 x 1.25).
Maybe a lisp will be wonderful.

regards

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Create a Hatch
« Reply #4 on: January 17, 2014, 09:20:19 PM »
Start with this:
Code - Auto/Visual Lisp: [Select]
  1. (defun entmakex-hatch (L)
  2.  ;; By ElpanovEvgeniy
  3.  ;; 03.04.2007 10:03:51:
  4.   (apply
  5.    'append
  6.    (list
  7.     (list '(0 . "HATCH")
  8.           '(100 . "AcDbEntity")
  9.           '(410 . "Model")
  10.           '(100 . "AcDbHatch")
  11.           '(10 0.0 0.0 0.0)
  12.           '(210 0.0 0.0 1.0)
  13.           '(2 . "SOLID")
  14.           '(70 . 1)
  15.           '(71 . 0)
  16.           (cons 91 (length l))
  17.     ) ;_  list
  18.     (apply 'append
  19.     (mapcar '(lambda (a)
  20.              (apply 'append
  21.                     (list (list '(92 . 7) '(72 . 0) '(73 . 1) (cons 93 (length a)))
  22.                           (mapcar '(lambda (b) (cons 10 b)) a)
  23.                           '((97 . 0))
  24.                     ) ;_  list
  25.              ) ;_  apply
  26.             ) ;_  lambda
  27.             l
  28.     ) ;_  mapcar
  29.            )
  30.     '((75 . 0)
  31.       (76 . 1)
  32.       (47 . 1.)
  33.       (98 . 2)
  34.       (10 0. 0. 0.0)
  35.       (10 0. 0. 0.0)
  36.       (451 . 0)
  37.       (460 . 0.0)
  38.       (461 . 0.0)
  39.       (452 . 1)
  40.       (462 . 1.0)
  41.       (453 . 2)
  42.       (463 . 0.0)
  43.       (463 . 1.0)
  44.       (470 . "LINEAR")
  45.      )
  46.    ) ;_  list
  47.   ) ;_  apply
  48.  ) ;_  entmakex
  49. )
  50.  
  51.  
  52. (defun c:test (/ pt x y)
  53.   (setq pt '(100 150)) ; lower left corner
  54.   (setq x (car pt)
  55.         y (cadr pt)
  56.   )
  57.   (setq h (entmakex-hatch
  58.             (list (list pt
  59.                         (list x (+ y 1.25))
  60.                         (list (+ x 0.625) (+ y 1.25))
  61.                         (list (+ x 0.625) y)
  62.                   )
  63.             )
  64.           ) ;_  entmakex-hatch
  65.   ) ;_  setq
  66. )
  67.  
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Fabricio28

  • Swamp Rat
  • Posts: 670
Re: Create a Hatch
« Reply #5 on: January 20, 2014, 09:15:29 AM »
Thank you CAB,
I was trying to create a hatch with dimension (0,64x1,20).
Select the perimeter that I want to hatch and create rectangle in it.