Search the Community
Showing results for tags 'argument'.
-
error: bad argument type: 2D/3D point: nil (Makes no sense!)
duanuys posted a topic in AutoLISP, Visual LISP & DCL
Here is the code, and i tried commenting it so it is easy to follow, in a nutshell all this is doing is creating a circle, hatching it with the color red, and making a line from the center upwards and making it red.. Now it runs all of this perfectly smoothly.. but when i copy and paste the exact code block that generates the line going up and just change some variables so that the line goes down.. it gives me the error in my title.. what gives?? ((= choice 2) (setq gas_redo 0) (setq gas_another 0) (while (/= gas_redo 1) (prompt "\nYou have chosen Gas") (setq pg_cpo1 (getpoint "\nPick well location")) (setq pg_cpo2 (polar pg_cpo1 (dtr 90.0) edge)) (command "circle" "2p" pg_cpo1 pg_cpo2) ;draw circle (setq pg_hw (polar pg_cpo1 (dtr 90.0) (/ edge 2))) (command "-hatch" pg_hw "P" "S" "CO" "T" "255,0,0" "" ""); hatch the circle with COLOR_RED (setq pg_NL1 (polar pg_cpo1 (dtr 90.0) edge)) ;set points for north line (setq pg_NL2 (polar pg_NL1 (dtr 90.0) (/ edge 2))) ; " " (command "line" pg_NL1 pg_NL2 "") ; drew line north of circle (command "change" pg_NL2 "" "P" "CO" "T" "255,0,0" ""); changed the line color to red (setq pg_SL1 (polar pg_cpo1 (dtr 270.0) edge)) ;IT DOESN"T LIKE THIS CODE BLOCK (setq pg_SL2 (polar pg_SL2 (dtr 270.0) (/ edge 2))) (command "line" pg_SL1 pg_SL2 "") (command "change" pg_SL2 "" "P" "CO" "T" "255,0,0" "") (setq gas_another(getint "\nCreate another? (1)YES or (2)NO")) (if (= gas_another 2) (setq gas_redo 1) (prompt"\nDrawing another Gas Well..")) ) ) -
What is wrong with this code? (; error: bad argument type: stringp)
Perifanos posted a topic in AutoLISP, Visual LISP & DCL
(defun C:Heatest() (Princ "Define Area:") (Command "area") (while (= 1 (getvar "cmdactive")) (command pause) ) (setq A (getvar "area")) (princ A) ) -
Why is this not working? I tried serching for the answer online but I didn't find anything that helped. When I run the lisp routine, it gives me this "bad argument type: numberp: "30"" the 30 is the user entered Original Scale. ; CORRECT SCALE OF OBJECT (DEFUN C:FXS () (setq DS (getvar 'dimscale)) (setq OS (getstring "\nOriginal Scale: ")) (PROMPT "\nPick object to SCALE : ") (setq A (ssget)) (setq DST (rtos DS 2 4)) (setq OST (rtos OS 2 4)) (SETQ SF (/ DST OST)) (COMMAND "scale" A "" PAUSE SF) (princ) )
-
Mapcar shortcoming or my knownledge deficiency?
Ahankhah posted a topic in AutoLISP, Visual LISP & DCL
Hi, as most of you know, the syntax of mapcad function is as following: (mapcar [i]function [/i][i]list1[/i]... [i]listn[/i]) My question can be explained after showing these two examples: (mapcar 'strcase '("a" "B" "c" "D")) returns: ("A" "B" "C" "D") (mapcar 'strcase '("a" "B" "c" "D") '(T T T T)) returns: ("a" "b" "c" "d") Is any method to pass repeated objects (here T as the socond argument) to mapcar just one time?