Code Red > AutoLISP (Vanilla / Visual)

Double Tag in EVERY DWG

<< < (2/3) > >>

BIGAL:
If you do a ssget with *text that handles mtext and text then make a list of the text and the entity name then do a sort. next step is compare two items sequentially in the list if they match get further details and write a csv file etc. this stores the handle id which can be used to retrieve object data. use (handent "handle id") to

Here is a start


--- Code: ---(setq ss (ssget "x" (list (cons 0 "*text"))))
(setq lst '())
(repeat (setq x (sslength ss))
(setq ent (entget (ssname ss (setq x (- x 1)))))
(setq lst (cons (list (cdr (assoc 1 ent)) (cdr (assoc 5 ent))) lst))
)
(setq lst (vl-sort lst
             (function (lambda (e1 e2)
                         (< (car e1) (car e2)))))
)
(setq x 0)
(setq t1 (nth 0 (nth 0 lst)))
(repeat (- (length lst) 1)
(setq t2 (nth 0 (nth (+ x 1) lst)))
(if (= t1 t2)
(progn
(alert (strcat "match found \n \n do write csv here\n \n" t1))
(setq t1 t2)
)
(progn
(setq t1 t2)
)
)
(setq x (+ x 1))
)

--- End code ---


--- Code: ---(setq ent (entget (handent "handle id"))) ; to retrieve object data

--- End code ---

Mystogan:

--- Quote from: BIGAL on June 09, 2019, 06:13:10 AM ---If you do a ssget with *text that handles mtext and text then make a list of the text and the entity name then do a sort. next step is compare two items sequentially in the list if they match get further details and write a csv file etc. this stores the handle id which can be used to retrieve object data. use (handent "handle id") to

Here is a start


--- Code: ---(setq ss (ssget "x" (list (cons 0 "*text"))))
(setq lst '())
(repeat (setq x (sslength ss))
(setq ent (entget (ssname ss (setq x (- x 1)))))
(setq lst (cons (list (cdr (assoc 1 ent)) (cdr (assoc 5 ent))) lst))
)
(setq lst (vl-sort lst
             (function (lambda (e1 e2)
                         (< (car e1) (car e2)))))
)
(setq x 0)
(setq t1 (nth 0 (nth 0 lst)))
(repeat (- (length lst) 1)
(setq t2 (nth 0 (nth (+ x 1) lst)))
(if (= t1 t2)
(progn
(alert (strcat "match found \n \n do write csv here\n \n" t1))
(setq t1 t2)
)
(progn
(setq t1 t2)
)
)
(setq x (+ x 1))
)

--- End code ---


--- Code: ---(setq ent (entget (handent "handle id"))) ; to retrieve object data

--- End code ---

--- End quote ---

Hi BIGAL,

Thank you for the initiative of the code. Unfortunately I have no idea on where to put and completely rewrite your code that can give me a command/execution key

roy_043:
IMO the definition of a 'double tag' is still unclear.
Example:
There are 10 columns in a plan that all have an mtext annotation identifying their dimensions as "300x300".
Should 9 mtext objects be removed?

Lee Mac:

--- Quote from: roy_043 on June 13, 2019, 09:53:07 AM ---There are 10 columns in a plan that all have an mtext annotation identifying their dimensions as "300x300".
Should 9 mtext objects be removed?

--- End quote ---

And if so, which 9?

Mystogan:

--- Quote from: roy_043 on June 13, 2019, 09:53:07 AM ---IMO the definition of a 'double tag' is still unclear.
Example:
There are 10 columns in a plan that all have an mtext annotation identifying their dimensions as "300x300".
Should 9 mtext objects be removed?

--- End quote ---

Hi sir roy_043
To make a more clear perspective of the intent is like. In using command Find in autocad it will give you list of exact word/letter that you want to look for and you notice there is two or more same work/letter. That's what I want that list of word.

In other command of autocad known as data extraction here you can have a list of block value/mtext/text etc.,This is what I'm looking a summary of value. The command key should be extract only the block value/mtext/text. With this command you don't need check/uncheck other function in data extraction.

It is posibble?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version