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

Thread: Select ONLY Layout's Page Sets

  1. #1
    Member
    Join Date
    2015-05
    Location
    Barcelona, Spain
    Posts
    5
    Login to Give a bone
    0

    Default Select ONLY Layout's Page Sets

    Hi all,
    I'm trying to convert this function:

    Code:
    (defun AllPS (/)
      (vla-get-plotconfigurations
        (vla-get-activedocument (vlax-get-acad-object))
      ) 
    )
    ...to one that returns only the page sets of the layouts.
    I summarize my (fruitless) attempts, based in variations of jtbworld's Pagesetup tools:
    Code:
    (defun AllPS (/ aps)
      (setq aps (ssadd))
      (vlax-for pc (vla-get-plotconfigurations
        (vla-get-activedocument (vlax-get-acad-object)))
        (if (= (vla-get-modeltype pc) :vlax-false)
            (ssadd (vlax-vla-object->ename pc) aps)
        )
      )
    )
    
    (defun AllPS (/ aps)
      (setq aps (ssadd))
      (vlax-for pc (vla-get-plotconfigurations
        (vla-get-activedocument (vlax-get-acad-object)))
        (if (= (vla-get-modeltype pc) :vlax-false)
            (ssadd pc aps)
        )
      )
    )

    I will appreciate any help
    Last edited by rkmcswain; 2018-07-05 at 12:03 PM. Reason: Added [CODE] tags

  2. #2
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: Select ONLY Layout's Page Sets

    Hi,

    Welcome to AUGI.

    Actually you can not select layout tabs but you can iterate through their spaces and many more but that depends on what you are after.

    So can explain what are you trying to do with layout tabs excluding Models as you have demonstrated that within your above posted codes?

    NOTE: Please modify your post and wrap your codes with hash tags #

  3. #3
    Member
    Join Date
    2015-05
    Location
    Barcelona, Spain
    Posts
    5
    Login to Give a bone
    0

    Default Re: Select ONLY Layout's Page Sets

    Hi Tharwat
    The function is integrated in a command published in his day by Mr. Irné Barnard (Irneb) here:
    http://forums.augi.com/showthread.ph...ht=layouttools
    I tried to get in touch with him so he could authorize me to modify it, without success.
    I am not sure that it is correct that I publish it without having it.

    - - - Updated - - -

    Sorry, here:
    http://forums.augi.com/showthread.php?117284-LayoutTools-Explained&highlight=layouttools

  4. #4
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,658
    Login to Give a bone
    0

    Default Re: Select ONLY Layout's Page Sets

    I've been using it since he posted it in 2008: http://forums.augi.com/showthread.ph...l=1#post851674
    He's written some great routines like "Select Result": http://forums.augi.com/showthread.ph...modification#5

    Like Tharwat I'm wondering what it is you want the routine to do. Surprised you didn't try replying where you saw it posted, but without knowing what you're looking for there's nothing anyone can do to help you.

  5. #5
    Member
    Join Date
    2015-05
    Location
    Barcelona, Spain
    Posts
    5
    Login to Give a bone
    0

    Default Re: Select ONLY Layout's Page Sets

    Hi Mr Beauford. I'm Clujna in theswamp, and JuJoBer here. I thought it was a good idea to open a thread in the two forums. In both I have learned a lot, although Visual Lisp is still difficult for me (I'm a draftsman, not programmer).
    As I have said in theswamp, my objective is that the dialog box where now shows all the page settings of the drawing, shows only those applicable to the paper space. I hope that the images attached clarify it a bit.
    Now.jpg
    Desired.jpg

  6. #6
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,658
    Login to Give a bone
    0

    Default Re: Select ONLY Layout's Page Sets

    My drawings have two Page Setups one for plotting hardcopy and one for PDF. They come in with the layouts, never seen one for the Model tab before or a list like you posted.
    So you want Irné Barnard's Get-PS-Col to filter Page Setups like Jimmy Bergmark's allPageSetupsAndModelType. 4th of July is a holiday here in the US, but I'll take a look later this week, it may be better to check the tilemode system variable as when plotting to layout it doesn't matter if you're in paper space or in a viewport's model space.

  7. #7
    Member
    Join Date
    2015-05
    Location
    Barcelona, Spain
    Posts
    5
    Login to Give a bone
    0

    Default Re: Select ONLY Layout's Page Sets

    Yes!! Exact!!. In my company we often work on plans that have been very manipulated, and by very diverse people (constructions companys, other engineers, architects ...). Normalizing printing can be a tough task. My intention is to minimize errors by reducing the possible options.
    So, the original sub-function returns some similar to:
    #<VLA-OBJECT IAcadPlotConfigurations 000000005e7a0b88>
    ...independent of number of page setups presents in a drawing. I think (but I can be wrong) that it's a SELECTION SET, not a list, and in Visual LISP "format". All my (pathetic) attempts to get something similar after filtering page setups of paper space have been unsuccessful.
    These are some of them:
    Code:
    (defun Get-PS-Col (/ aps)
      (setq aps (ssadd))
      (vlax-for pc (vla-get-plotconfigurations
        (vla-get-activedocument (vlax-get-acad-object)))
        (if (= (vla-get-modeltype pc) :vlax-false)
          (ssadd (vlax-vla-object->ename pc) aps)
        )
      )
      (vl-sort aps '<)
    ); --> error: bad argument type: listp <Selection set: 15d24>
    
    (defun Get-PS-Col (/ aps)
      (setq aps (ssadd))
      (vlax-for pc (vla-get-plotconfigurations
        (vla-get-activedocument (vlax-get-acad-object)))
        (if (= (vla-get-modeltype pc) :vlax-false)
          (ssadd pc aps)
        )
      )
    ); --> error: bad argument type: lentityp #<VLA-OBJECT IAcadPlotConfiguration 0000000053045b08>
    
    (defun Get-PS-Col (/ aps)
      (setq aps (ssadd))
      (vlax-for pc (vla-get-plotconfigurations
        (vla-get-activedocument (vlax-get-acad-object)))
        (if (= (vla-get-modeltype pc) :vlax-false)
            (ssadd (vla-get-name pc) aps)
        )
      )
    ); --> error: bad argument type: lentityp "GISA x C550 PCL (A3 Extens)"
    etc, etc, etc...
    Last edited by rkmcswain; 2018-07-05 at 12:04 PM. Reason: Added [CODE] tags

  8. #8
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,658
    Login to Give a bone
    0

    Default Re: Select ONLY Layout's Page Sets

    There's PageSetups.lsp by CAB with added features like importing PageSetups as well: http://www.theswamp.org/index.php?topic=8855.0;all
    It also lists both PageSetups for Model and Paper Space as well. Removing the Model Space ones isn't as easy as I thought.
    Last edited by Tom Beauford; 2018-07-05 at 08:54 PM.

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

    Default Re: Select ONLY Layout's Page Sets

    Quote Originally Posted by Tom Beauford View Post
    Code:
    ;; Obtain Page Setup Collection
    (defun Get-PS-Col (/ aps)
      (vlax-for pc (vla-get-plotconfigurations (vla-get-ActiveDocument (vlax-get-acad-object)))
        (if (= (vla-get-ModelType pc) :vlax-false)
          (setq aps (cons (vla-get-name pc) aps))
        )
      )
      (vl-sort aps '<)
    ) ;_ end of defun
    Doesn't Work!!
    Tom,
    I think you could remove the vla-get-name portion for the list to retrieve a list of paperspace page setup configuration objects. However, this is only a list and not a collection. Appropriate code would need to be provided to utilize this list of vla-objects.
    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

  10. #10
    Member
    Join Date
    2015-05
    Location
    Barcelona, Spain
    Posts
    5
    Login to Give a bone
    0

    Default Re: Select ONLY Layout's Page Sets

    Quote Originally Posted by Tom Beauford View Post
    There's PageSetups.lsp by CAB with added features like importing PageSetups as well: http://www.theswamp.org/index.php?topic=8855.0;all
    It also lists both PageSetups for Model and Paper Space as well. Removing the Model Space ones isn't as easy as I thought.
    Thanks Tom, it's even more than I was looking for.
    I have also been recommended this: http://www.theswamp.org/index.php?to...0212#msg430212

    Greetings.

    - - - Updated - - -

    Sorry (another time), this!:
    http://www.theswamp.org/index.php?to...0212#msg430212

    - - - Updated - - -

    http://www.theswamp.org/index.php?topic=38005.msg430212#msg430212

Page 1 of 2 12 LastLast

Similar Threads

  1. 2012: Page layout tabs
    By rbhazie in forum AutoCAD General
    Replies: 2
    Last Post: 2017-05-30, 08:51 PM
  2. Get back the page size in mm of layout-page
    By Rodion in forum AutoCAD Customization
    Replies: 0
    Last Post: 2016-11-25, 10:11 AM
  3. Set page aetup for more than one page in single layout.
    By jagdale763733040 in forum Dot Net API
    Replies: 3
    Last Post: 2016-09-05, 06:27 AM
  4. Layout Page Number
    By kwest in forum AutoCAD LT - General
    Replies: 4
    Last Post: 2009-03-27, 01:29 PM

Tags for this Thread

Posting Permissions

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