Layer Setting code improvements requested

Layer Setting code improvements requested

Anonymous
Not applicable
356 Views
6 Replies
Message 1 of 7

Layer Setting code improvements requested

Anonymous
Not applicable
Below is my horrid hack of some code to create a function to recognize if a Layer Key Override is active and to set/create the proper layer for symbology placement: (defun annolko (/ clayr) (if (null AecGenerateLayerKey) (arxload "AecLMgrLisp45") ) (setq clayr (AecExpandLayerKey "ANNOBJ")) (if (tblsearch "layer" clayr); is the layer there (if (/= layer (getvar "clayer")); if layer isn't the current layer.... (setvar "clayer" clayr); make it the current layer ) (command "_layer" "m" clayr "c" "2" "" "") ) (princ) ) Anyone have a more elegant way to do this :) It works fine, but I don't want Peter Funk laughing at me forever ;) -- Regards, --------------- Reid M. Addis Registered Architect Architectural Applications Specialist Granary Associates 411 North 20th Street Philadelphia, PA 19130 Ph. 215-665-7056 email: addis@granaryassoc.com
0 Likes
357 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
Reid, You should look at AecGenerateLayerKey instead. That returns the layer name, but also makes the layer if needed. Cheers, Peter Funk API Product Manager ISD Autodesk, Inc. ps. learn VBA (or VB.NET) and you'll never want to use LISP again
0 Likes
Message 3 of 7

Anonymous
Not applicable
I don't know about the rest of you, but I'm pretty sure that I detected a snicker at the end of Peter's post :-) -- Bobby C. Jones
0 Likes
Message 4 of 7

Anonymous
Not applicable
Hmmmm....I had a routine with that, but does it recognize Layer Key Overrides? I didn't think it did? I'll check again, but I think it only creates the root layer. What snicker Bobby? ;) -- Regards, --------------- Reid M. Addis Registered Architect Architectural Applications Specialist Granary Associates 411 North 20th Street Philadelphia, PA 19130 Ph. 215-665-7056 email: addis@granaryassoc.com
0 Likes
Message 5 of 7

Anonymous
Not applicable
Hmmmm....seems to work fine. Maybe there was a snicker there...... -- Regards, --------------- Reid M. Addis Registered Architect Architectural Applications Specialist Granary Associates 411 North 20th Street Philadelphia, PA 19130 Ph. 215-665-7056 email: addis@granaryassoc.com
0 Likes
Message 6 of 7

Anonymous
Not applicable
I didn't snicker about the code, but I was trying to "encourage" you to stop programming in LISP. There are tools available in VBA, and especially in VB.NET are far beyond AutoLISP. Cheers, Peter Funk API Product Manager ISD Autodesk, Inc.
0 Likes
Message 7 of 7

Anonymous
Not applicable
I know, I know. Writing 100 times: I will learn VBA! I will learn VBA! I will.... -- Regards, --------------- Reid M. Addis Registered Architect Architectural Applications Specialist Granary Associates 411 North 20th Street Philadelphia, PA 19130 Ph. 215-665-7056 email: addis@granaryassoc.com
0 Likes