Results 1 to 4 of 4

Thread: using vplayer and -layer commands on layers with wildcards in their names

  1. #1
    Member
    Join Date
    2015-01
    Posts
    43
    Login to Give a bone
    0

    Default using vplayer and -layer commands on layers with wildcards in their names

    I'm writing a lisp routine to vpfreeze/vpthaw or freeze/thaw layers based on parameters. My problem is that my company designates layers with existing equipment using the format 'AR.[E].EQUIP' or 'EL.[E].EQUIP' or 'ME.[E].EQUIP' and so on.

    when I invoke (command "VPLAYER" "T" "AR.[E].EQUIP" "C" "") or (command "-LAYER" "T" "AR.[E].EQUIP" "") in my routine, it crashes because AutoCAD is trying to match what it thinks is a wildcard and of course there is no matching layer 'AR.E.EQUIP'

    This is also a problem when I'm just using these commands straight from the command line but I'm only concerned with getting my routine to run.

    Is there any way to turn off or override the wildcard matching in -LAYER and VPLAYER or is there any LISP workaround for this?
    Last edited by deheylen690271; 2017-03-10 at 03:42 PM.

  2. #2
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: using vplayer and -layer commands on layers with wildcards in their names

    Welcome to AUGI.

    No, there is no way to prevent WCMATCH in the -LAYER Command... It really is unfortunate that your employer has intentionally used a layer naming convention that introduces this issue into your work.

    That said, you can either do this by substituting * for [ and ] using "AR.*E*.EQUIP"... Or perhaps using the Visual LISP approach using the Layer Table Record Object directly for Freeze/Thaw... The latter is not as straight forward when dealing with Viewport Freeze/Thaw.


    Cheers
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  3. #3
    Member
    Join Date
    2015-01
    Posts
    43
    Login to Give a bone
    0

    Default Re: using vplayer and -layer commands on layers with wildcards in their names

    Hey, thanks for the response.

    I kind of figured I was up s* creek without a paddle (in a chicken-wire canoe & heading for Deadman's Falls) on this one. I used your solution, though I used 'AR.?E?.EQUIP' to try and avoid as many unintended matches as I can. I can assure you, using that character wasn't intentional though it certainly was unfortunate. But you know what I find REALLY unfortunate? That AutoDesk would (actually) intentionally allow the use of characters in layer names that the layer & vplayer commands can't deal with! It's pretty much programming 101 that you don't allow the user to input data your program can't handle. Sheesh.
    Last edited by deheylen690271; 2017-03-10 at 10:13 PM.

  4. #4
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: using vplayer and -layer commands on layers with wildcards in their names

    Being that ? will match any single character, perhaps using . would 'avoid [more] unintended matches'; examples:

    Code:
    _$ (wcmatch "AR.[E].EQUIP" "AR.?E?.EQUIP")
    T
    _$ (wcmatch "AR.7EZ.EQUIP" "AR.?E?.EQUIP")
    T
    _$ (wcmatch "AR.7EZ.EQUIP" "AR..E..EQUIP")
    nil
    _$ (wcmatch "AR.[E].EQUIP" "AR..E..EQUIP")
    T
    _$

    Cheers
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

Similar Threads

  1. Replies: 14
    Last Post: 2010-03-24, 05:13 AM
  2. VPLAYER Used to Override Layer Color and Linetype
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2008-10-12, 04:28 PM
  3. Using VPLAYER command with Xref Layers
    By kiwigraham in forum AutoCAD General
    Replies: 3
    Last Post: 2007-01-17, 11:19 AM
  4. Change Layer names to other Layer names via a script?
    By tburke in forum AutoCAD Customization
    Replies: 5
    Last Post: 2006-12-04, 07:30 PM
  5. VPLAYER and Layer states
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 1
    Last Post: 2005-10-31, 09:37 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
  •