Turning off layers

Discussion in 'AutoCAD' started by Jamie Myers, Jul 30, 2003.

  1. Jamie Myers

    Jamie Myers Guest

    What does it mean "valid table name"? Is is the string "layer", right? I
    had asked that before and nobody confirmed it.

    --
    Jamie Myers
    The EARTHWORKS Group
    Murrells Inlet, SC
    --
    remove -NO SPAM- to reply
     
    Jamie Myers, Jul 31, 2003
    #21
  2. Go to

    Help > Developer Help > DXF Reference >
    Tables section > symbol table code groups.

    Read the first few lines.
     
    Jason Piercey, Jul 31, 2003
    #22
  3. also, see the help file on the (tblnext) function, and yes,
    "layer" is one possibility.
     
    Jason Piercey, Jul 31, 2003
    #23
  4. Jamie Myers

    PF Guest

    (thanks for the "triangle" - been seeigna lot of the latter 2 recently!)
     
    PF, Jul 31, 2003
    #24
  5. Jamie Myers

    Paul Turvill Guest

    You're on the right track, but (assoc 70 layr) can never be equal to 0 or
    any other integer. You need to get the value of the group with (cdr (assoc
    70 layr)), and even then, you must realize that this will be a bit-coded
    value, with each bit having a different meaning. For frozen/thawed state,
    you're only interested in bit 0 (value = 1), so your (if ...) clause should
    be

    (if (= (logand (cdr (assoc 70 layr)) 1) 0) ;;layer is thawed
    (setq LayerSet (cons (cdr (assoc 2 layr)) LayerSet))
    );; if
     
    Paul Turvill, Jul 31, 2003
    #25
  6. Jamie Myers

    Jamie Myers Guest

    (thanks for the "triangle" - been seeigna lot of the latter 2 recently!)
    YW. So what your sayiong is that your a *trianed monkey* that works on
    salary? <bg> Actually, that is what I've got for a signature in another
    newsgroup. For some reason, which I haven't taken time to figured out, OE
    is wanting to set my news server to the other one, and the newsgroup to the
    autodesk one. Doesn't matter though, glad you liked it.
     
    Jamie Myers, Jul 31, 2003
    #26
  7. Jamie Myers

    Jamie Myers Guest

    After looking at this again, I see at the end you are telling what to use
    for the table. I didn't understand that before. Also, I'm going to put
    notes beside these lines stating what I think it does, would you guys check
    me to see if I got it?


    ; author - Puckett
    ; - string, valid table name ;table name - "layer"
    ; returns each item name from

    (defun table (s / d r) ; is from the main routine.
    Why can't I just use the string "layer" here? If I was going to use this
    for other tables, then would I have 2 arguments, one for the table and one
    for the assoc code?

    (while (setq d (tblnext s (null d))) ;[d] is set to nil. As long as [d]
    is nil, then each call to tblnext will retrieve the information in the table
    "layer"

    (setq r (cons (cdr (assoc 2 d)) r)) ;The layer name will be cons'ed into
    list r.

    ) ;end while. The
    while will end when d is nil again, right?

    ) ;end defun



    ; (table "layer") ;this was to show what to
    use as the argument.


    So how'd I do? Did I pass the exam? Do I get a gold star?
     
    Jamie Myers, Jul 31, 2003
    #27


  8. Why would you want to put the string "layer" in the function? That
    functions purpose is to work with any table, not just the layer table.
    try it out on other tables....

    (table "layer"); gets all layer names in the database
    (table "view"); gets all view names in the database
    (table" "block"); gets all block names in the database
    etc....

    So, no, you do not need 2 arguments for anything with this function.
    Actually, just the opposite, while [d] is non nil get the next entry in the
    table. The (null d), will rewind the table (see the help files) when it
    reaches the last entry within the specified table.
    when d is nil again, right?


    well, not again.... but when it becomes nil for the first time it will stop.
    not bad, I'll give you a "B" :) Fresh out of gold stars <g>
    But I do have the ever popular chili donut I could fax over ;)
     
    Jason Piercey, Jul 31, 2003
    #28
  9. Jamie Myers

    Jamie Myers Guest

    <Homer simpson vox>
    MMMMMMMMMMMMMMMMMM Chili donut <drool.mpg>
    </= Homer Vox>

    Thanks alot Jason. I understand now. Reading through the help files can
    somtimes make it more confusing than it really is. That's where is a
    beautiful thing tht people like Rudy, Bobby, you and others are willing to
    take the time out to help me out. I've had to learn lisp on my own because
    everywhere I've ever worked the nearest place to learn Lisp is over 2 hours
    away and the companies have been too cheap to pay for training. Autodesk
    University is great, but trying to do it at night after spending all day on
    the computer makes it harder to accomplish. Not to mention the fact that I
    can never get enrolled on time. So, to me, the people on these ng's are the
    best teacher's. Thanks everyone.

    <more questions will eventually happen. I've working on some new ones now>
    <bg>

    Jamie
     
    Jamie Myers, Jul 31, 2003
    #29
  10. Glad I could help, Jamie. I think there are many of us here
    that have regular job type jobs, and spend the evening hours
    (along with every spare minute) playing with lisp.... I know I do.
     
    Jason Piercey, Jul 31, 2003
    #30
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.