• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

find double blocks

  • Thread starter Thread starter Gigi Castle
  • Start date Start date

Gigi Castle

Guest
good morning to all, it is possible with a lisp to find all the blocks with the same name inside a dwg and then make sure that you highlight them by changing the color of the doubles found?
thanks in advance
 
conblok allows you to find a specific block (in an area or throughout the design) and to start lines that from an empty point of the design, reach all blocks with the same name.
Alternatively you can create a table that specifies the no. of all the blocks found (if you decide to search all the blocks, with any name, present in that area).
 

Attachments

conblok allows you to find a specific block (in an area or throughout the design) and to start lines that from an empty point of the design, reach all blocks with the same name.
Alternatively you can create a table that specifies the no. of all the blocks found (if you decide to search all the blocks, with any name, present in that area).
thanks for the answer...but instead of creating the table (which also tells me the single blocks), there would be one way only to select the double ones that you find? so doing it would suffice to change them of layers with a different color and I would have settled.. the drawings I have to analyze have from 1000 blocks up more than anything. .
 
the blocks found in the 'single' mode (the one who wants you to identify them with the lines), puts them in a selection set "previous". this means that you can give the 'change' command, select the precedent by giving it "p" and change it layers.
 
so I have to start the command and click for every single block for 1000 drawing blocks, the concept was just to avoid this and find an automatic selection of doubles. .
 
you don't need a lisp to do stash...just selectsimilar command or block count
I have two lists of blocks with attached description refined in the same dwg, with selectsimilar also selects the individual blocks..in coins, I must highlight in the "list 1" what is present in the "list 2", so excluding all single blocks
 
I have two lists of blocks with attached description refined in the same dwg, with selectsimilar also selects the individual blocks..in coins, I must highlight in the "list 1" what is present in the "list 2", so excluding all single blocks
I didn't understand anything. .
 
as from image, I have to find the way to highlight all the blocks of the list to which they repeat in the list b, this for various designs..so the fact of having to select block by block to see if it is actually double and then change layers is too mechanical. .

the lisp that kindly posted to me x11start manages to locate the double blocks but does not select them, but creates a table that shows only what they are..if instead of creating lines and tables it would just be fantastic. Although I approached the lisp recently, I tried to change it without success. .
 

Attachments

  • Esempio.webp
    Esempio.webp
    70.5 KB · Views: 10
a lisp of peter jamtgaard, perhaps it would be more suitable than mine: once launched writes to video the list of all blocks and their n.
it would be to launch the lisp, with f2 open the text screen, select scrolling down and holding down the left mouse button, make a copy-paste on a new block document; at this point the comparison could also happen by importing the text file on the excel columns. I'll throw it there!
 

Attachments

I would solve it like this:
Code:
; ;
;; spulcia - highlights the blocks of the 2nd selection set
;; present also in the 1st selection set
;;
; ;
(defun crea_lista (ss / list n)
(setq n 0 list '() ))
(repeat (sslength ss)
(setq list(cons (cdr(assoc 2 (entget(ssname ss n)))))(ssname ss n))))))
(setq n(1+n))
)
list
)


(defun c:spulcia (/ ss_a ss_b list_a double list_b)
(prompt)\nselect blocks list a)
(setq ss_a(sget '(0 . "insert")))))
(prompt)\nselect blocks list b)
(setq ss_b(sget '(0 . "insert")))))
(setq list_a(crea_lista ss_a))
(setq list_b(crea_lista ss_b))
(double setq(ssadd))
(foreach b list)
(if (assoc (car b) list_a)
(laughing)
)
)
(if (>(double length)0)
(progn)
(sssetfirst nil double)
(prompt(strcat"\n"(itoa(sslength double))) " duplicates detected"))
)
(prompt)\nnessa duplicate detected)
)

(princ)
)
 
I would solve it like this:
Code:
; ;
;; spulcia - highlights the blocks of the 2nd selection set
;; present also in the 1st selection set
;;
; ;
(defun crea_lista (ss / list n)
(setq n 0 list '() ))
(repeat (sslength ss)
(setq list(cons (cdr(assoc 2 (entget(ssname ss n)))))(ssname ss n))))))
(setq n(1+n))
)
list
)


(defun c:spulcia (/ ss_a ss_b list_a double list_b)
(prompt)\nselect blocks list a)
(setq ss_a(sget '(0 . "insert")))))
(prompt)\nselect blocks list b)
(setq ss_b(sget '(0 . "insert")))))
(setq list_a(crea_lista ss_a))
(setq list_b(crea_lista ss_b))
(double setq(ssadd))
(foreach b list)
(if (assoc (car b) list_a)
(laughing)
)
)
(if (>(double length)0)
(progn)
(sssetfirst nil double)
(prompt(strcat"\n"(itoa(sslength double))) " duplicates detected"))
)
(prompt)\nnessa duplicate detected)
)

(princ)
)
It's perfect!! so it leaves me in selection and I can comfortably change layers and color! thank you very much!
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top