I've been using the same .lsp file for years to set my command macros. It's old-school, but I like it. I've carried this file across several types of jobs. I am now at a new job using Mechanical 2013. I would like to add a couple of the AM commands to my macros, but they won't work.
Example of one that works:
(defun C:D ( ) (command "DIST"))
A mechanical command that won't:
(defun C:SA ( ) (command "AMSCAREA"))
I have tried prefixing the command with underscore, period, hyphen, etc and still no dice. Does anyone know a way to call AM commands via LISP?
Thanks for any help
Solved! Go to Solution.
Solved by kefer_kb. Go to Solution.
Solved by hmsilva. Go to Solution.
Thanks for the reply. Sadly, it didn't work.
Any other suggestions out there?
jseefdrumr,
another attempt
using the ActiveX SendCommand method
(vl-load-com)
(vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) (strcat "AMSCAREA"))
Henrique
@jseefdrumr wrote:I've been using the same .lsp file for years to set my command macros. It's old-school, but I like it. I've carried this file across several types of jobs. I am now at a new job using Mechanical 2013. I would like to add a couple of the AM commands to my macros, but they won't work.
Example of one that works:
(defun C:D ( ) (command "DIST"))
A mechanical command that won't:
(defun C:SA ( ) (command "AMSCAREA"))
I have tried prefixing the command with underscore, period, hyphen, etc and still no dice. Does anyone know a way to call AM commands via LISP?
Thanks for any help
The documentation doesn't mention this, but on a few tests seems to me that the command and vl-cmdf functions only work for vanilla AutoCAD built-in commands and some but not all AutoCAD Mechanical commands.
- and none of my own commands created by (defun c:something ()...)
So, they probably just forgot adding the AMSCAREA command to the system.
The suggestion by kefer.kb works for me on AcadM 2012.
--
Thanks very much to Franz and Henrique. Using the (c:amscarea) method worked. Henrique suggested it originally, but I coded it incorrectly. Franz's post showed me the error I made that I overlooked. I am now up and rolling with my newly-macro'd AM commands. You guys rock!