Author Topic: Double Tag in EVERY DWG  (Read 4408 times)

0 Members and 1 Guest are viewing this topic.

Mystogan

  • Mosquito
  • Posts: 15
Double Tag in EVERY DWG
« on: May 31, 2019, 05:27:12 AM »
Hi to all,

Would like to know if there's a way that LISP can give a summary of double tag(I'm referring to text values, attribute value, Mtext) in one dwg file then proceed to another dwg file and give another summary list.

It would better about the execution it will produce excel file.

Thank you in advance.



kpblc

  • Bull Frog
  • Posts: 396
Re: Double Tag in EVERY DWG
« Reply #1 on: May 31, 2019, 05:38:11 AM »
Sorry for my English.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Double Tag in EVERY DWG
« Reply #2 on: May 31, 2019, 06:33:28 AM »
What is a 'double tag'?

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Double Tag in EVERY DWG
« Reply #3 on: May 31, 2019, 03:05:38 PM »
What is a 'double tag'?

I'm guessing multiple annotation objects with the same text content.

Mystogan

  • Mosquito
  • Posts: 15
Re: Double Tag in EVERY DWG
« Reply #4 on: June 02, 2019, 11:31:20 PM »
What is a 'double tag'?

I'm guessing multiple annotation objects with the same text content.


Yes, that's correct...

Hope you can help me

Thank you in advance

BIGAL

  • Swamp Rat
  • Posts: 1398
  • 40 + years of using Autocad
Re: Double Tag in EVERY DWG
« Reply #5 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: [Select]
(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))
)

Code: [Select]
(setq ent (entget (handent "handle id"))) ; to retrieve object data
« Last Edit: June 09, 2019, 06:28:33 AM by BIGAL »
A man who never made a mistake never made anything

Mystogan

  • Mosquito
  • Posts: 15
Re: Double Tag in EVERY DWG
« Reply #6 on: June 12, 2019, 10:42:50 PM »
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: [Select]
(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))
)

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

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

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Double Tag in EVERY DWG
« Reply #7 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?

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Double Tag in EVERY DWG
« Reply #8 on: June 13, 2019, 12:42:31 PM »
There are 10 columns in a plan that all have an mtext annotation identifying their dimensions as "300x300".
Should 9 mtext objects be removed?

And if so, which 9?

Mystogan

  • Mosquito
  • Posts: 15
Re: Double Tag in EVERY DWG
« Reply #9 on: June 13, 2019, 10:07:02 PM »
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?

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?

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Double Tag in EVERY DWG
« Reply #10 on: June 14, 2019, 04:25:21 AM »
@Mystogan:
Comparing what you want to _Find and _DataExtraction is not very clear as these commands are quite different.

BIGAL

  • Swamp Rat
  • Posts: 1398
  • 40 + years of using Autocad
Re: Double Tag in EVERY DWG
« Reply #11 on: June 19, 2019, 02:16:35 AM »
So you want how many "300x300" occurs but done for every word combo ?
A man who never made a mistake never made anything

Mystogan

  • Mosquito
  • Posts: 15
Re: Double Tag in EVERY DWG
« Reply #12 on: June 20, 2019, 11:33:55 PM »
So you want how many "300x300" occurs but done for every word combo ?

yes

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Double Tag in EVERY DWG
« Reply #13 on: June 21, 2019, 08:00:41 AM »
Here's an old program which may help: Text Counter

Mystogan

  • Mosquito
  • Posts: 15
Re: Double Tag in EVERY DWG
« Reply #14 on: June 27, 2019, 03:59:36 AM »
Here's an old program which may help: Text Counter

This is what am looking for Thank you very much sir Lee Mac