Message 1 of 34
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
HI
I have the following code, but the Problem is it works only for one hatch. If I select more than one, then only the last selected one changes.
What can I do?
(defun c:<Test5 ( / *error* layr cmd SPIhatch) (defun *error* (errmsg) (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break")) (princ (strcat "\nError: " errmsg))) (setvar 'CLAYER layr) (setvar 'CMDECHO cmd) (command-s "_.undo" "_end") (princ "\n")) ;------------------------------------------------ (setq layr (getvar 'CLAYER) cmd (getvar 'CMDECHO)) (setq SPIhatch (ssget "I")) (if (not SPIhatch) (progn (command "_.undo" "_begin") (setvar 'CMDECHO 0) (command "_.-LAYER" "_m" "-I-Schraffur" "_co" "8" "-I-Schraffur" "") (setvar 'HPNAME "NET") (command "_.-bhatch" "_l" "-I-Schraffur" "_p" "NET" "2" "0" "_a" "_h" "_y" "_a" "_y" "" "_co" "bylayer" "_n" "") (setvar 'CMDECHO 1) (command "_.-bhatch") (while (> (getvar "cmdactive") 0) (command pause)) (setvar 'CLAYER lay) (setvar 'CMDECHO cmd) (command "_.undo" "_end") (prin1)) (progn (command "_.undo" "_begin") (command "_.-LAYER" "_m" "-I-Schraffur" "_co" "8" "-I-Schraffur" "") (command "_.-hatchedit" SPIhatch "_p" "NET" "2" "0") (command "_.-hatchedit" SPIhatch "LA" "-I-Schraffur") (setvar 'CLAYER layr) (setvar 'CMDECHO cmd) (prompt "\nSchraffur angepasst und auf Layer -I-Schraffur gewechselt!") (command "_.undo" "_end") (princ)) ) ) ;_ end of defun
Solved! Go to Solution.