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

Layer descriptions - Adding via lisp - Not working quite right, help please.

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
207 Views, 4 Replies

Layer descriptions - Adding via lisp - Not working quite right, help please.

Hello everyone. I have found some code on this NG and have used it in a
lisp that I have created to add descriptions to all of my standard layers.
I have it working for the most part. It adds the descriptions to all of the
layers like I want, BUT it also adds one of the descriptions to the
"Defpoints" layer, which I do not have defined in the code anywhere. I
can't figure out why this is happening. Could someone take a look at my
code and try to figure out what I have done incorrectly?

On a side note, this lisp routine will go into one lisp file that contains
all of my lisp routines. The "cond" function in this routine is very long,
is there a way to have just the "cond" function in a seperate file and have
this routine call that file for that section of the routine?

--
Thanks in advance,
Jake Pitcher
Autocad 2007
Windows XP Pro
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

Sorry, forgot to attach the routine. Also attached is my layer states file
(.las) which includes all of my standard layers.

--
Thanks,
Jake Pitcher
Autocad 2007
Windows XP Pro


"Jake Pitcher" wrote in message
news:5471559@discussion.autodesk.com...
Hello everyone. I have found some code on this NG and have used it in a
lisp that I have created to add descriptions to all of my standard layers.
I have it working for the most part. It adds the descriptions to all of the
layers like I want, BUT it also adds one of the descriptions to the
"Defpoints" layer, which I do not have defined in the code anywhere. I
can't figure out why this is happening. Could someone take a look at my
code and try to figure out what I have done incorrectly?

On a side note, this lisp routine will go into one lisp file that contains
all of my lisp routines. The "cond" function in this routine is very long,
is there a way to have just the "cond" function in a seperate file and have
this routine call that file for that section of the routine?

--
Thanks in advance,
Jake Pitcher
Autocad 2007
Windows XP Pro
Message 3 of 5
dgard
in reply to: Anonymous

Since you are cycling through all the layers you are grabing the defpoint layer and all other layers for that matter. Then you are only checking for various layers to set your description variable. However, you assign the description using the (vla-put-description LISTENTITY2 ENTDESC) it assigns the last used descript to a layer even if that layer was not your desired target. You just need to reset the ENTDESC variable.

Change your true cond to:
(t (setq entdesc ""))

It worked for me.

You could separate the routines, but I am not a fan of this from a management perspective. However, all you have to do is set it up as a function using the (defun conditionfunctionname ()). Then load the routine in your application (load "condition.lsp") and then call the function (conditionfunctionname).
Message 4 of 5
Anonymous
in reply to: Anonymous

That did the trick, thanks a bunch.

--
Thanks,
Jake Pitcher
Autocad 2007
Windows XP Pro


wrote in message news:5471664@discussion.autodesk.com...
Since you are cycling through all the layers you are grabing the defpoint
layer and all other layers for that matter. Then you are only checking for
various layers to set your description variable. However, you assign the
description using the (vla-put-description LISTENTITY2 ENTDESC) it assigns
the last used descript to a layer even if that layer was not your desired
target. You just need to reset the ENTDESC variable.

Change your true cond to:
(t (setq entdesc ""))

It worked for me.

You could separate the routines, but I am not a fan of this from a
management perspective. However, all you have to do is set it up as a
function using the (defun conditionfunctionname ()). Then load the routine
in your application (load "condition.lsp") and then call the function
(conditionfunctionname).
Message 5 of 5
Anonymous
in reply to: Anonymous

That did the trick, thanks a bunch.

--
Thanks,
Jake Pitcher
Autocad 2007
Windows XP Pro


wrote in message news:5471664@discussion.autodesk.com...
Since you are cycling through all the layers you are grabing the defpoint
layer and all other layers for that matter. Then you are only checking for
various layers to set your description variable. However, you assign the
description using the (vla-put-description LISTENTITY2 ENTDESC) it assigns
the last used descript to a layer even if that layer was not your desired
target. You just need to reset the ENTDESC variable.

Change your true cond to:
(t (setq entdesc ""))

It worked for me.

You could separate the routines, but I am not a fan of this from a
management perspective. However, all you have to do is set it up as a
function using the (defun conditionfunctionname ()). Then load the routine
in your application (load "condition.lsp") and then call the function
(conditionfunctionname).

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

Post to forums  

Autodesk Design & Make Report

”Boost