Where is place I can find lisp's form of autocad command

Where is place I can find lisp's form of autocad command

Anonymous
Not applicable
2,353 Views
9 Replies
Message 1 of 10

Where is place I can find lisp's form of autocad command

Anonymous
Not applicable

I tried but seem there no where I can find a document about how to convert cad command to lisp command. I can't learn to do lisp if I do not know how to use even a simple line "line" command. how to manager single a point or change their atribute( x,y,z).

 

People introduce how lisp function word in lisp, I can get i.  How cad commands word in cad, I can get it too. But too bad I seem can't find a way to connect them together. Just how the cad command work in lisp, every single command?

 

Please help. I'm just a noob try to learn lisp.

 

Sr for my bad English.

0 Likes
Accepted solutions (1)
2,354 Views
9 Replies
Replies (9)
Message 2 of 10

SeeMSixty7
Advisor
Advisor

Autodesk seems to have moved most of the documentation to online.

One easy way to get there is to type in VLIDE (Visual Lisp Integrated Development Environment) Then hit F1 or click on Help.

 

Also check out afralisp.net a great resource for learning lisp.

 

Some quick ones for you

 

; this one will draw a 1 unit box from 0,0,0

(command "LINE" "0,0,0" "1,0,0" "1,1,0" "0,1,0" "C")

 

;This line prompts the user for a start point and stores it in a variable called pt1

(setq pt1 (getpoint "\nSelect start point:"))

 

;This line prompts the user for a end point and stores it in a variable called pt2

(setq pt2 (getpoint "\nSelect end Point:"))

;This command takes the two point variables and uses the command function to draw a line with them

(command "LINE" pt1 pt2 "")

 

Good luck.

0 Likes
Message 3 of 10

Anonymous
Not applicable

thank so much for reply, I will check it as soon as I have time. Again thank so much

0 Likes
Message 4 of 10

Anonymous
Not applicable

Still can't find something more clear. Your Example very clear: like "line" command's form can be definited by [ command "line" point1 point2 pointn ]

 

But I can't find something similar like that at vlisp's help.

 

Do they even exist?

0 Likes
Message 5 of 10

Ranjit_Singh
Advisor
Advisor

See here AutoLISP Command Reference check out under C functions for function command

0 Likes
Message 6 of 10

Anonymous
Not applicable

not that I want, thanks anyway 😞

0 Likes
Message 7 of 10

Anonymous
Not applicable

Vla-sendcommand or vla-addline

0 Likes
Message 8 of 10

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

... no where I can find a document about how to convert cad command to lisp command. I can't learn to do lisp if I do not know how to use even a simple line "line" command. how to manager single a point or change their atribute( x,y,z).

....


Those are two very different things.

 

For the first one, @Ranjit_Singh's suggestion was appropriate, and here is Help for the (command) function in 2016 [though I don't think anything about it has changed in many years].  In newer versions, there's also a (command-s) function that you should also read about.

 

For the second one, more information is needed.  By a "point," do you mean a Point entity, or a User-picked point location?  By changing their attributes [coordinates is the better word for XYZ values], do you mean something like calculating different values for some of them, or actually Moving something?

Kent Cooper, AIA
0 Likes
Message 9 of 10

SeeMSixty7
Advisor
Advisor
Don't Let the name VLISP confuse you. VLISP was essentially a long needed expansion to the AutoLISP functionality and was incorporated into AutoLISP. VLISP and AutoLISP are all part of the same tool set now, granted you may need to vl-load-com to make sure VLISP is loaded. The documentation is all part of the same system now. Most of the VLISP specific stuff can be found under the V function list in the reference that Ranjit sent you the link for. The VLIDE is just an environment for helping develop AutoLISP. I hope that helps clear things up for you.
0 Likes
Message 10 of 10

john.uhden
Mentor
Mentor
Accepted solution
The (command) function invokes any of AutoCAD's built-in commands. To learn how to use it, at the AutoCAD command prompt just type in the command in which you are interested and follow all the prompts (in order). Your responses (in order) are what you provide to the command. Of course it gets more complex by using a gazillion AutoLisp functions to help you provide what input the command is expecting. And of course you can create your own AutoLisp command functions that can call AutoCAD commands and provide them the input you would otherwise have to enter manually.

The AutoLisp and Visual Lisp help really isn't a tutorial on how to put it all together, but this forum can be your tutor.. Browse around looking at the questions and answers generously donated by true wizards. Then ask your own specific questions and have the wizards answer them. It's always fun to see one wizard trying to one-up his colleague. It makes us all a little better.

John F. Uhden

0 Likes