



Registered forum members do not see this ad.
Tharwat a suggestion dump the blocks from the master dwg into a txt file name only and put somewhere safe. 2nd part run again on current drawing and compare the two lists. Display or write out some form of list found or not found.
3rd bit harder beyond me as part of step 1 write out the number of entities and name per block save as master txt do 2nd again for name and number of entities this is rough but would find a few changes.
result this time is
Found
Found but changed
Not found.
Like a lot of us sounds simple but takes a lot of time to write and test.
A man who never made mistakes never made anything
Dear Tharwat,
thank you very much but i need one thing added to the lisp, the non standard block could be highlighted what ???????????????????
You're welcome
Check this one ...
Code:(defun c:Test (/ BlockList stand non ss Blockname StandardBlockname nonstandardBlockname ) ;;; Tharwat 08. March. 2012 ;;; (setq BlockList '("Block1" "Block2")) ;;; Put the block name that you got from the first routine instead of the block names (if (and (setq ss (ssget "_x" '((0 . "INSERT")))) (setq stand 0) (setq non 0) (setq sel (ssadd)) ) (repeat (setq i (sslength ss)) (setq Blockname (cdr (assoc 2 (entget (setq sn (ssname ss (setq i (1- i))))) ) ) ) (if (member Blockname BlockList) (progn (setq stand (1+ stand)) (setq standardBlock (cons Blockname standardBlock)) ) (progn (ssadd sn sel) (setq non (1+ non)) (setq nonstandardBlock (cons Blockname nonstandardBlock)) ) ) ) (princ) ) (if Blockname (alert (progn (strcat " You have : < " (itoa stand) " > Standard Blocks inserted into this drawing " "\n" (strcat " You have : < " (itoa non) " > Nonstandard Blocks inserted into this drawing " ) ) ) ) ) (if (>= non 1) (sssetfirst nil sel) ) (princ) )
- When aim is being settled in my mind , I have to reach it and get it in hand whatever it costs and wherever it is and will never give up . Tharwat said
Tharwat, this is similar to a recent post I place looking for information on how to dump a list of all the blocks in my drawing. By all the blocks I mean all of them. Not the ones that have been inserted. I see by using this command:
this will list all the information about block t288, and it lists the long narrative description (4) which is what I need to identify the blocks I have against the blocks I still need to add. There are about 100 blocks in this drawing right now and I have to find someway to get my hands around what's in there and what's not. Can you assist me in how to get a listing of all the blocks in this file?Code:(tblsearch "BLOCK" "t288")
OK, so I've tried this:
but all I get is <Selection set: 31>. So now how do I access Selection Set: 31, to see what's in it.Code:(ssget "X" (list (cons 0 "INSERT")))
Last edited by Bill Tillman; 9th Mar 2012 at 02:27 am.
It's deja vu, all over again.




Try something like this its actually a bit easier using VL if you want a global answer like all blocks all layers use ssget when you want to use filters as well. if you want to use ssget then you need ( ssname ss x) pulls entity number x from list remember starts at 0.
ps starting to come to grips with VLCode:(setq doc (vla-get-activedocument (vlax-get-acad-object))) ; open database (vlax-for block (vla-get-blocks doc) ; get all the blocks same as ssget (setq blkname (vla-get-name block)) ;get block name in for loop (if (not (wcmatch (strcase (vla-get-name block) t) "*_space*")) ; dont show model space etc (princ blkname) ; do what you want here ) )
A man who never made mistakes never made anything
Thanks BigAl,
I found this:
http://www.cadtutor.net/forum/showth...ABLE-NAME-LIST
and also this:
In the posting by Lee-Mac above I substituted 4 in the 70 field and it got the first block then crashed. So I substituted 4 for the 2 field and I got all those descriptions I'm after. But I need a way to put 2 and 4 together so I can have the block name and the associated description together.Code:(setq blist (acet-table-name-list (list "block" 1 4)))
Will try the example above in your reply now.
ps Coming to grips...well kind of...I'm gripping my hair and pulling it out.
The example you gave works but it doesn't separate the block names. The acet-table command above lists all the blocks in quotes which makes parsing them easier for me. I just need a way to get the blocks and the descriptions in a listing together.
Thanks again for the pointers...I'm still hacking but now it's time to put the monster away!
It's deja vu, all over again.




Maybe (nth blist x) no cad at moment
A man who never made mistakes never made anything
Registered forum members do not see this ad.
hey tharwat,
how are hope so doing well.
do you have lisp which can convert the layers data from excel to autocad.
note :- only layer name , color and line type is given
Bookmarks