cadmaster1004 Posted December 6, 2022 Posted December 6, 2022 (edited) Hi, guys. I want to ask you a question. There's a block named A And there's a block with names A, B, C, D First, select block A and then block A, B, C, and D at once (mouse drag) I'm looking for a lisp that generates text only on block A In other words, I want to study Lisp that only works on block A. Please take good care of me. I hope you stay healthy! Edited December 6, 2022 by cadmaster1004 Quote
devitg Posted December 6, 2022 Posted December 6, 2022 8 hours ago, cadmaster1004 said: Hi, guys. I want to ask you a question. There's a block named A And there's a block with names A, B, C, D First, select block A and then block A, B, C, and D at once (mouse drag) I'm looking for a lisp that generates text only on block A In other words, I want to study Lisp that only works on block A. Please take good care of me. I hope you stay healthy! As far as I know , you can have only one block named A . please upload sample-dwg , before and after . Quote
mhupp Posted December 6, 2022 Posted December 6, 2022 (edited) 11 hours ago, devitg said: As far as I know , you can have only one block named A. One definition of block A in the block library, But you can have multiples of block A in the drawing. 20 hours ago, cadmaster1004 said: I'm looking for a lisp that generates text only on block A In other words, I want to study Lisp that only works on block A. This should be what your looking for. Added two other lisp that will dump properties of selected items into command prompt. dumpit = dxf codes Vdumpit = visual lisp propeties ;;----------------------------------------------------------------------;; ;; Select Block by Name (defun C:SBN (/ blkname SS) (setq blkname (cdr (assoc 2 (entget (car (entsel "\nSelect Block")))))) ;Gets block name to use in ssget filter (if (setq SS (ssget (list '(0 . "INSERT") (cons 2 blkname)))) ;will only select blocks of the same name (sssetfirst nil SS) ) (princ) ) ;;----------------------------------------------------------------------------;; ;; Dump all methods and properties for selected objects (defun C:VDumpIt (/ ent) (while (setq ent (car (entsel "\nSelect Entity to Dump"))) (vlax-Dump-Object (vlax-Ename->Vla-Object ent) t) ) (textscr) (princ) ) ;;----------------------------------------------------------------------------;; ;; Dump all DXF Group Data (defun C:DumpIt (/ ent) (while (setq ent (car (entsel "\nSelect Entity to Dump"))) (mapcar 'print (entget ent '( "*"))) ) (textscr) (princ) ) Edited December 7, 2022 by mhupp 3 Quote
Steven P Posted December 6, 2022 Posted December 6, 2022 (edited) 1 hour ago, devitg said: As far as I know , you can have only one block named A . please upload sample-dwg , before and after . I took that to mean select block A to be the reference block and then select all blocks, filtering so that only instances of block A are selected. Like MHUPP says, you can have many instances of a block inserted (but only 1 definition of it) Edited December 6, 2022 by Steven P Quote
cadmaster1004 Posted December 6, 2022 Author Posted December 6, 2022 I am sorry for my poor English. But thank you for letting me know. I'll study it with that cord 6 hours ago, mhupp said: One definition of block A in the block library, But you can have multiples of block A in the drawing. This should be what your looking for. Added two other lisp that will dump properties of selected items into command prompt. dumpit = dxf codes Vdumpit = visual lisp propeties ;;----------------------------------------------------------------------;; ;; Select Block by Name (defun C:SBN (/ blkname SS) (setq blkname (cdr (assoc 2 (entget (car (entsel "\nSelect Block")))))) ;Gets block name to use in ssget filter (prompt "\nSelect Polyline") (if (setq SS (ssget (list '(0 . "INSERT") (cons 2 blkname)))) ;will only select blocks of the same name (sssetfirst nil SS) ) (princ) ) ;;----------------------------------------------------------------------------;; ;; Dump all methods and properties for selected objects (defun C:VDumpIt (/ ent) (while (setq ent (car (entsel "\nSelect Entity to Dump"))) (vlax-Dump-Object (vlax-Ename->Vla-Object ent) t) ) (textscr) (princ) ) ;;----------------------------------------------------------------------------;; ;; Dump all DXF Group Data (defun C:DumpIt (/ ent) (while (setq ent (car (entsel "\nSelect Entity to Dump"))) (mapcar 'print (entget ent '( "*"))) ) (textscr) (princ) ) Quote
BIGAL Posted December 6, 2022 Posted December 6, 2022 Maybe this will make a selection set of blocks with 1 name only. (setq BNAME (cdr (assoc 2 (entget (car (entsel "\nPick block for name ")))))) (setq ss (ssget (list (cons 0 "INSERT")(cons 2 bname)))) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.