+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 19
  1. #1
    Full Member
    Computer Details
    GVR's Computer Details
    Operating System:
    Win XP
    Using
    AutoCAD LT 2009
    Join Date
    Apr 2010
    Location
    The Netherlands
    Posts
    41

    Default Layout-tab name in a macro.

    Registered forum members do not see this ad.

    Hello,

    I have made a macro which print a specifically area of different layout-tabs. It works fine.
    But now i have to use it in other drawings with other layout-tab names and than the macro doesn't work anymore.
    Now i have to change the macro each time with all the new layout-tab names.
    Is there a way to use a name/number that always work for layout1, layout2, layout3,...etc.
    I thought it was "layout1" etc. with or without the ", but that doesn't work.

    I hope someone has a answer.
    Already thanks.

  2. #2
    Senior Member Ahankhah's Avatar
    Computer Details
    Ahankhah's Computer Details
    Operating System:
    Windows 8.2
    Using
    Revit 2015
    Join Date
    Jun 2010
    Location
    Tehran, Iran
    Posts
    472

    Default

    You can issue (layoutlist) to get a list containing all layout tabs, so then you can use foreach function to set each tab current to do print.

    Code:
    (foreach layout (layoutlist)
       (command "._LAYOUT" "_Set" layout)
       put here your code to print
    )
    Mehrdad Ahankhah مهرداد آهن خواه
    www.IranCAD.com

  3. #3
    Full Member
    Computer Details
    GVR's Computer Details
    Operating System:
    Win XP
    Using
    AutoCAD LT 2009
    Join Date
    Apr 2010
    Location
    The Netherlands
    Posts
    41

    Default

    I don't know this kind of code. Is this code part of LISP? In that case i can't use it. I'm using AutoCAD LT.

    Edit:
    I tried it but i got this error back: (foreach LISP command is not available.

    So my question about LISP is now answered i think.

  4. #4
    Senior Member Ahankhah's Avatar
    Computer Details
    Ahankhah's Computer Details
    Operating System:
    Windows 8.2
    Using
    Revit 2015
    Join Date
    Jun 2010
    Location
    Tehran, Iran
    Posts
    472

    Default

    Quote Originally Posted by GVR View Post
    I don't know this kind of code. Is this code part of LISP? In that case i can't use it. I'm using AutoCAD LT.
    Could you insert your macro which works on your PC?
    Mehrdad Ahankhah مهرداد آهن خواه
    www.IranCAD.com

  5. #5
    Full Member
    Computer Details
    GVR's Computer Details
    Operating System:
    Win XP
    Using
    AutoCAD LT 2009
    Join Date
    Apr 2010
    Location
    The Netherlands
    Posts
    41

    Default

    This is the script that i use:

    Code:
    filedia 0
    layout
    
    001
    _-plot
    y
    
    PublishToWeb JPG.pc3
    onderlegger
    l
    n
    w
    0,0
    2400,1670
    1:1
    
    y
    Print.ctb
    
    
    
    
    
    y
    y
    layout
    
    A
    _-plot
    y
    
    PublishToWeb JPG.pc3
    onderlegger
    l
    n
    w
    0,0
    2400,1670
    1:1
    
    y
    Print.ctb
    
    
    
    
    
    y
    y
    layout
    
    B
    _-plot
    y
    
    PublishToWeb JPG.pc3
    onderlegger
    l
    n
    w
    0,0
    2400,1670
    1:1
    
    y
    Print.ctb
    
    
    
    
    
    y
    y
    layout
    
    C
    _-plot
    y
    
    PublishToWeb JPG.pc3
    onderlegger
    l
    n
    w
    0,0
    2400,1670
    1:1
    
    y
    Print.ctb
    
    
    
    
    
    y
    y
    layout
    
    001
    filedia 1
    In the drawing for this script the layouts are named: 001, A, B, C.
    The paper-size is named: "onderlegger"

  6. #6
    Senior Member Ahankhah's Avatar
    Computer Details
    Ahankhah's Computer Details
    Operating System:
    Windows 8.2
    Using
    Revit 2015
    Join Date
    Jun 2010
    Location
    Tehran, Iran
    Posts
    472

    Default

    By using Ctab system variable, you cad obtain the name of current tab (layout).
    As I searched in AutoCAD's documntation and help, unfortunately there is no any command or system variable in AutoCAD to say the name of other tabs (layouts).
    Mehrdad Ahankhah مهرداد آهن خواه
    www.IranCAD.com

  7. #7
    Senior Member Ahankhah's Avatar
    Computer Details
    Ahankhah's Computer Details
    Operating System:
    Windows 8.2
    Using
    Revit 2015
    Join Date
    Jun 2010
    Location
    Tehran, Iran
    Posts
    472

    Default

    I think you have another problem in addition to not knowing tabs (layouts) name. You alse don't know the count of tabs. Without AutoLISP, You can't find out how many tabs are there in the drawing.
    Mehrdad Ahankhah مهرداد آهن خواه
    www.IranCAD.com

  8. #8
    Full Member
    Computer Details
    GVR's Computer Details
    Operating System:
    Win XP
    Using
    AutoCAD LT 2009
    Join Date
    Apr 2010
    Location
    The Netherlands
    Posts
    41

    Default

    Ahankhah, Thank you for your help.
    I'm gonna modify the script so it is printing only the active layout-tab. Then i can print each layout when i work on it, instead of printing them all at once at the end.

    But i still hope that someone els have a solution.

  9. #9
    Luminous Being dbroada's Avatar
    Computer Details
    dbroada's Computer Details
    Operating System:
    Windows 7 Professional
    Computer:
    Dell
    CPU:
    Intel Xeon E5-1603@2,80GHz
    RAM:
    4GB
    Graphics:
    NVIDA Quadro K600
    Monitor:
    DELL 23" & SAMSUNG 21"
    Using
    not applicable
    Join Date
    Nov 2005
    Location
    Kenley, Surrey, UK
    Posts
    5,644

    Default

    How are you using this? Do you use it as part of a batch process or just the current drawing?

    If the former I have no suggestions but if the latter can you just remove the first few lines (start your script with the -plot line) to run on the currently selected layout?

    edit......

    I would have posted this before your identical solution but somebody brought me some work to do.
    "That's it. It's one thing for a ghost to terrorize my children, but quite another for him to play my Theremin." Homer Simpson
    "Everything in drafting is logical. Except what isn’t." - Gavin Guile. (from the Lightbringer series of books by Brent Weeks)

    Dave

  10. #10
    Full Member
    Computer Details
    GVR's Computer Details
    Operating System:
    Win XP
    Using
    AutoCAD LT 2009
    Join Date
    Apr 2010
    Location
    The Netherlands
    Posts
    41

    Default

    Registered forum members do not see this ad.

    @dbroada
    But still thanks for your idea. It was a little to late but it's the gesture that counts.

    The new version of the script is already working.

Similar Threads

  1. How to change 2009's layout to a "classical layout"?
    By Zzap in forum AutoCAD Beginners' Area
    Replies: 6
    Last Post: 2nd Apr 2011, 02:23 am
  2. moved from one layout to another layout
    By yadavdinesh2008 in forum AutoCAD Beginners' Area
    Replies: 1
    Last Post: 6th Jun 2010, 05:02 pm
  3. Macro command for current layout?
    By kevinp in forum AutoLISP, Visual LISP & DCL
    Replies: 10
    Last Post: 6th Feb 2009, 08:08 pm
  4. Help with Macro Please
    By xspacex in forum AutoCAD Drawing Management & Output
    Replies: 3
    Last Post: 5th Mar 2008, 09:06 pm
  5. Macro Help
    By dreese1 in forum AutoLISP, Visual LISP & DCL
    Replies: 0
    Last Post: 18th Aug 2005, 09:09 pm

Bookmarks

Posting Permissions

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