See the top rated post in this thread. Click here

Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: block count only in current space/layout

  1. #1
    100 Club
    Join Date
    2005-05
    Posts
    102
    Login to Give a bone
    0

    Angry block count only in current space/layout

    I came across this handy lisp routines that count blocks. The problem i have that it also counts the blocks in the paperspace. I would like for someone to modify this lisp routine to only count in current drawing. for example, if i am in model space, count only blocks in model space. and If i am in paper layout, count only blocks in a paper layout.

    You can either modify the lisp routines or create your own. Thank You
    Last edited by Wanderer; 2006-01-25 at 09:26 PM. Reason: removed attachment.

  2. #2
    Mod / Salary / SM Wanderer's Avatar
    Join Date
    2001-12
    Location
    St. Louis
    Posts
    5,421
    Login to Give a bone
    0

    Talking Re: block count only in current space/layout

    Quote Originally Posted by VBOYAJI
    I came across this handy lisp routines that count blocks. The problem i have that it also counts the blocks in the paperspace. I would like for someone to modify this lisp routine to only count in current drawing. for example, if i am in model space, count only blocks in model space. and If i am in paper layout, count only blocks in a paper layout.

    You can either modify the lisp routines or create your own. Thank You
    Hi there... just wanted to let you know that I've removed the attachment, as AUGI doesn't allow the posting of copyrighted material.

    I'm sure someone will still be able to help you with the information contained in this thread.

    Thank you.

    here is the header info
    CADALYST 01/05 Tip2015: BLCX.lsp Block counter (c) Alexander Smirnov
    This program counts blocks, gives out the reporting, +
    ;;; and also can export the data to MS Excel. +
    ;;; +
    ;;; Type BLCX in command line to run. +
    ;;; +
    ;;; Supported O/S: Windows 2000/XP +
    ;;; Suppported MS Excel Versions: MS Office 97/2003 +
    ;;; Supported AutoCAD Versions: AutoCAD 2000/2005 +
    ;;; +
    ;;; Writen by Fantom (Alexander Smirnov) asmirnov@inbox.lv +
    ;;; +
    ;;; Version 1.0 Dec 09, 2004
    Melanie Stone
    @MistresDorkness

    Archibus, FMS/FMInteract and AutoCAD Expert (I use BricsCAD, Revit, Tandem, and Planon, too)
    Technical Editor
    not all those who wander are lost

  3. #3
    100 Club
    Join Date
    2005-05
    Posts
    102
    Login to Give a bone
    1

    Default Re: block count only in current space/layout

    Fine, I get it now. No more posting codes that written by someone else. I am clear now. Even though i made it clear it wasn't my code. One last thing, i got this code from AUGI member, from AUGI website. Any how, can someone tell me how to resolve the issue i was facing in my original thread.

    Thank You

  4. #4
    All AUGI, all the time
    Join Date
    2015-12
    Location
    Central Oregon
    Posts
    591
    Login to Give a bone
    0

    Default Re: block count only in current space/layout

    Looking at the code as posted to the Cadalyst website (under Hot Tip Harry's Feb05 code) it was originally written for the user to select the blocks. Based on what your question was, I'd venture a guess that someone changed the (ssget '((0 . "INSERT"))) to (ssget "x" '((0 . "INSERT"))) to select ALL blocks.....if that's the case, just change the same line to: (ssget "x" (list '(0 . "INSERT") (cons 410 (getvar "ctab")))) this will select All blocks ONLY in the current Tab.

    HTH,
    Jeff

  5. #5
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: block count only in current space/layout

    Quote Originally Posted by VBOYAJI
    I came across this handy lisp routines that count blocks. The problem i have that it also counts the blocks in the paperspace. I would like for someone to modify this lisp routine to only count in current drawing. for example, if i am in model space, count only blocks in model space. and If i am in paper layout, count only blocks in a paper layout.

    You can either modify the lisp routines or create your own. Thank You
    Give this my routine that was written some time ago for my mate
    but I think that it is what you need
    Change all by suit

    Thank you

    f.
    Attached Files Attached Files

  6. #6
    100 Club
    Join Date
    2005-05
    Posts
    102
    Login to Give a bone
    0

    Unhappy Re: block count only in current space/layout

    I tried in doing that, but it seems that i am getting an error.
    this what i am doing,
    **********current code**********
    Code:
      (if(setq blSet(ssget '((0 . "INSERT"))))
    **********This is the change i made according to your suggestion:**********
    Code:
      (ssget "x" (list '(0 . "INSERT") (cons 410 (getvar "ctab"))))
    Quote Originally Posted by miff
    Looking at the code as posted to the Cadalyst website (under Hot Tip Harry's Feb05 code) it was originally written for the user to select the blocks. Based on what your question was, I'd venture a guess that someone changed the (ssget '((0 . "INSERT"))) to (ssget "x" '((0 . "INSERT"))) to select ALL blocks.....if that's the case, just change the same line to: (ssget "x" (list '(0 . "INSERT") (cons 410 (getvar "ctab")))) this will select All blocks ONLY in the current Tab.

    HTH,
    Jeff
    [ Moderator Action = ON ]Copyright material removed[ Moderator Action = OFF ]
    Last edited by Opie; 2006-01-26 at 05:00 PM. Reason: remove copyright material

  7. #7
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,203
    Login to Give a bone
    0

    Default Re: block count only in current space/layout

    Quote Originally Posted by VBOYAJI
    I tried in doing that, but it seems that i am getting an error.
    this what i am doing,
    **********current code**********
    Code:
      (if(setq blSet(ssget '((0 . "INSERT"))))
    **********This is the change i made according to your suggestion:**********
    Code:
      (ssget "x" (list '(0 . "INSERT") (cons 410 (getvar "ctab"))))


    [ Moderator Action = ON ]Copyright material removed[ Moderator Action = OFF ]
    I think if you place the (if at the beginning of the line of code you modified, it should work.

    Code:
    (if(ssget "x" (list '(0 . "INSERT") (cons 410 (getvar "ctab"))))
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  8. #8
    100 Club
    Join Date
    2005-05
    Posts
    102
    Login to Give a bone
    0

    Cool Re: block count only in current space/layout

    It tried and did not work, I was wondering if you can download the lisp routine and try it.
    Here is the website:
    http://new.cadalyst.com/code/browsey...?fullyear=2005

    By the way, I appreciate your help very much.

    Thank You

    vboyaji

    Quote Originally Posted by Opie
    I think if you place the (if at the beginning of the line of code you modified, it should work.

    Code:
    (if(ssget "x" (list '(0 . "INSERT") (cons 410 (getvar "ctab"))))

  9. #9
    All AUGI, all the time
    Join Date
    2015-12
    Location
    Central Oregon
    Posts
    591
    Login to Give a bone
    0

    Default Re: block count only in current space/layout

    Quote Originally Posted by VBOYAJI
    It tried and did not work, I was wondering if you can download the lisp routine and try it.
    Here is the website:
    http://new.cadalyst.com/code/browsey...?fullyear=2005

    By the way, I appreciate your help very much.

    Thank You

    vboyaji
    I downloaded the original, changed the one line to this:
    Code:
    (if(setq blSet(ssget "X" (LIST '(0 . "INSERT")(CONS 410 (GETVAR "CTAB")))))
    and it worked fine......when you say "it did not work", did it give an error message or just not do anything?

    Jeff

  10. #10
    100 Club
    Join Date
    2005-05
    Posts
    102
    Login to Give a bone
    0

    Default Re: block count only in current space/layout

    It worked fine.
    Thank you

Page 1 of 3 123 LastLast

Similar Threads

  1. Layer Frozen/Off Status in Model Space/Layout Space
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 1
    Last Post: 2013-01-17, 04:29 AM
  2. Replies: 0
    Last Post: 2011-10-21, 06:44 PM
  3. Layout Count
    By sam.121498 in forum AutoCAD Fields
    Replies: 2
    Last Post: 2010-01-21, 07:53 AM
  4. model space or layout space
    By jim.dobinson in forum CAD Standards
    Replies: 15
    Last Post: 2005-11-24, 01:16 AM
  5. model space to layout space going from LT-05 to AC-06
    By crater59 in forum AutoCAD LT - General
    Replies: 1
    Last Post: 2005-09-22, 12:05 AM

Posting Permissions

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