Layer Creation
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Layer Creation

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
KLYPH
Guest





Posted: Fri Apr 01, 2005 9:29 pm    Post subject: Layer Creation Reply with quote

A long time ago, my office wrote a lisp file which handles layers. For instance, if I type "cstn" it creates a layer "-NPLT-CONSTRUCTION" which has a color of "4" and a linetype of "Dashed2". If the layer already exists, it makes it current. The script reads "(defun c:cstn () (LAYSET "-NPLT-CONSTRUCTION" "4" "Dashed2")) Well, that was before we knew you could make a layer "non-plot." The "-layer" command shows a "Plot" option that offers a "Plot/No plot" option. When I try to add this to the end of the above lisp as "P" "N", I get the message "; error: too many arguments." Does this mean I can't make the layer a non-plot layer at its creation? Or am I just doing it wrong? Any help will be appreciated. Read Ya Later -KLYPH

Back to top
Jeff Mishler
Guest





Posted: Fri Apr 01, 2005 9:54 pm    Post subject: Re: Layer Creation Reply with quote

It means your lisp (layset) needs to be revised to allow for the plot/noplot
option. However, doing so may require ALL of your little stub calls like
this one to be modified to use the new (layset). Although, the (layset)
function maybe modified to check the value of the color you supply, in this
case 4, and if you provide a negative color number then create the layer as
a no plot.....just make sure that the (layset) function converts the color
to a positve or it will create the layer in the OFF state.

--
Jeff
check out www.cadvault.com
"KLYPH" <nospam@address.withheld> wrote in message
news:14105627.1112372977157.JavaMail.jive@jiveforum2.autodesk.com...
Quote:
A long time ago, my office wrote a lisp file which handles layers. For
instance, if I type "cstn" it creates a layer "-NPLT-CONSTRUCTION" which
has a color of "4" and a linetype of "Dashed2". If the layer already
exists, it makes it current. The script reads "(defun c:cstn () (LAYSET
"-NPLT-CONSTRUCTION" "4" "Dashed2")) Well, that was before we knew you
could make a layer "non-plot." The "-layer" command shows a "Plot" option
that offers a "Plot/No plot" option. When I try to add this to the end of
the above lisp as "P" "N", I get the message "; error: too many arguments."
Does this mean I can't make the layer a non-plot layer at its creation? Or
am I just doing it wrong? Any help will be appreciated. Read Ya
Later -KLYPH
Back to top
Marco Jacinto
Guest





Posted: Fri Apr 01, 2005 9:56 pm    Post subject: Re: Layer Creation Reply with quote

the routine LAYSET just accept 3 aguments, the layer name, color and
linetype, try to add the
new argument for the non plot property, but if you do this, all the
functions that make a call to layset, must have this aditional argument.

You can try another aproach with the -layer command

(defun c:cstn () (command "-layer" "make" "-NPLT-CONSTRUCTION"
"color""4""""Ltype" "Dashed2""" "plot" """n" "")(princ))

--
Saludos

Marco Jacinto

"KLYPH" <nospam@address.withheld> escribió en el mensaje
news:14105627.1112372977157.JavaMail.jive@jiveforum2.autodesk.com...
Quote:
A long time ago, my office wrote a lisp file which handles layers. For
instance, if I type "cstn" it creates a layer "-NPLT-CONSTRUCTION" which
has a color of "4" and a linetype of "Dashed2". If the layer already
exists, it makes it current. The script reads "(defun c:cstn () (LAYSET
"-NPLT-CONSTRUCTION" "4" "Dashed2")) Well, that was before we knew you
could make a layer "non-plot." The "-layer" command shows a "Plot" option
that offers a "Plot/No plot" option. When I try to add this to the end of
the above lisp as "P" "N", I get the message "; error: too many arguments."
Does this mean I can't make the layer a non-plot layer at its creation? Or
am I just doing it wrong? Any help will be appreciated. Read Ya
Later -KLYPH


Back to top
KLYPH
Guest





Posted: Tue Apr 05, 2005 12:47 am    Post subject: Re: Layer Creation Reply with quote

That works. Thanks. Read Ya Later -KLYPH
Back to top
KLYPH
Guest





Posted: Tue Apr 05, 2005 1:35 am    Post subject: Re: Layer Creation Reply with quote

One more question. When I load the file that contains the above lisp, the computer screen states:
Command: _appload Layers.lsp successfully loaded.
Command:
Loading Layers.lsp....
Error: malformed list on input"

Well, as scarey as that sounds, the newly loaded lisps all work. Of course, I still wish to solve whatever causes the error. Any ideas? Read Ya Later -KLYPH
Back to top
ZZZZzzzz4
Guest





Posted: Tue Apr 05, 2005 6:32 am    Post subject: Re: Layer Creation Reply with quote

Because of you lisp file is not valid, use Vlisp to correct you file,
Back to top
KLYPH
Guest





Posted: Tue Apr 05, 2005 6:25 pm    Post subject: Re: Layer Creation Reply with quote

Dear ZZZZzzzz4, thanks for your reply. I never knew of Vlisp. I had always double-clicked on it while in Explorer, which brings the lisp up in Notepad, which is black-&-white. The color groups in the Vlisp sure make it more readable. Again thanks. I am going to explore the features of Vlisp.
The line in the lisp file was originally: (defun c:cstn () (LAYSET "-NPLT-CONSTRUCTION" "4" "DASHED2"))
I changed it to: (defun c:cstn () (command "-layer""make""-NPLT-CONSTRUCTION""C""250""""L""DASHED2""""P""N""
""")(princ)) and got the error message. Do you see the error? The lisp does work. The Error message is scarey.
Any help is appreciated. Read Ya Later -KLYPH
Back to top
KLYPH
Guest





Posted: Tue Apr 05, 2005 11:16 pm    Post subject: Re: Layer Creation Reply with quote

Dear ZZZZzzzz4, again thanks for pointing out the Vlisp command. The lisp file was about 200 lines lone. I found a typo on about line 175. Fixed it. No more Error messages.
Again, thanks. Read Ya Later -Cliff
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Contact Us
Powered by phpBB