I know its alot, but figured someone has run into something similar!
TIA
--
Chip Harper
Autodesk Discussion Group Facilitator
(if (not (tblsearch "LAYER" "27")) (command "LAYER" "N" "27" ""))
(command "-layer" "c" "yellow" "27" "")
Not necessary if you use the layer "make" option -- it will change the
layer's properties is it exists or create if if necessary.
(command "layer" "make" "27" "c" "27" "")
The standards checker in 2004 can be used to check for non-conforming
layers.
Is there an easy way to build a list, say from an Excel document or TXT
file, that would contain the layer names that would need to be checked?
Something like:
(command "layer" "make" "A-ANNO-DIMS" "c" "1" "")
(command "layer" "make" "A-ANNO-NOTE" "c" "2" "")
(command "layer" "make" "A-ANNO-SYMB" "c" "2" "")
(command "layer" "make" "A-ANNO-TEXT" "c" "3" "")
etc.
etc.
Where the layer names are compiled from a list? Hmmmm...I have an idea. An
Excel table, where:
cell A is (
cell B is command
cell C is "layer"
etc.
Then export the Excel to a TXT file, save as LAYERFIX.lsp I will need to
put the required spaces in the cells...but I think it will work.
Any other ideas? Thanks again for getting me going.
"jclaidler" <nos...@address.withheld> wrote in message
news:12587270.109171849...@jiveforum1.autodesk.com...
"Chip Harper" <hot...@hotmail.com> wrote in message
news:41122acb$1_2@newsprd01...
In the "Standard" drawing I have all the layers I'm ever going to use.
Using the Layer State Manager object I've saved all the combinations of
those layers ( architecture: floor plan, reflected ceiling plan, etc. )
From the active document I can access the "standard" drawing using the
ObjectDBX activex object. I make two lists: one of the layers in the active
document and one from the standard drawing then compare. This appliqué
allows one to easily mange standard layers in an AutoCAD environment while
being easily accessed by other users. This approach could easily be
tailored to your needs.
What you'll need:
A collection of routines to "open" and "close" a dbx document. ( do a
search - Tony T. has some excellent examples)
A collection of routines for manipulating the Layer State object. ( the
AutoCAD help has some examples )
Some simple routines for manipulating layers in the active document. (
believe it or not I use "command -layer . . .")
Believe me, EVERYTHING you need to write this yourself is on the net.
You'll find a number of fishermen (fisherpersons?) willing to show you how
to catch the big fish but very few fish mongers willing to give you a fish.
jb
p.s. I've written some very powerful programs with the help of individuals
on the NG ( thanks again guys! )
"Scott Davis" <scott@wlc-architects*nospam*.com> wrote in message
news:41125ae6_1@newsprd01...
"j.buzbee" <j...@alfonsoarchitects.com> wrote in message
news:411261b4$1_3@newsprd01...
"Mack Attack" <ma...@mailinator.com> wrote in message
news:411263e3$1_2@newsprd01...
As has been hinted, another way to accomplish the same thing, using a
built-in methodology, is to use the layer manager to export a list of
standard layers from a "clean" drawing. Import this layer state into a
non-standard drawing, and you're done. Existing layers will have all their
properties corrected, missing layers will be created, and the only things
remaining to fix will be the non-standard extraneous layers.
Unless there are very many of these, or hundreds of drawings to process, I
think it ought to be easy enough to spot the nonconforming layers and fix
them manually.
What a gracious way of saying "gosh, I didn't know that."
Yeah, it's "another" way, that's shorter, more direct, and devoid of
unnecessary and redundant code, taking advantage of the way the layer
command has always worked.
"Tom Smith" <nospam> wrote in message news:41127eed_1@newsprd01...
Again, I don't believe in spending time on creating a customization which duplicates a built-in capability. I'm not afraid of writing lisp when the situation requires it, but I don't do it for sport.
The answer to most common questions is to spend more time in the help docs and learn how close the software already comes to meeting your needs. Explore and understand every option of the command-line -LAYER command first. Then tweak it as necessary.
As for programming for sport - just because you lack the capacity to
understand that the true power of AutoCAD is it's open architecture doesn't
mean those who utilize that power are excercising mental masturbation.
just my humble E0.02 (which = about 0.017 USD)
jb
"Tom Smith" <nos...@address.withheld> wrote in message
news:15308601.109175658...@jiveforum1.autodesk.com...
"Tom Smith" <nos...@address.withheld> wrote in message
news:15308601.109175658...@jiveforum1.autodesk.com...
Yes, try it.
Mine doesn't, and apparently neither does the OP's. We have several saved
layer states which contain the same list of standard layers, with different
visibility settings appropriate to different tasks. If we needed different
sets of layers for different types of drawings, then I would probably
maintain a standard "clean" version of each drawing type from which to
export its layer state. The OP refered to one standard list of layers, not
multiple possible standard lists.
> When you import a layer state you import all layers instead of only those
needed. Sounds like
> a sledge hammer when all was needed is a screw driver!
The OP wanted to create any layers on his standard list which were missing,
or fix the layer properties if they didn't match standards. If his standard
demanded 700 layers, then I would assume he would want all 700 of them
created. In fact he's asking about 100 layers. He said he wants them all
imported. Sounds like offering the tool that was requested!
> just because you lack the capacity to understand
Offensive and unnecessary.
You proposed that the OP go off on a programming expedition to do something
which, from your description, appears to duplicate the functionality of the
layer states manager, if it were applied to his case. I suggested that he
use the layer states manager as is. If that fails to meet his needs I'm sure
he'll continue looking for a solution. Relax.
Dosn't sound like Scott is too happy with the built-in stuff does it? If
your not up to helping him with writing a customized routine maybe you
should gracefully bow out and let him get some help.
It sounded to me like he is seeking confirmation that importing a layer
state will do what he requested : "create layers that are not present."
C'mon....eveyone has been helpful! I have found out things I didn't know,
and other ways of thinking about how to do this. There is no right or wrong
way to do this, but definately one way might be faster, cheaper, etc.
I still have one question that originally sparked this, and now I'd like to
know for future reference: Why does Excel add extra quote marks to cells
which contain quotes upon a SaveAs to TXT?
"Tom Smith" <nospam> wrote in message news:41178e04$1_1@newsprd01...