Jump to content

attributes, feilds and tables


kytyrc66

Recommended Posts

Hello all, I am trying to make a table with:

1. a space division name

2. department name

3. type of space name

4. SQ FT area using a field that will up date when needed

 

I used an attributed block with single line text for all the information added the field for the SQ.FT., the only problem is when it is exported into a table the area is on a different line than the other info..any suggestions??

 

I did try a multiline text attributed block but that was not any good.

 

Thanks

Link to comment
Share on other sites

Im not sure i understand the nature of your problem. Is it possible that the other information is being interpreted as column labels and not data?

Link to comment
Share on other sites

This may be usefull it reads multiple blocks and creates a table

 

; dwg index to a table
; by Alan H NOV 2013
(defun AH:dwgindex (/ doc objtable ss1 lay ans ans2 plotabs ss1 tag2 tag3 list1 list2 curlayout colwidth numcolumns numrows INC rowheight )

(vl-load-com)
(setq curlayout (getvar "ctab"))
(if (= curlayout "Model")
(progn
(Alert "You need to be in a layout for this option")
(exit)
) ; end progn
) ; end if model
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(setq curspace (vla-get-paperspace doc))
(setq pt1 (vlax-3d-point (getpoint "\nPick point for top left hand of table:  "))) 

; read values from title blocks

(setq bname "DA1DRTXT")

(setq tag2 "DRG_NO") ;attribute tag name
(setq tag3 "WORKS_DESCRIPTION") ;attribute tag name

(setq ss1 (ssget "x"  (list (cons 0 "INSERT") (cons 2 bname))))

(if (= ss1 nil) ; for tomkinson jobs
(progn 
(setq bname "COGG_TITLE")
(setq ss1 (ssget "x"  (list (cons 0 "INSERT") (cons 2 bname))))
)
)

(setq INC (sslength ss1))  
(repeat INC
(foreach att (vlax-invoke (vlax-ename->vla-object (ssname SS1 (SETQ INC (- INC 1)) )) 'getattributes) 
       (if (= tag2 (strcase (vla-get-tagstring att)))
           (progn
           (setq ans (vla-get-textstring att))
           (if (/= ans NIL)
           (setq list1 (cons ans list1))
           ) ; if 
           ); end progn
         ) ; end if
       (if (= tag3 (strcase (vla-get-tagstring att)))
         (progn
         (setq ans2 (vla-get-textstring att))
         (if (/= ans2 NIL)
             (setq list2 (cons ans2 list2)) 
          ) ; end if
          ) ; end progn
 ) ; end if tag3 
   
) ; end foreach

) ; end repeat
(setvar 'ctab curlayout)
(command "Zoom" "E")
(command "regen")


(reverse list1)
;(reverse list2)

; now do table 
(setq numrows (+ 2 (sslength ss1)))
(setq numcolumns 2)
(setq rowheight 0.2)
(setq colwidth 150)
(setq objtable (vla-addtable curspace pt1 numrows numcolumns rowheight colwidth))
(vla-settext objtable 0 0 "DRAWING REGISTER")
(vla-settext objtable 1 0 "DRAWING NUMBER") 
(vla-settext objtable 1 1 "DRAWING TITLE") 

(SETQ X 0)
(SETQ Y 2)

(REPEAT (sslength ss1)
 (vla-settext objtable Y 0 (NTH X LIST1))
 (vla-settext objtable Y 1 (NTH X LIST2))
 (vla-setrowheight objtable y 7)

 (SETQ X (+ X 1))
 (SETQ Y (+ Y 1))
)

(vla-setcolumnwidth objtable 0 55)
(vla-setcolumnwidth objtable 1 170)

(command "_zoom" "e")

); end AH defun

(AH:dwgindex)

(princ)

Link to comment
Share on other sites

Im not sure i understand the nature of your problem. Is it possible that the other information is being interpreted as column labels and not data?

 

 

I would like to make a room tag that has

1 line for division

1 line for dept

1 line for type

1 line that is a field that has the Square Foot of a polyline

 

Then I would like to window the room tags with the information above and have it all go into a table. If the polyline is updated and the area info changes I would like to see those changes in the room tag field and the table update too. Anyone know of a room tag like this or a way I should go about creating it??

 

Thanks

Link to comment
Share on other sites

The room tag is easy there are lots of examples of linking a field to the area of a pline. Search for just that "ROOM" or "AREA" its a often asked for subject here. You should be able to find something that matches.

 

You need to post a sample dwg it may be a simple fix.

Link to comment
Share on other sites

A good idea is to post what was your answer, its helpfull for the next person was it answered over at AUGI.com

 

No it was not answered by AUGI. I search and search found a YouTube video explaining fields and attributes...

 

The only thing I wish I could do with this example is that when you open the attribute advance editor to change the information to be about another polyline is that it would hold the settings for the scale factor. other thatn that it does the job I needed done.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...