Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted

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.

Posted

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

Posted

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) "" "")

Posted

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

Posted

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

Posted

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.:D

 

I looked into command prefixes too. Thanks.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...