CAD Forums > CAD General

Need help with lisp and DCL file (enclosed)

(1/5) > >>

TJAM51:
I am receiving the following error message :


Command: dh
Error: bad argument type: stringp 1; error: An error has occurred inside the
*error* functionAutoCAD variable setting rejected: "filletrad" nil

The DCL file and lisp code are below.......need help figuring this out.

Thanks

DCL Code

dhatch : dialog {
label = "Quick Hatch" ;
: list_box {
label = "Choose Pattern:";
key = "selections";
}
: edit_box {
key = "eb1";
edit_limit = 5;
edit_width = 6;
label = "Hatch Scale:";
}
ok_cancel ;
}



LSP Code:

(defun C:dh (/ hlist dcl_id hat htch usercmd p1 p2 p3 p4 rb ang)
;Make 2D point from 3D point
(defun 3dP->2dP (3dpt) (list (car 3dpt) (cadr 3dpt)))


(setq hlist '("ANSI31" "ANSI32" "ANSI37" "ANSI38" "AR-CONC" "AR-SAND" "DASH"))

(setq dcl_id (load_dialog "dhatch.dcl"))
(if (not (new_dialog "dhatch" dcl_id))(exit))

(start_list "selections")

(mapcar 'add_list hlist)

(end_list)

(if(= hs nil)(setq hs 1))
(set_tile "eb1" hs)

(action_tile
"accept"
"(setq hat (atof (get_tile \"selections\")))
(setq hs (get_tile \"eb1\"))
(done_dialog) (setq userclick T)")

(action_tile
"cancel"
"(done_dialog) (setq userclick nil)")

(start_dialog)
(unload_dialog dcl_id)
(if userclick

(progn
(setq htch (fix hat))
(setq htch (nth htch hlist))
(if(= hs "")(setq hs "1"))
(setvar "hpscale" (atoi hs))



(setq usercmd (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(prompt "\nPick boundry points to hatch")
(setq p1 (getPoint "\nPick first point:")
p2 (getPoint p1 "\nPick along Pipe first:")
p3 (getPoint p2 "\nPick across Pipe:")
p1 (3dP->2dP p1)
p2 (3dP->2dP p2)
p3 (3dP->2dP p3)
p4 (polar p1 (angle p2 p3) (distance p2 p3))
RB "N" ; Retain Border

ang (* 180.0 (/ (+ (angle p1 p2) (* pi 0.5)) pi))
)
(command "_.hatch" htch "" ang "" RB p1 p2 p3 p4 "close" "")
(setvar "CMDECHO" usercmd)
(princ)))
)
(prompt "\nPipe Hatch routine loaded. Enter PipeH3 to run.")
(Princ)

Keith™:
See the resolution on the other forum you posted to. Also you should know that the same people that visit the other forum also visit here. You should not be impatient in receiving answers. A single post resolves the answer most of the time. Also it helps to make use of the code designations when you post your code...

Example...

--- Code: ---
this is code

--- End code ---

daron:
TJAM, let me introduce you to the lisp forum here.
http://www.theswamp.org/phpBB2/viewforum.php?f=2
Not to sound rude, but that is where things of this nature should be. We've set up a whole bunch of forums so that nobody has to search through 100 pages of unrelated topics to get to the one they are looking for. I realize that you're a fairly new poster here and that is why I'm telling you this. Cad General is for non-programming related questions, Vlisp Hackers is for lisp coding questions and show your stuff is for those who'd like to show off what they've written. Thanks for understanding and I hope you come back more often.

Mark:
Looks like something to do with the .dcl code but I'm missing it!

Keith™:
Mark it is the value of hs that is causing the problem. It is being set to an integer, then he is trying to put it into a text_box control in the dcl. It must be a string.

Navigation

[0] Message Index

[#] Next page

Go to full version