Hello Everybody,
I wrote a program CFZ.lsp to draw cold-formed z-sections. When I executed the routine, a message appeared; error: bad argument type: numberp: nil. Could you please run the program and tell me how to fix it? Thank you very much for your help.
The Data list is 0 based, so I think you are 1 off in your nth calls.
Here is what I think you intend to do.
J Briggs
Code:
(foreach Data DataList
(princ "\n")(princ Data);This is to debug only
;nth 0 1 2 3 4
; (356 76 356 3.43 24.1);It prints this to command line
;more code...
;Then I changed the nths below and put in an "(atoi"
(setq FlangeDep (nth 2 Data))
(setq FlangeWth (atoi (nth 1 Data)))
(setq Thk (nth 3 Data))
(setq StiffDep (nth 4 Data))
;more code...
;Then here is where there's a problem with the offset.
(command "_.Pline" P7 "W" "0" "0" P6 P1 P2 P3 P4 "")
(command "_.Fillet" "R" Rad "_.Fillet" "Polyline" "L")
(setq E1 (entlast))
(command "_.Offset" Thk FlangeWth P8 "")
;I think it needs to be something like:
(command "_.Offset" Thk E1 SomePt "")
I think the command "_.Offset" line that I mentioned should be more like the following.
The (cadr es) below would be equal to '(175.0 200.0 0.0).
Meaning that you would supply the coordinates instead of an entity name.
J Briggs,
In my draft written (setq P7 (polar P6 (* pi 0.75) StiffDep)).
In the lisp I wrote (setq P7 (polar P6 (* pi 1.75) StiffDep)). I fix the number and the routine runs well as I expect. I greatly appreciate your help.