Tricam Posted November 8, 2024 Posted November 8, 2024 I have been trying to write something in Autolisp; however I keep getting an error, which I don't understand at all. In case of the code here, I would get error "bad function: (*coordinates provided by the getpoint function, that is highlighted bellow*) The error does not depend on the function placed on the spot, no matter the function I get the error with the name of the argument of said function, but I don't understand why. Could someone, please explain why this is the case? Thanks a lot. (if (eq (getkword "\nChceš to napsat? [Ano/Ne] <Ne>:") "Ano") ( (setq text_sour (getpoint "\n Kam chceš text?")) Any function placed here prompts the error, everything after procedes fine (initget "mm^2 m^2") (if (eq (getkword "\nVe čtverečních metrech nebo milimetrech? [m^2/mm^2] <mm^2>:") "m^2") (command "_text" text_sour "3" "0" plocham2);if m^2 (command "_text" text_sour "3" "0" plochamm2);if mm^2 );if );if ano );if The whole code: (defun c:otp (/ objekt) (setq uchstar (getvar "OSMODE")) ;úchyty (setq hladstar (getvar "CLAYER")) ;hladiny (setvar "OSMODE" 0) (command "_-layer" "y" "pomocné" "" "v" "n" "") (command "_-layer" "i" "pomocné" "") (command "_boundary" (getpoint "\nOkolo čeho chceš tu oblast?") "" ) (command "_region" "l" "") (setq objekt "l") (command "_area" "o" objekt) ;plocha krivky (setq plochamm2 (getvar "area")) ;v milimetrech ^2 (setq plocham2 (* plochamm2 0.000001)) ;prevod na metry (subteziste) ;ta subfce teziste (initget "Ano Ne") (if (eq (getkword "\nChceš to napsat? [Ano/Ne] <Ne>:") "Ano") ( (setq text_sour (getpoint "\n Kam chceš text?")) (initget "mm^2 m^2") (if (eq (getkword "\nVe čtverečních metrech nebo milimetrech? [m^2/mm^2] <mm^2>:") "m^2") (command "_text" text_sour "3" "0" plocham2);if m^2 (command "_text" text_sour "3" "0" plochamm2);if mm^2 );if );if ano );if (setvar "CLAYER" hladstar) (setvar "OSMODE" uchstar) (print "\nPředpokládá se kreslící jednotka = 1 mm. (Plocha v m^2 je řenásobená 10^-6)" ) ) Quote
BIGAL Posted November 9, 2024 Posted November 9, 2024 Try (if (eq (getkword "\nChceš to napsat? [Ano/Ne] <Ne>:") "Ano") (progn Quote
Tricam Posted November 10, 2024 Author Posted November 10, 2024 11 hours ago, BIGAL said: Try (if (eq (getkword "\nChceš to napsat? [Ano/Ne] <Ne>:") "Ano") (progn That works, thanks. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.