+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Forum Newbie
    AutoCAD LT 2009
    Join Date
    Jan 2009

    Default Script (not LISP!) to change VP visibility etc?

    Registered forum members do not see this ad.

    I've been trying unsuccessfully to create a script/macro that does the following from within a sheet file with a base plan xref:
    -user input: active viewport
    -user input: plan, RCP, demolition, enlarged plan
    -load the vplayer linetypes, colors, and visibility appropriate to the selected view mode above

    Behind the scenes, I have created a base plan template on our server with .las files for each of the appropriate layer settings so they can be called by the script.

    I had hoped that I could have a combination of scripts and macros do the job of:
    -entering the model space of the viewport selected
    -assigning the selected layer settings for the xref layers appropriate to the user selected view (plan, etc)
    -making vplayers=modelspace layers and then
    -return the xref to base settings in model space while retaining the newly created vp settings.

    This may seem overly complicated, but the reason I want to do it this way is to allow our office to create a base resource for layer settings in the form of a template with layerstates; that way, if we have to change settings in the future, we change it once - the script can be run on any new and old files to make the change.

    I think I can figure out most of the above...but I'm stuck on assigning modelspace xref layers to vplayer settings and having them "stick" in the viewport. If I could access a variable for each layer property and assign it to a variable for vp settings for that layer, it would be a simple matter of using something like *base*|* for the layer name and having the script go through all of the layers. Is there a way to do this? Without access to LISP (AutoCAD LT), this seems difficult.

    Thanks for reading this far...I couldn't come up with a more concise way to put the question!

  2. #2
    Forum Newbie
    AutoCAD LT 2009
    Join Date
    Jan 2009


    Well, here I am answering my own question...but perhaps someone more knowledgable can comment - I'm in pretty deep water here.

    So, I created a macro as follows:
    ^C^C_-vports \\mspace;z;c \;z;s \'_script
    This creates a new viewport, which gets user input to pick points, center the plan in model space, and then for the scale of the viewport. It's assumed that the user has already loaded the base-plan xref. I was looking for a way to make scale entry simpler...putting in "1/48xp" for quarter scale isn't very intuitive.

    Then, I created a script for the user to run from within the macro:

    ;This script creates a plan layer setup within a viewport
    This does the job of setting up the layers to print properly from within the viewport. It isn't perfect, and there's no error checking. Now I just have to create the other scripts (RCP, Demo, etc).

    As for using variables in macros from my first post: the setenv command creates random variables...but I'm thinking my current route is probably the best. Comments?

  3. #3
    Forum Newbie
    Architecture 2009
    Join Date
    Sep 2008

    Default vplayer

    Registered forum members do not see this ad.

    whats your work around for running the script in a drawing that doesn't have any layers with those suffix or prefix? "No matching layer names found."

Similar Threads

  1. Script to Change Attribute
    By matthewrussell in forum AutoLISP, Visual LISP & DCL
    Replies: 11
    Last Post: 27th Apr 2010, 01:56 pm
  2. Script to change certain linetypes to another?
    By spittle in forum AutoLISP, Visual LISP & DCL
    Replies: 18
    Last Post: 15th Jul 2008, 05:16 pm
  3. Script to Change Background Color
    By treaves in forum AutoCAD General
    Replies: 6
    Last Post: 10th Jul 2008, 09:34 am
  4. Can I use a script to change text on 100 drawings?
    By Ste1978 in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 30th Oct 2007, 06:05 pm
  5. macro to change the visibility of a particular dynamic block
    By comcu in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 27th Jun 2007, 11:03 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