Registered forum members do not see this ad.
Dear tharwat
its some what useful.
but if we want to check one by one .
can you do the lisp which can cross check standard blocks and present block so nonstandard blocks could be highlighted.
Dear tharwat,
this is useful .
i want a help from you can i get a lisp which can cross check the blocks from the standard file to my file and highlight the nonstandard blocks.
which will be very useful
It is not that easy to check between two files for their blocks at all and it is out of my ability .
one solution .
you can extract the name of all your standard blocks from the main drawing by a routine and after that you can use these names to check for current blocks in a drawing and divide them into two lists of standard and nonstandard by another routine also of course .
- 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
your solution is good .
can you guide me how to do it....
First let us extract all names of your drawing that contains the standard blocks .
Code:(defun c:BlockList (/ ss i Block blockNames) ;;; Tharwat 07. March . 2012 ;;; (if (setq ss (ssget "_x" '((0 . "INSERT")))) (progn (repeat (setq i (sslength ss)) (if (not (member (setq Block (cdr (assoc 2 (entget (ssname ss (setq i (1- i))))) ) ) blockNames ) ) (setq blockNames (cons Block blockNames)) ) ) (print blocknames) ) (princ) ) (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
"That's it. It's one thing for a ghost to terrorize my children, but quite another for him to play my Theremin." Homer Simpson
Dave
i did this then what should i do
did you see all your standards block names prompted in the command line ?
Try this one which is better than the above one to check all blocks definitions and not only the inserted ones .
And after that save the name of blocks that would be listed in the command line to include them later on in the second routine .Code:(defun c:BlockList (/ ss Block blockNames) ;;; Tharwat 07. March . 2012 ;;; (while (setq ss (tblnext "BLOCK" (null ss))) (if (not (member (setq Block (cdr (assoc 2 ss)) ) blockNames ) ) (setq blockNames (cons Block blockNames)) ) ) (if blocknames (print blocknames) ) (princ) )
But be patient , I have many things to do at the office and would write one for you as soon as I have time to do .
Tharwat
- 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
Registered forum members do not see this ad.
Consider this code as a draft at this moment
Code:(defun c:Test (/ BlockList stand non ss Blockname StandardBlockname nonstandardBlockname ) ;;; Tharwat 07. 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) ) (repeat (setq i (sslength ss)) (setq Blockname (cdr (assoc 2 (entget (ssname ss (setq i (1- i)))))) ) (cond ((member Blockname BlockList) (progn (setq stand (1+ stand)) (setq standardBlock (cons Blockname standardBlock)) ) ) (t (progn (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 " ) ) ) ) ) (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
Bookmarks