Hello friends.
I have a painting. (before) length and area units are missing from this table. Also the field and length line/label is missing.
How can we add these?
* desired (after)
Thanks in advance to the helpful friend.
Solved! Go to Solution.
Hello friends.
I have a painting. (before) length and area units are missing from this table. Also the field and length line/label is missing.
How can we add these?
* desired (after)
Thanks in advance to the helpful friend.
Solved! Go to Solution.
Solved by komondormrex. Go to Solution.
Solved by komondormrex. Go to Solution.
The best solution for this is to create the table correctly not edit it, so provide a true sample dwg and code matching your desired table result can be provided. Need what are Bolge_1 objects ?
The best solution for this is to create the table correctly not edit it, so provide a true sample dwg and code matching your desired table result can be provided. Need what are Bolge_1 objects ?
No, I just want to add Unit labels and rows. So, as it appears in the after part...
* Table row heights may be the same... or the new row to be added may be slightly higher than the others...
No, I just want to add Unit labels and rows. So, as it appears in the after part...
* Table row heights may be the same... or the new row to be added may be slightly higher than the others...
hey you there,
check the code below
(defun c:correct_table (/ table_object rows_number columns_number add_columns add_units color row column)
(setq table_object (vlax-ename->vla-object (car (entsel "\nPick a table to correct: ")))
rows_number (vla-get-rows table_object)
columns_number (vla-get-rows table_object)
add_columns '("KISIM" "ALAN" "UZUNLUK")
add_units '("" "m\\U+00B2" "m")
color (vla-getcellgridcolor table_object 0 1 actopmask)
row 1
column -1
)
(vla-put-regeneratetablesuppressed table_object :vlax-true)
(vla-insertrows table_object 1 19 1)
(vla-setcolumnwidth table_object 2 45)
(repeat 3
(vla-setcellgridcolor table_object row (setq column (1+ column)) actopmask color)
(vla-setcellgridcolor table_object row column acleftmask color)
(vla-setcellgridcolor table_object row column acbottommask color)
(vla-setcellgridcolor table_object row column acrightmask color)
(vla-setcellvalue table_object row column (nth column add_columns))
(vla-setcelltextheight table_object row column 6)
(vla-setcontentcolor2 table_object row column 0 (vla-getcontentcolor2 table_object 0 0 0))
(vla-setcellalignment table_object row column acmiddlecenter)
)
(repeat (1- rows_number)
(setq column 0)
(setq row (1+ row))
(repeat 2
(vla-setcellvalue table_object row (setq column (1+ column))
(strcat (vlax-variant-value (vla-getcellvalue table_object row column)) " " (nth column add_units))
)
)
)
(vla-put-regeneratetablesuppressed table_object :vlax-false)
(princ)
)
hey you there,
check the code below
(defun c:correct_table (/ table_object rows_number columns_number add_columns add_units color row column)
(setq table_object (vlax-ename->vla-object (car (entsel "\nPick a table to correct: ")))
rows_number (vla-get-rows table_object)
columns_number (vla-get-rows table_object)
add_columns '("KISIM" "ALAN" "UZUNLUK")
add_units '("" "m\\U+00B2" "m")
color (vla-getcellgridcolor table_object 0 1 actopmask)
row 1
column -1
)
(vla-put-regeneratetablesuppressed table_object :vlax-true)
(vla-insertrows table_object 1 19 1)
(vla-setcolumnwidth table_object 2 45)
(repeat 3
(vla-setcellgridcolor table_object row (setq column (1+ column)) actopmask color)
(vla-setcellgridcolor table_object row column acleftmask color)
(vla-setcellgridcolor table_object row column acbottommask color)
(vla-setcellgridcolor table_object row column acrightmask color)
(vla-setcellvalue table_object row column (nth column add_columns))
(vla-setcelltextheight table_object row column 6)
(vla-setcontentcolor2 table_object row column 0 (vla-getcontentcolor2 table_object 0 0 0))
(vla-setcellalignment table_object row column acmiddlecenter)
)
(repeat (1- rows_number)
(setq column 0)
(setq row (1+ row))
(repeat 2
(vla-setcellvalue table_object row (setq column (1+ column))
(strcat (vlax-variant-value (vla-getcellvalue table_object row column)) " " (nth column add_units))
)
)
)
(vla-put-regeneratetablesuppressed table_object :vlax-false)
(princ)
)
Thank you very much. Ok. Thank you.
* Can we also have a small division operation done? If it's not too difficult...
In the Total section divide Total area 10000 by Total length 100.
* Or we can collect directly from the Table. In order for the fraction to be the same...
I am adding a sample dwg.
Thank you very much. Ok. Thank you.
* Can we also have a small division operation done? If it's not too difficult...
In the Total section divide Total area 10000 by Total length 100.
* Or we can collect directly from the Table. In order for the fraction to be the same...
I am adding a sample dwg.
Again why fix table provide a dwg that has Bolge objects and make a table correct 1st go. Including /1000 & /100
Again why fix table provide a dwg that has Bolge objects and make a table correct 1st go. Including /1000 & /100
The first time it was actually supposed to be 1000 and 100 episodes. I missed this point... sorry...
The first time it was actually supposed to be 1000 and 100 episodes. I missed this point... sorry...
sure,
(defun c:correct_table (/ table_object rows_number columns_number add_columns add_units color row column)
(setq table_object (vlax-ename->vla-object (car (entsel "\nPick a table to correct: ")))
rows_number (vla-get-rows table_object)
columns_number (vla-get-rows table_object)
add_columns '("KISIM" "ALAN" "UZUNLUK")
add_units '("" "m\\U+00B2" "m")
color (vla-getcellgridcolor table_object 0 1 actopmask)
row 1
column -1
)
(vla-put-regeneratetablesuppressed table_object :vlax-true)
(vla-insertrows table_object 1 19 1)
(vla-setcolumnwidth table_object 2 45)
(repeat 3
(vla-setcellgridcolor table_object row (setq column (1+ column)) actopmask color)
(vla-setcellgridcolor table_object row column acleftmask color)
(vla-setcellgridcolor table_object row column acbottommask color)
(vla-setcellgridcolor table_object row column acrightmask color)
(vla-setcellvalue table_object row column (nth column add_columns))
(vla-setcelltextheight table_object row column 6)
(vla-setcontentcolor2 table_object row column 0 (vla-getcontentcolor2 table_object 0 0 0))
(vla-setcellalignment table_object row column acmiddlecenter)
)
(repeat (1- rows_number)
(setq column 0)
(setq row (1+ row))
(repeat 2
(vla-setcellvalue table_object row (setq column (1+ column))
(strcat (vlax-variant-value (vla-getcellvalue table_object row column)) " " (nth column add_units))
)
)
)
(if (= "TOTAL:" (vlax-variant-value (vla-getcellvalue table_object row 0)))
(progn
(vla-setcellvalue table_object row 1 (strcat (rtos (* (atof (vlax-variant-value (vla-getcellvalue table_object row 1))) 1e-4) 2 2) " m\\U+00B2"))
(vla-setcellvalue table_object row 2 (strcat (rtos (* (atof (vlax-variant-value (vla-getcellvalue table_object row 2))) 1e-2) 2 2) " m"))
)
)
(vla-put-regeneratetablesuppressed table_object :vlax-false)
(princ)
)
sure,
(defun c:correct_table (/ table_object rows_number columns_number add_columns add_units color row column)
(setq table_object (vlax-ename->vla-object (car (entsel "\nPick a table to correct: ")))
rows_number (vla-get-rows table_object)
columns_number (vla-get-rows table_object)
add_columns '("KISIM" "ALAN" "UZUNLUK")
add_units '("" "m\\U+00B2" "m")
color (vla-getcellgridcolor table_object 0 1 actopmask)
row 1
column -1
)
(vla-put-regeneratetablesuppressed table_object :vlax-true)
(vla-insertrows table_object 1 19 1)
(vla-setcolumnwidth table_object 2 45)
(repeat 3
(vla-setcellgridcolor table_object row (setq column (1+ column)) actopmask color)
(vla-setcellgridcolor table_object row column acleftmask color)
(vla-setcellgridcolor table_object row column acbottommask color)
(vla-setcellgridcolor table_object row column acrightmask color)
(vla-setcellvalue table_object row column (nth column add_columns))
(vla-setcelltextheight table_object row column 6)
(vla-setcontentcolor2 table_object row column 0 (vla-getcontentcolor2 table_object 0 0 0))
(vla-setcellalignment table_object row column acmiddlecenter)
)
(repeat (1- rows_number)
(setq column 0)
(setq row (1+ row))
(repeat 2
(vla-setcellvalue table_object row (setq column (1+ column))
(strcat (vlax-variant-value (vla-getcellvalue table_object row column)) " " (nth column add_units))
)
)
)
(if (= "TOTAL:" (vlax-variant-value (vla-getcellvalue table_object row 0)))
(progn
(vla-setcellvalue table_object row 1 (strcat (rtos (* (atof (vlax-variant-value (vla-getcellvalue table_object row 1))) 1e-4) 2 2) " m\\U+00B2"))
(vla-setcellvalue table_object row 2 (strcat (rtos (* (atof (vlax-variant-value (vla-getcellvalue table_object row 2))) 1e-2) 2 2) " m"))
)
)
(vla-put-regeneratetablesuppressed table_object :vlax-false)
(princ)
)
It's just perfect !. Thank you very much. 🤗
It's just perfect !. Thank you very much. 🤗
Can't find what you're looking for? Ask the community or share your knowledge.