Results 1 to 2 of 2

Thread: LayoutTools Explained

  1. #1
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default LayoutTools Explained

    Someone's asked me to explain step by step what's happening in my LayoutTools.LSP. So here goes ... I'm starting from the command line version (c:-MPageSetup), since most would be using this. The dialog version perform the same thing, but whenever the user's asked for the tab names & page setup name, a dialog is displayed instead of a command line prompt, so that I'm not explaining here.

    In the c:-MPageSetup defun: The (setq TabSel...) calls another function (Select_Tabs_CMD explained below) to get a list of tab names to be set up. The (setq PS ...) gets the PageSetup's name (through Pick_PS_CMD below) to which the previous must be set. And then finally (MpageSetup ...) does the actual assigning through MpageSetup (below).

    Select_Tabs_CMD: (setq Tabs ...) gets all available tab names, this could have been done through the layoutlist function as well. I'm using the Get-Obj-Names and Get-Tab-Col which uses the ActiveX objects of each layout instead. It then uses initget and getstring to ask the user to pick one at a time to select the tabs (or use * to select all). Basically it adds each selected to the variable TabSel which is returned in its original order at the end.

    Pick_PS_CMD: Does something similar for the PageSetups, but only asks for one name instead of a list.

    Get-PS-Col and Get-Tab-Col: gets the plot configurations and layout collections (respectively) from the ActiveX object of the current drawing.

    Get-Obj-Names: Basically runs through a collection of ActiveX objects and returns a list of each object's name. Excepting if that name equals Model.

    MpageSetup: is the main function in this entire LSP. First it gets the PageSetup & Tabs collections. Saves the current tab to be restored later. Then it get's the selected Page Setup's ActiveX object. Now it steps through all tabs, checking if the current's name is in the selected list. If so it copies the tab from the PageSetup using vla-CopyFrom. Then it also sets the Plot Type (Display, Extents, Limits, View, Window or Layout) to that of the PageSetup - for some reason this doesn't happen through the CopyFrom method. Finally it sets the tab current and does a regen. Then it continues to the next tab. When all tabs are complete it resets to the tab which was current when the function started.
    Attached Files Attached Files

  2. #2
    Member
    Join Date
    2000-12
    Posts
    9
    Login to Give a bone
    0

    Default Re: LayoutTools Explained

    Thank-you, that clears up a lot of the code.

Similar Threads

  1. Underlay Behavior EXPLAINED
    By mschroeder in forum Revit Architecture - General
    Replies: 14
    Last Post: 2018-06-01, 03:07 PM
  2. THE JOURNAL FILE EXPLAINED!!
    By ykang in forum Revit Architecture - General
    Replies: 6
    Last Post: 2007-05-03, 01:14 PM
  3. WORKSETS EXPLAINED!!!
    By ykang in forum Revit - Worksharing/Worksets/Revit Server
    Replies: 11
    Last Post: 2007-02-04, 04:03 AM

Posting Permissions

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