Creating tables of selected objects selected properties including text labels for those objects

Creating tables of selected objects selected properties including text labels for those objects

cbayley38
Explorer Explorer
711 Views
3 Replies
Message 1 of 4

Creating tables of selected objects selected properties including text labels for those objects

cbayley38
Explorer
Explorer

It seems like I am missing a simple workflow change to achieve what I am trying to achieve.  I am working on a project in which i receive large numbers of polyline objects that I label and fabricate matching templates for.  I am trying to produce a spreadsheet that shows each object's area and perimeter and includes the respective labels I have placed within each object.  I tried table extraction but there is no associating between the text objects and the polyline objects so the polyline properties of each object display in the table independent of the text labels.  The resulting table produces data rows for the polyline objects but they are not identified with my text labels.  Currently I am either manually labeling, TCOUNT labeling, or using NUMINC lsp to label the polyline objects.  Does anyone know a way to make a table that will lable these polyline objects in way that matches what is shown on the drawing or is there a different method of labeling that would create somekind of association with the polylines?  I've attached a couple of screenshots showing a drawing sample and the resulting table data extracting.  Ideally i would like to add a column for the text data labels that corresponds with the correct rows showing the area and perimeter data for each object.

0 Likes
712 Views
3 Replies
Replies (3)
Message 2 of 4

pendean
Community Legend
Community Legend

What you seek is usually performed in AutoCAD with blocks that contain attributes, not just plain TEXT, perhaps that's where you need to explore starting? Here is a good online resource to introduce that ability to you

https://www.scan2cad.com/blog/cad/autocad-data-extraction/ 

if you prefer video https://www.youtube.com/watch?v=UIPZlKK6hpA 

 

if you only ever want to use TEXT though, in your tables to can explore using FIELDs in each cell that link to your text

https://help.autodesk.com/view/ACD/2024/ENU/?guid=GUID-B24A017B-66CA-4F24-AC50-7CAEAC737B7A

0 Likes
Message 3 of 4

AVCPlugins
Advisor
Advisor

It seems to me that you need to turn the problem statement in the opposite direction. You need to store supporting data about drawing objects within the objects themselves and then output this data to both text labels and tables. As a standard way of storing auxiliary information in AutoCAD, blocks with attributes are used. However, you will have problems entering the length and area of polylines into the attributes. Here you will need a script or plugin.
It is also possible to add a description to a regular polyline. For example, here is the AvcPalette plugin that does this. You can then display this information on text labels or leaders or in tables (along with lengths and areas).


Plugins for AutoCAD
A>V>C>
AppStore | Facebook | Twitter | YouTube | Blog
Message 4 of 4

ВeekeeCZ
Consultant
Consultant

In these cases, unless you have specialized software like MAP or another, you end up with a LISP routine, similar to the one below. Because the options above noted (msg 2) are too cumberstome.

 

(vl-load-com)

(defun c:ExportPlinewLabels ( / s i e l)
  
  (princ "\nSelect polylines, labels must be texts:")
  (if (setq s (ssget '((0 . "LWPOLYLINE"))))
    (repeat (setq i (sslength s))
      (setq e (ssname s (setq i (1- i)))
	    l (cond ((setq m (ssget "_CP" (mapcar 'cdr (vl-remove-if '(lambda (x) (/= (car x) 10)) (entget e))) '((0 . "TEXT"))))
		     (apply 'strcat (mapcar '(lambda (x) (strcat "," (cdr (assoc 1 (entget x))))) (vl-remove-if 'listp (mapcar 'cadr (ssnamex m))))) )
		    (",N/A")))
      (princ (strcat "\n" (rtos (getpropertyvalue e "Length") 2 8) "," (rtos (getpropertyvalue e "Area") 2 8) l))))
  (princ)
  )

 

0 Likes