Exchange Forum > Dcl Dialogs
Request Help! Cold-Formed Z-Sections
Request Help! Cold-Formed Z-Sections

#1

Theodorus Winata
Join Date:
11-15-2007
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.
 
Regards,
Theodorus Winata

Attachments  CFZ.dcl    CFZ.lsp  
Request Help! Cold-Formed Z-Sections

#2

J Briggs
Join Date:
07-25-2007
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 "")
Request Help! Cold-Formed Z-Sections

#3

Theodorus Winata
Join Date:
11-15-2007
J Briggs,
Thanks for your invaluable help to fix the problem. Now I have to work on the geometry of the Z-section, because it draws a weird Z-section.
 
Regards,
 
Theodorus Winata
Request Help! Cold-Formed Z-Sections

#4

J Briggs
Join Date:
07-25-2007
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.
 
Code:
Command: (setq es (entsel))
Select object: = (<Entity name: 7ea9b8c8> (175.0 200.0 0.0))
Command: (setq pt (getpoint)) = (180.0 200.0 0.0)
Command: (command "_.Offset" 5 (cadr es) pt "")
Request Help! Cold-Formed Z-Sections

#5

Theodorus Winata
Join Date:
11-15-2007
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.
 
Theodorus Winata