Lisp for select all block by typing its name in command window

Lisp for select all block by typing its name in command window

paliwal222
Advocate Advocate
776 Views
3 Replies
Message 1 of 4

Lisp for select all block by typing its name in command window

paliwal222
Advocate
Advocate

Hello,

Here i have lisp to select all  block of same name by pick on block, i want to filter or select all block by name, not pick on a block.

(defun c:fbx ( / blockname sset); filter all blocks of same name with one click
(setq blockname (cdr (assoc 2 (entget (car (entsel))))))
(setq sset (ssget "x" (list (cons 2 blockname))))
(sssetfirst sset sset)
(princ (strcat "\nSelected " (itoa (sslength sset)) " instances of block \"" blockname "\"."))
(princ)
)

 

Thanks

0 Likes
777 Views
3 Replies
Replies (3)
Message 2 of 4

ВeekeeCZ
Consultant
Consultant

Is this double-posting and already been solved?

0 Likes
Message 3 of 4

SanjoyNath
Advocate
Advocate

Dear @paliwal222 

We need a log file of these in d drive for which blocks are selected (which user has done that selection and when)

We need the appended data and to change filenames of logging when 6 mega byte is crossed

 

like

 

            (setq Text_Pri(if (setq des1 (open "D:\\CHECKING_OBJECTS_LOGS.TXT" "a"))

                                (progn

                                                (write-line (strcat User "," Date "," Time "," DWG_Path_Name      "           The name of this object is       " objName) des1)

                                                (close des1)

                                )

                     )nt (strcat User "," Date "," Time "," DWG_Path_Name))

 

 

Somewhere i have done some mistake. Som it is not logging

Sanjoy Nath
BIM Manager And Digital Lead (Structures Online)
BOOST, AR , VR ,EPM,IFC API,PDF API , CAD API ,Revit API , Advance Steel API
Founder of Geometrifying Trigonometry(C)
Message 4 of 4

paliwal222
Advocate
Advocate

Thanks

0 Likes