Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AutoLISP Routine won't work in AutoCAD 2010+ but worked before

6 REPLIES 6
Reply
Message 1 of 7
jameslitvak
671 Views, 6 Replies

AutoLISP Routine won't work in AutoCAD 2010+ but worked before

I found a simple LSP routine to make an easy shortcut for Mid Between Two Points OSnap override during commands. It was:

 

(defun c: ()

(princ "_mtp")

)

 

Then when I drew a line, pasted an object, etc, during the command I typed in '' (two apostrophes, not a single quotes) and it would enter "_mtp" for me, thus a much quicker entry than running my hand all over the keyboard. It worked in Autocad 2007 and 2008. It does not work on Autocad 2010 or 2011. Did anything change with AutoLISP in the Autocad 2010+ releases? 

6 REPLIES 6
Message 2 of 7
scottbolton
in reply to: jameslitvak

"_m2p"

 

I prefer Shift+right-click myself.

Message 3 of 7
jameslitvak
in reply to: scottbolton

"_m2p" and "_mtp" are the same thing. The issue is getting it to work. I used to be able to use this LSP routine in AutoCAD 2007-08 and during a command could press "apostrophe-apostrophe" and it would snap to Mid Between 2 Points.

Message 4 of 7
Patchy
in reply to: jameslitvak

It works with 2010 without a problem.

Message 5 of 7
jameslitvak
in reply to: Patchy

I typed this into AutoCAD 2010:

 

(defun c: ()(princ "_m2p"))

 

The command line showed:

 

C:

 

So the routine was loaded, but the command still doesn't work. Patchy, did you load a .lsp file with exactly that in it?

Is there a lsp setting in ACAD that I'm missing maybe?

Message 6 of 7
Patchy
in reply to: jameslitvak

I copied and pasted the code you posted into the command line of 2010, typed double ' marked and it works as short cut of m2p.

 

 

(defun c: ()

(princ "_mtp")

)

Message 7 of 7
jameslitvak
in reply to: Patchy

Dang. It's not working. I'm actually on AutoCAD 2011, but it should be the exact same, because AFAIK they didn't change anything between 10 and 11. Oh well. I changed the CTRL+Click to be this command. As it is, my SHIFT+Click and CTRL+SHIFT+Click commands are not working. Sometimes I'm astounded by how things don't work on one computer but do on another. 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost