Search the Community
Showing results for tags 'initget'.
-
create dropdown menu in autocad to select commands
Manuel_Kunde posted a topic in AutoLISP, Visual LISP & DCL
Hi all, I am trying to write a lisp that will create a DropDown list in Autocad. With the selection from the fields I want to execute different commands that I have defined before. (defun c:create_dropdown () (setq choise1 command1) (setq choise2 command2) (setq choise3 command3) (setq choise4 command4) (strcase (initget (getkword [choise1/choise2/choise3/choise4])))) ) -
Hello everyone! So, i am doing a school project in which i want to select all circles of a given radius and then move them all in the arithmetic mean of all centers. The arithmetic mean is no problem, everything works fine, till i add the "more complex" filter. Here is the part of the code: (initget 7) (setq radius (getint "\nEnter radius: ")) (setq ss (ssget "X" '((0 . "CIRCLE") (-4 . "=") (40 . radius)))) The thing is, when i swap (40 . radius) with, lets say, (40 . 10)... it works for all circles with the radius equal to 10. But i want to give the radius by keyboard. And i get the error from the title. Also... if i put a (princ radius) before the filter, it shows me the value of radius.
-
How do I make one selection automatic with getkword?
jeremyearle5 posted a topic in AutoLISP, Visual LISP & DCL
I want to make the insert option happen by just pressing enter in the following code: (defun c:mak521 () (if (/= (tblsearch "block" "521") nil) (progn (beep) (initget 1 "Yes No INsert") (prompt "\n521 has already been created.") (setq x (getkword "\nInsert 521 at 0,0 or redefine it? [Yes/No] <INsert>: ")) (cond ((= x "Yes") (mak521)) ((= x "No") (exit)) ((= x "INsert") (ins521)) How can I do this? -
Hi friends, is it possible to add behaviors defined by (initget) function to (ssget) (As most of you know, it is possible for other input functions such as (entsel), (entselp), (getpoint), ...) An example is like this: I appreciate any help