Results 1 to 3 of 3

Thread: Count and group Block Parameter by lisp,

  1. #1
    Login to Give a bone
    0

    Default Count and group Block Parameter by lisp,

    Hi everyone, just wondering if we can possibly count the dimensions off the block parameters, please refer to the attached image

    Every month I have almost 5000 sqm of walls to draft up, each wall consists of a number of panels (same width and thickness just different lengths),

    I've created a dynamic block for the standard panel that allows you to stretch the wall to any certain lengths, but counting them is the most difficult part,

    I know there's plenty of lisp that can count the blocks for you, but this situation here is that you have one dynamic block, this dynamic block will be used multiple times, with different lengths. The question is : how can we count all different lengths to a table, says there're 25 off 2400mm long panel, 30 off 1000 long panels and so on.

    Any idea will be so much appreciated since I will do everything to cut short this miserable process,
    Attached Images Attached Images

  2. #2
    Past Vice President / AUGI Volunteer peter's Avatar
    Join Date
    2000-09
    Location
    Honolulu HI
    Posts
    1,109
    Login to Give a bone
    0

    Default Re: Count and group Block Parameter by lisp,

    Dynamic Block Properties, Block Counting (recursive is better) and Table Generation is required.

    Can you program LISP?

    Can you share with me your dynamic block library that you need to count?

    This is an intermediate level program to write.

    I develop software like this for my business and I can help you find the right posts and you could write it.

    There are a lot of lurkers here that can write that one too.

    P=
    AutomateCAD
    AutomateCAD

  3. #3
    Login to Give a bone
    0

    Default Re: Count and group Block Parameter by lisp,

    Hi Peter,

    not sure how to attached a file to the reply box, so I've uploaded to Mediafire in underlink,

    http://www.mediafire.com/download/fb...l_Standard.dwg

    I don't know much about wirting lisp but I'm learning to resolve this issue, so far my research has led me to the point that I have this lisp here which can be able to count the linear meter of the panels, but I haven't found a way to export this output into a table in AutoCad yet,

    The table should write (just conceptually not necessarily exact):

    Description Length Qty Total
    Standard Panel 2400 1 2400
    Standard Panel 2300 2 4600
    Standard Panel 2700 3 8100
    Corner Panel 2400 1 2400
    H-Section 2400 1 2400


    (defun c:CDL (/ ss strnum bnm val lst d l Pname)
    ;;; pBe Arpil 2012 ;;;
    (vl-load-com)
    (setq Pname "DistanceX"
    lst nil
    )
    (defun strnum (var val / p)
    (repeat (abs (- val (strlen var)))
    (setq p (strcat " "
    (if p p " "))))
    (strcat var p)
    )
    (if (ssget "_X" '((0 . "INSERT")(2 . "STD PANELS,STD CORNER,H SECTION,`*U*")))
    (progn
    (vlax-for itm (setq ss (vla-get-activeselectionset
    (vla-get-activedocument
    (vlax-get-acad-object)
    )
    )
    )
    (if (and (= :vlax-true (vla-get-isdynamicblock itm) )
    (setq bnm (vla-get-effectivename itm))
    (setq val (vl-remove-if-not
    '(lambda (x)
    (eq (vla-get-PropertyName
    x ) Pname ))
    (vlax-invoke itm
    'getdynamicblockproperties
    )
    )
    )
    )
    (if (setq d
    (assoc (list (setq l (vlax-get (car val) 'value)) bnm) lst)
    )
    (setq lst (subst (list (list l bnm) (1+ (cadr d))) d lst))
    (setq lst (cons (list (list l bnm) 1 ) lst))
    )
    )
    )
    (vla-delete ss)
    (textscr)
    (princ "\nBlock Name QTY Length Total")
    (foreach it (vl-sort lst '(lambda (k l) (< (cadar k) (cadar l))))
    (princ (strcat "\n"
    (strnum (cadar it) 16)
    (strnum (itoa (last it)) 7)
    (strnum (rtos (caar it) 2 2) 14)
    (rtos (* (caar it) (last it)) 2 2)))
    )
    )
    (prompt "\n** Nothing selected ** ")
    )
    (princ)
    )

Similar Threads

  1. Parameter block a lisp.
    By luislhss in forum AutoLISP
    Replies: 2
    Last Post: 2013-08-06, 12:29 PM
  2. count block
    By lee.johnson in forum AutoLISP
    Replies: 12
    Last Post: 2009-09-30, 03:24 PM
  3. Maximum character count for an inputted parameter
    By petervanko in forum Revit Architecture - General
    Replies: 1
    Last Post: 2009-07-28, 08:28 PM
  4. Count parameter
    By cadman6735 in forum Revit Architecture - General
    Replies: 2
    Last Post: 2009-01-05, 07:43 PM
  5. LISP Block Insert routine no longer works once a parameter is modified
    By JAC.95598 in forum Dynamic Blocks - Technical
    Replies: 1
    Last Post: 2005-11-22, 04:50 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
  •