sadhu Posted March 23, 2010 Posted March 23, 2010 Where can I consult syntax format and parameters for autocad commands ? I intend to use them in lisp. e.g. (command "copy" ? "what parameters here ?".. ) (command "scale" ...) (command "move" ..) (command "zoom" .. ) etc .. Thanks Quote
ReMark Posted March 23, 2010 Posted March 23, 2010 There have been many requests regarding how to write lisp routines and best sources of information regarding same. You might want to try using the Search feature above. Quote
profcad Posted March 23, 2010 Posted March 23, 2010 Consult the AutoCAD Help file. Each command has a different set of options. You need to learn the command line version of the commands. Commands with dialog boxes cannot be automated with lisp. For example, if you type LAYER you get a dialog box or the palette. You can type -LAYER to get the command line equivalent. Quote
Lee Mac Posted March 23, 2010 Posted March 23, 2010 Sadhu, If you want to proceed using command calls, think about how you would perform the task that you want to code, and then note the actions/command entries that you use. Lee Quote
alanjt Posted March 23, 2010 Posted March 23, 2010 Command: CV COPY Select objects: Specify opposite corner: 1 found[color=Red] <-Selection Set[/color] Select objects: Current settings: Copy mode = Multiple Specify base point or [Displacement/mOde] <Displacement>: Specify second point or <use first point as displacement>: [color=Red]<- First Point[/color] Specify second point or [Exit/Undo] <Exit>:[color=Red]<-Second Point[/color] Just an example. Do not code it this way. (command "_.copy" (ssget) "" (getpoint) (getpoint) "" "") Quote
sadhu Posted March 24, 2010 Author Posted March 24, 2010 Does anyone use this in a lisp ? Is there a better way to do it ? (command "zoom" "w" pt1 pt3) "w" = window pt1 =first corner pt2 =second corner Quote
Lee Mac Posted March 24, 2010 Posted March 24, 2010 I'm not quite sure what you are asking, but you could prompt for the points using getpoint / getwindow and also remember to use command prefixes Lee Quote
sadhu Posted March 24, 2010 Author Posted March 24, 2010 I do a lot of measurements on large drawings and I need to jump from the first point clicked to last /other points clicked and so on. So I just added (command "zoom" "w" pt1 pt3) and this in my lisp - (command "zoom" "c" pt1 ) and it works fine - so far. The variables are passed directly in the routine. I looked into command prefixes too. 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.