+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Junior Member
    Discipline
    Electrical
    Using
    AutoCAD 2015
    Join Date
    Feb 2017
    Posts
    14

    Default Count Occurrences of Specific String

    Registered forum members do not see this ad.

    I am trying to script a counter of specific strings. How can I select all occurrences of text that has a specific value? I cannot use filter or quickselect, and I cannot get selection sets to find specified values. Any help would be greatly appreciated. I am using ACADE 2015.

  2. #2
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,885

    Default

    You are incorrect about using selection sets, just make a selection set of text or mtext then look at each string using (wcmatch txtstring "your string*") it will return T true if it matches.
    A man who never made mistakes never made anything

  3. #3
    Luminous Being Dadgad's Avatar
    Using
    AutoCAD 2013
    Join Date
    Nov 2011
    Location
    At the confluence of worthlessness & invaluability
    Posts
    5,976

    Default

    I don't understand why you are unable to use Filter, how about using FIND & REPLACE, just for the search functionality?
    Volume and repetition do not validate opinions forged in the absence of thought.

  4. #4
    Super Member
    Computer Details
    tombu's Computer Details
    Operating System:
    Windows 7 64-bit
    Computer:
    Dell
    Discipline
    Civil
    tombu's Discipline Details
    Occupation
    Design Analyst
    Discipline
    Civil
    Details
    Small Street & Stormwater projects. Traffic Calming and other issues.
    Using
    Civil 3D 2018
    Join Date
    Dec 2010
    Location
    Tallahassee, FL USA
    Posts
    735

    Default

    Quote Originally Posted by Dadgad View Post
    I don't understand why you are unable to use Filter, how about using FIND & REPLACE, just for the search functionality?
    The Filter command was how I learned to do it a quarter century ago. We have many selection options now, but Filter will always be on my list.

  5. #5
    Junior Member
    Discipline
    Electrical
    Using
    AutoCAD 2015
    Join Date
    Feb 2017
    Posts
    14

    Default

    Quote Originally Posted by BIGAL View Post
    You are incorrect about using selection sets, just make a selection set of text or mtext then look at each string using (wcmatch txtstring "your string*") it will return T true if it matches.
    I found a way to do it. I ended up finding the dxf group codes I needed to specify the contents with ssget.

  6. #6
    Junior Member
    Discipline
    Electrical
    Using
    AutoCAD 2015
    Join Date
    Feb 2017
    Posts
    14

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by Dadgad View Post
    I don't understand why you are unable to use Filter, how about using FIND & REPLACE, just for the search functionality?
    It uses a popup window, therefore it cannot be scripted how I need it.

Similar Threads

  1. Count Specific Block Name and Insert Block to Coords Depending on Block Count
    By kylaughlan in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 12th Jan 2017, 08:56 am
  2. count value in a string between the parenthese
    By CadFrank in forum AutoLISP, Visual LISP & DCL
    Replies: 10
    Last Post: 20th Jul 2016, 07:17 am
  3. Lisp to count blocks on specific layers
    By chee_dee in forum AutoLISP, Visual LISP & DCL
    Replies: 14
    Last Post: 9th Feb 2013, 07:49 am
  4. Need a way to count blocks in specific ROOMS
    By mmCAZ in forum AutoCAD Drawing Management & Output
    Replies: 15
    Last Post: 15th Mar 2012, 02:58 am
  5. Count amount blocks and length specific polylines
    By SstennizZ in forum AutoLISP, Visual LISP & DCL
    Replies: 0
    Last Post: 16th Jul 2008, 03:33 pm

Tags for this Thread

Bookmarks

Posting Permissions

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