whethink.blogg.se

Block count autocad lisp
Block count autocad lisp










block count autocad lisp
  1. #Block count autocad lisp mods
  2. #Block count autocad lisp code

Try this mods of the same program and let me know. by the way if possible to arrange the excel output by column for example block name in one column and description in other column and qty another column. (write-line (strcat (car x) " " (cadr x) " " (itoa (caddr x)) " " (nth 3 x)) op)) ((and (setq fl (getfiled "Specify new Excel file name" (getvar 'DWGPREFIX) "csv" 1)) (cond ((not lst) (alert "Couldn't find any block in this drawing !!")) (if (vl-some '(lambda (x) (and (eq ly (car x)) (eq nm (cadr x)) (setq f x))) lst) (setq ds (if (vlax-property-available-p (setq b (vla-item bks nm)) 'comments) (if (and (setq nm (vla-get-effectivename (vlax-ename->vla-object ent))) (while (setq ent (ssname sel (setq int (1+ int)))) (if (setq bks (vla-get-blocks (vla-get-ActiveDocument (vlax-get-acad-object))) Modified on 3rd.Aug.2017 to allow users to (defun c:Blocks2Excel (/ bks int sel ent nm ds b ly f lst fl op) I have just modified the program for you but I don't have time to test it out so please try it and let me know. is there any possibility to select the specific cad blocks not the entire blocks?

#Block count autocad lisp code

If you don't plan to use the values in code somewhere then data extraction works great to give you the data you want. It will export a column data set with the unique settings of all your blocks as well as counts. (write-line "Layer Name: Block Name: QTY Description" op) Run the DATAEXTRACTION command and just use the Dynamic block properties. 620621, 1106 cos function AutoLISP, 892 calculator, 499 Count function. ((and (setq fl (getfiled "Specify new Excel file name" Else, 901903 loops, 903904 Convert Block To Xref tool, 862863 Convert Mesh. (alert "Couldn't find any block in this drawing !!")) (setq lst (vl-sort lst '(lambda (j k) (< (car j) (car k)))))

block count autocad lisp

(setq lst (subst (list ly nm (1+ (caddr f)) ds) f lst))

block count autocad lisp

(setq b (vla-item (vla-get-blocks _doc) nm)) (if (and (eq (vla-get-objectname o) "AcDbBlockReference") (vla-get-ActiveDocument (vlax-get-acad-object)))) This method will use the default settings to select similar. You can then use the Properties palette to count the blocks that have been selected. Layer Name:,Block Name:,QTY,Description There are multiple ways to access this command, but the easiest is to simply select a block in the drawing that you want to count, right-click, and choose Select Similar from the context menu. (defun c:Blocks2Excel (/ _doc nm ds b ly f lst fl op) Try this program that I have just finished from writing it and the program export the collected data to an excel file with csv format, so you can re-save the file in any other format if you'd like to.












Block count autocad lisp