Jump to content

Recommended Posts

Posted

Hello,

how can i set row style for any row in table via AutoLISP? I want to set header for second row too. I found function "vla-getrowtype" in refernce book, but there is no function for set row type.

 

Thanks

Posted

You should dump the properties and methods of the table object. This will give more insight as to what you can do.

 

(defun c:dmpobj ()
 (setq sel (entsel "\nSelect Object: "))
 (if sel
   (vlax-dump-object (vlax-ename->vla-object (car sel)) T)
   )
 (princ)
 )

Posted

Hi,

 

Since there is not direct function to set the row with a specific text style, so here is my own function to get the job done as required.

 

(defun vla-setrowtextstyle (tbl row sty / col)
 ;; Tharwat - Date: 28.Feb.2017	;;
 (if (and (= (type tbl) 'VLA-OBJECT)
          (= (vla-get-objectname tbl) "AcDbTable")
          (>= (vla-get-rows tbl) row)
          (tblsearch "STYLE" sty)
          (setq col -1)
       )
   (repeat (vla-get-columns tbl)
     (vla-setcelltextstyle tbl (1- row) (setq col (1+ col)) sty))
   )
 (princ)
 )
;; eg: 
(vla-setrowtextstyle tbl 5 "Standard")

Posted

Nice one, Tharwat!

One small suggestion: you could wrap all the evaluations in a single and function.

Posted
Nice one, Tharwat!

Thank you.

 

One small suggestion: you could wrap all the evaluations in a single and function.

Many ways to skin the cat. ;)

Posted
Hi,

 

Since there is not direct function to set the row with a specific text style, so here is my own function to get the job done as required.

 

(defun vla-setrowtextstyle (tbl row sty / col)
 ;; Tharwat - Date: 28.Feb.2017	;;
 (if (and (= (type tbl) 'VLA-OBJECT)
          (= (vla-get-objectname tbl) "AcDbTable")
          (>= (vla-get-rows tbl) row)
          (tblsearch "STYLE" sty)
          (setq col -1)
       )
   (repeat (vla-get-columns tbl)
     (vla-setcelltextstyle tbl (1- row) (setq col (1+ col)) sty))
   )
 (princ)
 )
;; eg: 
(vla-setrowtextstyle tbl 5 "Standard")

 

This works with text style, but i would like to set row style with acDataRow, acHeaderRow or acTitleRow. It contains: background, text style, text height, alignment. Appearance of table should be depend on table style not text style. Although the result is the same in both ways.

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...