Message 1 of 5

Not applicable
05-26-2016
11:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys,
for the insert code i get the answer " error: bad argument type: stringp nil " . I tried to read it in the forum history but i didn't helped me.
(defun CreateEbeneLayer (Mc / :EntmakeLayer :AddLeadingZeros dlt i) (defun :EntmakeLayer (name color /) (if (not (tblobjname "LAYER" name)) (entmake (list '(0 . "LAYER") '(100 . "AcDbSymbolTableRecord") '(100 . "AcDbLayerTableRecord") (cons 2 name) (cons 62 color) '(70 . 0))))) (defun :AddLeadingZeros (a d / b) ;add zeros to 'd' many digits ;a string (strcat (substr "000000000" 1 (if (>= d (setq b (strlen (itoa (fix (atof a)))))) (- d b) 0)) a)) (setq dlt (/ 360. Mc) i 0.) (command "_pline") (setq winkel 0) (setq j 0) (while (< i 360) (:EntmakeLayer (setq layname (strcat "C" (:AddLeadingZeros (rtos i 2 0) 3) ; = x "-C" (:AddLeadingZeros (rtos (+ i 180) 2 0) 3) ; = y "-EBENE")) 7) ; color ;------------------------- progn( (setq zeile(read-line eulum)) (setq laenge(atof zeile)) (setq winkel(/(* i Dg PI) 180)) (setq sinuswert(sin winkel)) (setq cosinuswert(cos winkel)) (setq x-wert(* laenge cosinuswert)) (setq y-wert(* laenge sinuswert)) (setq punkt(list x-wert y-wert)) (command punkt) );PROGN (setq j (+ j Ng)) ;------------------------- (setq i (+ i dlt)) );WHILE (command "") (close eulum) (princ) ) ;-----------
Is there a debugging software for AutoLISP or does someone see the mistake in the code? By the way i think the mistake must be between the inner dotted line comment.
Solved! Go to Solution.