Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: insert an equivalent of the CTAB variable as a field value

  1. #1
    Member
    Join Date
    2008-02
    Posts
    5
    Login to Give a bone
    0

    Default insert an equivalent of the CTAB variable as a field value

    Hi all
    I have a block with a field that doesn't plot (which is what I want). I want the name of the layout that the block is placed on to be returned as the field value. The CTAB variable doesn't work. "Why not?", you ask. Well, we have multiple layout tabs. What I want to do is use the DATAEXTRACTION to count all of the blocks and tell me what layout they are on. This will be extracted to Excel. I want to do this from any given layout, but extract the data from ALL of the layouts. CTAB doesn't work because it inputs the name of the layout that is current when the DATAEXTRACTION is executed. I can use the DATAEXTRACTION on each layout and extract to separate files, but this is very time consuming. I am very new to LISP, but did manage to piece together the lisp below. However, now I am finding that the LISP result cannot be inserted as the field value?? Maybe I am going about this all wrong? Maybe something other than AutoLisp?
    Any and all help is appreciated. Here's the LISP I cam up with.

    (cdr(assoc 410(entget(ssname(ssget "L")0))))

  2. #2
    Member
    Join Date
    2008-10
    Posts
    3
    Login to Give a bone
    0

    Default Re: insert an equivalent of the CTAB variable as a field value

    Drafsit,

    I've been banging my head against a wall for three weeks trying to get CTAB to cooperate with EATTEXT - without luck. I've finally settled for using GATTE to update the LAYOUT_TAB attribute in all blocks on the layout sheet.

    It's not as neat and tidy as using the CTAB field should be, but since CTAB doesn't seem to work the EATTEXT, it's as close as I could come.

    If you have any luck with this, I'd really appreciate hearing how you solved it.

    Teresa

  3. #3
    All AUGI, all the time
    Join Date
    2016-02
    Location
    Sydney, Australia
    Posts
    512
    Login to Give a bone
    0

    Default Re: insert an equivalent of the CTAB variable as a field value

    Thinking in non-Lisp for the solution...
    I created an attribiute which finds the current CTAB and adds it as a feild, Then I saved the block, and added it to each layout (this could be added to a title block). Then I ran the Attibute extraction wizard, and saved the table to drawing (you could extract it to excel instead). I probably need to tinker with the extraction to make dynamic (if the layout tab is renamed), but as a one off, it seams to work. See the attached AC drawing.

    Your comments?
    Attached Files Attached Files

  4. #4
    Member
    Join Date
    2008-02
    Posts
    5
    Login to Give a bone
    0

    Default Re: insert an equivalent of the CTAB variable as a field value

    Thanks for the quick replies guys. Northon, I'm not sure if you're idea is going to give me what I am looking for. Maybe I'm just not understanding what you are telling me. I am adding a drawing this time showing what is happening. I have inserted the block that I want to count on multiple layouts. I ran the DATAEXTRACTION while RC1 was the current layout. You can see on the table and the Excel result that I clipped that the information returned only lists the pieces as being on the layout that is current when the extraction is ran. However, when you look at each layout individually, the information in correct. (the bottom left corner of each block displays the CTAB value using a field) I want the table and Excel result to list the layout that the block is actually on.
    Again, all help is much appreciated.
    Attached Files Attached Files

  5. #5
    I could stop if I wanted to JASONM30395's Avatar
    Join Date
    2002-04
    Location
    Halifax NS Canada
    Posts
    397
    Login to Give a bone
    0

    Default Re: insert an equivalent of the CTAB variable as a field value

    Quote Originally Posted by draftsit View Post
    Hi all
    I have a block with a field that doesn't plot (which is what I want). I want the name of the layout that the block is placed on to be returned as the field value. The CTAB variable doesn't work. "Why not?", you ask. Well, we have multiple layout tabs. What I want to do is use the DATAEXTRACTION to count all of the blocks and tell me what layout they are on. This will be extracted to Excel. I want to do this from any given layout, but extract the data from ALL of the layouts. CTAB doesn't work because it inputs the name of the layout that is current when the DATAEXTRACTION is executed. I can use the DATAEXTRACTION on each layout and extract to separate files, but this is very time consuming. I am very new to LISP, but did manage to piece together the lisp below. However, now I am finding that the LISP result cannot be inserted as the field value?? Maybe I am going about this all wrong? Maybe something other than AutoLisp?
    Any and all help is appreciated. Here's the LISP I cam up with.

    (cdr(assoc 410(entget(ssname(ssget "L")0))))
    I've never used DATAEXTRACTION and I'm far from an expert in LISP but is there any way you can loop the LISP, store the value for each ctab and then run DATAEXTRACTION?
    Loyalty above all else except honor
    For my honor is my life!

  6. #6
    All AUGI, all the time
    Join Date
    2016-02
    Location
    Sydney, Australia
    Posts
    512
    Login to Give a bone
    0

    Cool Re: insert an equivalent of the CTAB variable as a field value

    Quote Originally Posted by draftsit View Post
    Thanks for the quick replies guys. Northon, I'm not sure if you're idea is going to give me what I am looking for. Maybe I'm just not understanding what you are telling me. I am adding a drawing this time showing what is happening. I have inserted the block that I want to count on multiple layouts. I ran the DATAEXTRACTION while RC1 was the current layout. You can see on the table and the Excel result that I clipped that the information returned only lists the pieces as being on the layout that is current when the extraction is ran. However, when you look at each layout individually, the information in correct. (the bottom left corner of each block displays the CTAB value using a field) I want the table and Excel result to list the layout that the block is actually on.
    Again, all help is much appreciated.
    Thanks for the feeback & upload of the pertanant CAD file. Attached is a screenshot of each stage of the attribute extraction, and the resulting excel file, all as you desire.
    Merry Christmas.
    Attached Files Attached Files

  7. #7
    Member
    Join Date
    2008-02
    Posts
    5
    Login to Give a bone
    0

    Default Re: insert an equivalent of the CTAB variable as a field value

    Norton_cad...thanks for the input. That is the exact process we go through now. Unfortunately we get a different result. When ran here, the extraction shows that all occurences of the block are on the same layout (the layout that is current when the extraction is ran) Maybe there is some sort of setting I am overlooking or that got changed somewhere along the way?????

  8. #8
    All AUGI, all the time
    Join Date
    2016-02
    Location
    Sydney, Australia
    Posts
    512
    Login to Give a bone
    0

    Default Re: insert an equivalent of the CTAB variable as a field value

    Quote Originally Posted by draftsit View Post
    Norton_cad...thanks for the input. That is the exact process we go through now. Unfortunately we get a different result. When ran here, the extraction shows that all occurences of the block are on the same layout (the layout that is current when the extraction is ran) Maybe there is some sort of setting I am overlooking or that got changed somewhere along the way?????
    Okay. Upload the attached SWF file, launch ACAD & in the express tools, select Tools, System Variable Editor. Then in the dialogue box select, Read, ans navigate to the attached SWF file, and hit okay. Now you have the same system variables active as I do.

    Now follow the steps in my previous post, paying close attention to which radio buttons I have switched on or off. Hopfully it should be okay. Please respond if it is or isn't.
    Only one more sleep until Santa comes....
    Attached Files Attached Files

  9. #9
    Member
    Join Date
    2006-02
    Posts
    22
    Login to Give a bone
    0

    Default Re: insert an equivalent of the CTAB variable as a field value

    Hi There

    I am having exactly the same problem with the ctab not transferring with a data extraction.
    It works if you regen all layouts but when you save, etc it all refers back to the current layout.

    Would really like to know an alternative if anyone can give some suggestions

  10. #10
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,096
    Login to Give a bone
    0

    Default Re: insert an equivalent of the CTAB variable as a field value

    That is what the ctab is meant for, the Current Tab.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 5
    Last Post: 2014-08-06, 09:33 PM
  2. Field Attribute Not Updating on .NET Insert?
    By mcoffman in forum Dot Net API
    Replies: 1
    Last Post: 2011-06-17, 08:43 PM
  3. Extract value of ctab field to xls file
    By paulof in forum AutoLISP
    Replies: 21
    Last Post: 2011-05-01, 08:30 PM
  4. layout name field/variable
    By Maurice.148748 in forum AutoCAD General
    Replies: 2
    Last Post: 2010-11-24, 02:29 PM
  5. Trying to insert a field in a titleblock attribute
    By jawf in forum VBA/COM Interop
    Replies: 14
    Last Post: 2009-09-02, 07:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •