| Author |
Message |
Dave R.
Guest
|
Posted:
Tue Jan 11, 2005 7:23 pm Post subject:
command line macros in mns files - how to do |
|
|
Can I put simple command line macros in a custom MNS file so they are
portable? If so what is the syntax?
For example if I wanted to map a command "str" to ^C^C^CSTRETCH;CP;
Thanks,
Dave R.
|
|
| Back to top |
|
 |
j buzbee
Guest
|
Posted:
Tue Jan 11, 2005 7:30 pm Post subject:
Re: command line macros in mns files - how to do |
|
|
How about in an ACADDOC.lsp file in the search path? It'll get loaded in
each drawing. Syntax could simply be:
(defun c:str( / )
(command "_.stretch cp ")(princ))
Note the spaces between stretch and cp.
jb |
|
| Back to top |
|
 |
Dave R.
Guest
|
Posted:
Tue Jan 11, 2005 7:49 pm Post subject:
Re: command line macros in mns files - how to do |
|
|
I would prefer the portability of an MNS if possible. For me it lessens the
impact of version upgrades and creating a mirror of my work setup at home.
- Dave R.
"j buzbee" <jdb@journeysendfarm.net> wrote in message
news:41e3e301$1_2@newsprd01...
| Quote: | How about in an ACADDOC.lsp file in the search path? It'll get loaded in
each drawing. Syntax could simply be:
(defun c:str( / )
(command "_.stretch cp ")(princ))
Note the spaces between stretch and cp.
jb
|
|
|
| Back to top |
|
 |
Dave R.
Guest
|
Posted:
Tue Jan 11, 2005 8:09 pm Post subject:
Re: command line macros in mns files - how to do |
|
|
jb,
I loaded your lisp macro into my acad2004doc.lsp but I get the following
error while trying to use it:
Command: str
_.stretch cp Unknown command "STRETCH CP ". Press F1 for help.
It doesn't look like it is executing the command then the subcommand
sequentially but both at the same time. I know nothing about lisp syntax so
I'm lost...
- Dave R.
"j buzbee" <jdb@journeysendfarm.net> wrote in message
news:41e3e301$1_2@newsprd01...
| Quote: | How about in an ACADDOC.lsp file in the search path? It'll get loaded in
each drawing. Syntax could simply be:
(defun c:str( / )
(command "_.stretch cp ")(princ))
Note the spaces between stretch and cp.
jb
|
|
|
| Back to top |
|
 |
ecable
Guest
|
Posted:
Tue Jan 11, 2005 8:18 pm Post subject:
Re: command line macros in mns files - how to do |
|
|
| Create your own menu and load that. Then create yourmenu.mnl to load your stuff. Use jb's example in yourmenu.mnl. |
|
| Back to top |
|
 |
ecable
Guest
|
Posted:
Tue Jan 11, 2005 8:20 pm Post subject:
Re: command line macros in mns files - how to do |
|
|
(defun c:str( / )
(command "_.stretch" "cp")(princ)) |
|
| Back to top |
|
 |
Tom Smith
Guest
|
Posted:
Tue Jan 11, 2005 8:28 pm Post subject:
Re: command line macros in mns files - how to do |
|
|
| Quote: | I loaded your lisp macro into my acad2004doc.lsp but ...
|
Dave, several points.
It's recommended that you don't modify the supplied acad2004doc.lsp. If
you're going to do this, create your own acaddoc.lsp as per the suggestion.
The syntax suggested doesn't work. It should be:
(defun c:str( / )
(command "_.stretch" "cp")
(princ)
)
The indentation doesn't matter, but note the use of quotation marks for each
separate string. You want to quote separately each thing that you would
enter at the command prompt. Without getting deeply into lisp, you can use
this as a template for other keyboard macros, such as:
(defun c:ze( / )
(command "_.zoom" "e")
(princ)
)
Finally, a good measure for portability might be to put such things in an
MNL file of the same base name as your MNS. The MNL will load automatically
when the menu loads. MNL's are intended to hold any lisps which are used by
the MNS file, but because of their automatic loading they can be used for
the same type things as the acaddoc.lsp file. |
|
| Back to top |
|
 |
Luis Esquivel
Guest
|
Posted:
Tue Jan 11, 2005 8:31 pm Post subject:
Re: command line macros in mns files - how to do |
|
|
Probably it is reffering to use sendcommand function, ie:
(defun C:STR ()
(vla-sendcommand
(vla-get-activedocument (vlax-get-acad-object))
"_.stretch cp "))
[&StretchIt]^C^CSTR
--
For free AutoLisp/Visual Lisp resources go to:
http://www.draftteam.com/free.php?&lang=en
"Dave R." <noSpam@please.com> wrote in message news:41e3ec2c_2@newsprd01...
| Quote: | jb,
I loaded your lisp macro into my acad2004doc.lsp but I get the following
error while trying to use it:
Command: str
_.stretch cp Unknown command "STRETCH CP ". Press F1 for help.
It doesn't look like it is executing the command then the subcommand
sequentially but both at the same time. I know nothing about lisp syntax
so
I'm lost...
- Dave R.
"j buzbee" <jdb@journeysendfarm.net> wrote in message
news:41e3e301$1_2@newsprd01...
How about in an ACADDOC.lsp file in the search path? It'll get loaded
in
each drawing. Syntax could simply be:
(defun c:str( / )
(command "_.stretch cp ")(princ))
Note the spaces between stretch and cp.
jb
|
|
|
| Back to top |
|
 |
j buzbee
Guest
|
Posted:
Wed Jan 12, 2005 4:02 am Post subject:
Re: command line macros in mns files - how to do |
|
|
yea yea yea - what he said
| Quote: | (defun c:str( / )
(command "_.stretch" "cp")(princ)) |
|
|
| Back to top |
|
 |
|
|
|
|