find certain elements [ Blocks/ Numbers] and give a count

Discussion in 'AutoCAD' started by maryam, Jul 6, 2004.

  1. maryam

    maryam Guest

    Hi

    I am wondering how I could write a function that finds certain numbers or blocks in AutoCAD and counts them. Is it possible to do it with c++? I am not very familiar with lisp. but I really appreciate if someone could help me to write it in lisp, because loading it is easy.

    thanks

    maryam
     
    maryam, Jul 6, 2004
    #1
  2. maryam

    Jürg Menzi Guest

    Hi Maryam

    Express Tools -> BCOUNT

    Cheers
     
    Jürg Menzi, Jul 7, 2004
    #2
  3. maryam

    Rajesh Guest

    (defun c:BCOUNT( / bname len)
    (setq bname (getstring"Enter Block name <or press enter to select>:"))
    (if (= bname "") (setq bname (cdr (assoc 2 (entget(car(entsel"Select the block:")))))))
    (setq len (itoa (sslength (ssget "x" ( list (cons 0 "INSERT")(cons 2 bname))))))
    (Princ (strcat "\nNumber of -" bname "- blocks in the file is: " len))(princ)
    )
     
    Rajesh, Jul 7, 2004
    #3
  4. maryam

    maryam Guest

    I have no expresstools!!! how can I load them?
     
    maryam, Jul 7, 2004
    #4
  5. maryam

    Jürg Menzi Guest

    Hi maryam

    There was a period you had to pay extra for express tools to Autodesk's snaky
    cashmakers (or you was a VIP member -PointA?- to get it for something like
    free).
    AFAIK, since A2k2/4 Express tools are again part of AutoCAD - you've to start
    Setup -> Install Supplemental Tools -> AutoCAD Express Tools.

    Cheers
     
    Jürg Menzi, Jul 7, 2004
    #5
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.