Wcmatch question

Discussion in 'AutoCAD' started by Gordon Price, Apr 23, 2004.

  1. Gordon Price

    Gordon Price Guest

    I am trying to step thru all my Named Page Setups, and delete some by name.
    In the following code, IL imports the named Page Setups fine. In DL, the
    first Alert works fine, showing both Setups, but the second Alert fails for
    both names, so I assume I am doing something wrong with wcmatch. At first I
    was searching for "B&W*", but even just looking for "Plotter*" isn't
    working.
    I hate when I get stumped on these really short things. Makes me want to go
    home and go back to bed.

    Thanks,
    Gordon


    (defun c:IL ()

    (setvar "FILEDIA" 0)
    (command "-psetupin" "Xerox Plotting.dwg" "30x42 - B&W Plotter")
    (command "-psetupin" "Xerox Plotting.dwg" "30x42 - B&W Plotter (half)")
    (setvar "FILEDIA" 1)
    (princ))

    (defun C:DL ()
    (vlax-for ps (vla-get-plotconfigurations (vla-get-activedocument
    (vlax-get-acad-object)))
    ;(vla-delete ps)
    (Alert (vla-get-name ps))
    (if (wcmatch (vla-get-name ps) "Plotter*")(Alert (vla-get-name ps)))
    ); vlax-for
    (princ))
     
    Gordon Price, Apr 23, 2004
    #1
  2. Gordon Price

    Jeff Mishler Guest

    "*B&W*" or "*Plotter*"

    You need to woldcard match BOTH sides of the string to find....

    Jeff
     
    Jeff Mishler, Apr 23, 2004
    #2
  3. Gordon Price

    Gordon Price Guest

    Uh, shouldn't have gotten out of bed. Thanks, works like a champ now ;)

    Gordon
     
    Gordon Price, Apr 23, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.