Author Topic: Another hatch lisp  (Read 3370 times)

0 Members and 1 Guest are viewing this topic.

TJAM51

  • Guest
Another hatch lisp
« on: March 16, 2005, 03:16:43 PM »
The routine below only allows a single pick of lines.....I need some assistance in where it will do a crossing as well as a single pick....

Thanks


(defun c:h (/ sSet *error*)
(defun *error* (msg)
(setvar "cmdecho" 1)
); end *error*
(setvar "cmdecho" 0)
(princ "*** Select objects for Hatch & press [Enter] ")
(terpri)
(command "hatch" "" "" "")
(while (= 1 (getvar "cmdactive"))
(command pause)
); end while
(command "")
(princ)
)

TJAM51

  • Guest
Another hatch lisp
« Reply #1 on: March 16, 2005, 10:16:56 PM »
I could use some help on this....

thanks

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Another hatch lisp
« Reply #2 on: March 17, 2005, 12:15:26 AM »
This will get you started.
Code: [Select]
(defun c:h (/ ss)
  (setvar "cmdecho" 0)
  (prompt "\n*** Select objects for Hatch & press [Enter] ")
  (if (and (setq ss (ssget))
           (> (sslength ss) 0))
    (command "hatch" "" "" "" ss "")
  )
  (princ)
)
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.

TJAM51

  • Guest
Another hatch lisp
« Reply #3 on: March 18, 2005, 07:58:09 AM »
When I load the routine I receive the following error message.....



error: malformed list on input

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Another hatch lisp
« Reply #4 on: March 18, 2005, 08:07:41 AM »
Just missing a closing parenthesis after the local declarations, try this --

Code: [Select]
(defun c:h (/ ss)
    (setvar "cmdecho" 0)
    (prompt "\n*** Select objects for Hatch & press [Enter] ")
    (if (and
            (setq ss (ssget))
            (> (sslength ss) 0)
        )
        (command "hatch" "" "" "" ss "")
    )
    (princ)
)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Another hatch lisp
« Reply #5 on: March 18, 2005, 08:10:14 AM »
Thanks MP, I added it to my post too. :)
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.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Another hatch lisp
« Reply #6 on: March 18, 2005, 08:11:28 AM »
My pleasure. :)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst