Hi everyone,
The following routine creates a table with 7 rows and 5 colums. It automatically merges the first row. So the first row just has 1 cell. How can I unmerge this row to get 5 cells.
Here is the code:
(defun c:addMyTable () (vl-load-com) (setq ActiveDocument (vla-get-activedocument (vlax-get-acad-object))) (setq mSpace(vla-get-modelspace ActiveDocument)) (setq pt (vlax-make-safearray vlax-vbDouble '(0 . 2))) ;insertion point for the table (setq pt0 (getpoint "Select point")) (vlax-safearray-fill pt pt0) (setq myTable (vla-addtable mSpace pt 7 5 10 30)) );defun
Many thanks.
Solved! Go to Solution.
Solved by _Tharwat. Go to Solution.
Add the following line of codes after the function of creating the table .
(vla-unMergeCells myTable 0 0 0 0)
You're welcome .
Assuming that you are using the Vlide program , so if you want to read more about the Active-X function , just highlight any function and press Ctrl+F1 and you should be directly go to the help document with the description of the function that you already chosen .
Or here is a link if you would like : http://entercad.ru/acadauto.en/
Best of luck .
Could you tell me how to merge the cell in the table as the picture below? I tried but just get the first row merge into cell 1x1.
Example:
(vla-MergeCells VlaObj minRow maxRow minCol maxCol )
try
(vla-MergeCells myTable 1 1 0 1)
to merge 2A 2B
Hope that helps
Henrique
Thank you so much. It works perfectly.
By the way, could I know how to set the color for the table (including text) and the text font?
@maikhanhmst wrote:Thank you so much. It works perfectly.
By the way, could I know how to set the color for the table (including text) and the text font?
First of all , I am sorry I did not follow you with your last question and that was due to bad design of the forum that does not show users' subscritions to follow up and to notice if any new reply has been asked or any adds to the thread , so we should thank Henrique for the input and reply .
In regard to your question about the color of the text in a table , just wrap and text string like the following exaple .
(strcat "{\\C1;" Your_String_Here "}")
Note: The above codes color the text string to RED which represented by the number 1 which is after the C character .
Good luck .
Tharwat
@maikhanhmst wrote:
Thank you so much. It works perfectly.
...
You're welcome, maikhanhmst
Glad I could help.
@_Tharwat wrote:
... I am sorry I did not follow you with your last question and that was due to bad design of the forum that does not show users' subscritions to follow up and to notice if any new reply has been asked or any adds to the thread...
You are not alone in that one my fiend, let's hope that forum functionality be restored soon...
Cheers
Henrique
It's OK . Thanks for your reply.
I changed successfully the color of the text in the table.
May I know how to choose the font of the text and to change color for all the line in the table?
I found that the color of the text and the table will be followed the current color layer.
So is there any way to choose the color of the layer I want?
Use this routine to get all avaiable properties and methods of the selected object , then you can search for any function in the help document to collect and to get the proper use of the function .
Good luck .
(defun c:dump (/ e) ;; Tharwat 23.11.2014 ;; (if (setq e (car (entsel "\n Select any object :"))) (progn (vlax-dump-object (vlax-ename->vla-object e) t) (textscr) ) ) (princ) )(vl-load-com)