AutoCAD Visual LISP / AutoLISP :: Set Table Cell Background Color
Aug 19, 2013
I have created subroutines to build tables in AutoCAD.
What I would like to do is to is if a value in the table list (example a question mark), then make the background color of that cell color 1 (red).
List to insert as a table -
(setq List_Table (list (list "A" "?" "C" "D" "E") (list "11" "12" "13" "14" "15") (list "21" "22" "23" "24" "25")))
(Build_Table "Title" List_Table 3 5 0.1 1)
Here are the subroutines -
(defun Build_Table (TableName List_Table NumRows NumColumns RowHeight ColWidth /); P0 Table_Obj KW KK KT KL Blocks_Obj Block_Obj Block_Id)
;--set table scale-------------------------------------
(setq Dscale 1.0)
;--get location----------------------------------------
(setq P0 (vlax-3d-point (getpoint (strcat "
[Code] .......
View 3 Replies
ADVERTISEMENT
Nov 23, 2011
The following snippit of code is changeing the color of text in a cell of an AcadTable. It will set the color to an RGB value and works great. But what if the color is a normal color 1 through 255 from autocad's pen table. How would I set the cell text color?
(setq objColor (vla-getcellcontentcolor eVLAMT R C)) ;sets a Color Object, whatever that is
(vla-setrgb objColor RED GRN BLU) ;sets the new color of the Color Object
(vla-setcellcontentcolor eVLAMT R C objColor) ;sets that new color object to the cell
View 5 Replies
View Related
May 31, 2013
I have set up several tables inside autocad that have one cell as the input cell and after regen the others perform calculations based on that cell. I want to write a command that uses the same value as the input value to draw the arc to scale. I tried using the table value as is called out in the cell field:
^C^C_arc 36,6;e;0,6;r;Table(8796085192704).A3;.
Is there anyway to get a value from a cell inside autocad and put it into my macro so I can draw an arc of the radius shown?
View 1 Replies
View Related
Aug 29, 2012
Is there a way to unlock a cell using lisp. I have a datalink that is used to create a table. Once the table is selected I have a command that will format some of the cell style (which will let me while locked), but it I cannot seem to find a way to unlock them to merge a couple of cells. I can manually do it using the table toolbar, but programmably I am a little stuck. I can see if it is editable by using the vla-iscontenteditable and it will return :vlax-false. I do not see a vla-setcontenteditble or something to that effect.
View 3 Replies
View Related
May 14, 2012
I have a table, in cell D3 I have inserted a field containing a system variable. The contents of the cell looks like this,
%<AcVar dimadec>%
I want to put in cell D2 the name of the vairable that is in cell D3 - I have tried the following,
%<AcExpr (D3).ObjectName>%
%<AcExpr (D3).textstring>%
Is there any way to reference the name of that system variable contained in cell D3? I want to do this to prevent errors by curious new users that may edit the table, I want the table to reference itself so that the system variable being read is always related to the correct system variable name.
View 6 Replies
View Related
Oct 1, 2013
Any LISP routine that I can run that will make alternating rows of color in a table?
I can setup a table with the TABLE command and setup the rows to alternate gray and white, but if I add or delete a row, the alternating background fill pattern gets messed up (see attached example). Manually redoing the pattern isn't bad for a few rows, but for 30 or more it's a real pain.
If I could run a command that would activate a routine that would start with gray at the top and then alternate white and gray for every row for the rest of the table, that would be awesome.
View 3 Replies
View Related
Feb 17, 2009
How to change the Backgroundcolor of the Blockeditor with VLisp? I haven't found neither a SystemVariable nor somthing inside the AcadPreferencesDisplay object.
View 6 Replies
View Related
Jan 2, 2014
Any routine for changing color of AutoCAD background in model space. As for changing background color we have to follow four steps namely as follows:-
1. Execute OP
2. Go to display tab
3. Go to color tab
4. Change color
A tool that directly calls the model color shall be highly beneficial.
View 3 Replies
View Related
Oct 28, 2013
I would like to set dimension text fill color to "background" instead of, you know, dimensioning my drawings properly.
I have this code I got on these forums and it works well except for the 'TextFillColor' variable. I can't find the correct color number or syntax for "Background'. It's currently set to 0 which produces ByBlock, and any number I put in there corresponds to the AutoCAD color number (1 = Red, 2 = Yellow, etc.)
If you have a better routine that you could post that works for me too. Or maybe you could just do my work for me? Even better.
(defun c:test (/ obj num cnt)
(vl-load-com)
(setq ss1 (ssget '((0 . "Dimension")))
num (sslength ss1)
cnt 0)
[Code]...
View 5 Replies
View Related
Oct 7, 2011
I would like to be able to retreive data from a sepcified cell, in a specified worksheet, from an excel file.
I don't have any clue how to connect to an excel file and read the data. Most seems to think you already had an understanding but I'm starting from the beginning.
View 5 Replies
View Related
Oct 23, 2012
How can I pass the contents of a cell value (text string) to Acad? I want the user to click on a cell, then have lisp use the string as the name of a block to insert.
View 4 Replies
View Related
May 6, 2009
The PARTS LISTS on our old drawings are simply text entities and lines. Some are MTEXT. But our new drawing template has us creating our parts list using the actual AutoCAD TABLES entity.
I'm looking for the best method to go from lines and text in AutoCAD, to an AutoCAD table. As of now, I have to retype everything since I can't select a column/row or group of text entities, copy/paste into a table.
Any LISP function that will allow me to go from TEXT and LINES to a TABLE? I've tried B2E (lisp name) but it's not working - found that on a lisp site somewhere.
View 9 Replies
View Related
Mar 19, 2013
I need to draw a table with point number, easting, northing, elevation for a lot of points and need a lisp to read the xl spreadsheet and draw the table.
View 9 Replies
View Related
Sep 12, 2012
Tables do no have a rotation angle. I can find the insert point, but there is no other point to make an angle calculation with.
(setq objTable (vlax-ename->vla-object (car (entsel))))
(vlax-dump-object objTable T)
View 1 Replies
View Related
Dec 9, 2011
any code that can search for a layer using wildcards?
In my specific case, I have multiple layers than begin with "MECA" followed by a job code. I'm trying to code something that will check to see which of those layers is on, then return the layer name.
View 1 Replies
View Related
Jun 24, 2013
i have one table make which field from block. Is possible sum?
View 4 Replies
View Related
May 15, 2012
Is there any way to compare 2 cells in a table? I have tried diesel
$(if,$(EQ,%<AcObjProp Object(%<\_ObjId 2128896328>%).b2>%,%<AcObjProp Object(%<\_ObjId 2128896328>%).d2>%),true,false)
I can't seem to pass the cells into the equation. I tried formulas also with no luck.
View 7 Replies
View Related
Apr 25, 2013
I would like to link an AutoCAD table to an Excel file with the first method described in this page:
[URL]
I know the filename of the Excel spreadsheet and the range as well.
Is there a way to make a script that links the table and then detach the link after that ?
View 4 Replies
View Related
Apr 26, 2012
How to modify the column widths of an ACAD_TABLE?
I have known co-ordinates that I want each grip for the table to be set at. I can't just copy and paste the table from drawing to drawing. Each table of each drawing have different textual values, and the column widths will best be sized for each text value.
View 5 Replies
View Related
Oct 3, 2012
Is it possible to create a lisp that would change the plot style table? I don't know of any variable to type to change that. We convert drawings from Solid works to AutoCad and use the basic monochrome plot style. I'd like to easily change that since the act of doing that is repeated many times.
View 1 Replies
View Related
Jul 21, 2012
I want to change a lot of table cell text in one time, try to explain something.
In the front of my drawings i have a view tables. in the second column stays a code that represent a location.
e.g. LVC stays for Low voltage cubicle. Now it is my intention to substitute these code to the description of code in one time and only the second column. The several descriptions are written in an .txt file, like LVC;Low voltage cubicle and on the next row LVP;Low voltage panel, and so on.
I think it is only possible with Lisp? or there are other way?
In the past i did it one by one, because mostly there where 2 or 3 tables, now i have a big project with more than 20 tables.
View 9 Replies
View Related
Sep 8, 2011
I have a simple block that consists of a point and an attribute that contains the point number. I want to generate a table with point number from the attribute, and x, y and z of the block's insertion point. I want a routine that sets out the blocks and then create the table. The first part of the routine I have (in LISP), I need it to generate the table. I was intended to use the -DATA EXTRACTION but unfortunately it does not allow me to select objects (blocks). Are there other ways to do this? I'm using AutoCAD 2011.
View 5 Replies
View Related
Aug 29, 2013
I've been up and down the forums looking for some direction or programming code for this to no avail.
What I'd like to do is edit a table where the cells are populated with fields. I'd like to copy the last row of the table to a new row (fields and all), then change the fields of the row I copied FROM to text, and lock those cells.
I'd like to copy this row including the fields to a new row beneath it. Then edit the cells of the first row to change the fields to text, and then finally lock the cells of the first row so that only the new row would update when the field properties change. Eventually they will be populated with data from the Vault..
View 6 Replies
View Related
Jan 4, 2013
I want to create a table with all characters inside a font.I used "%%" to change a number to it's character.but "%%" limited to 999 and for numbers bigger than 999 it doesn't work.
also, CHR command limited to 255 and for numbers bigger than 255 it change to (number-255). so I used "%%" to create this table:[Please change default font in your AutoCAD to ARIAL]
(Defun c:charmap ()
(setvar "cmdecho" 0)
(setq cnt 1.0)
(setq r_cnt 0.0)
(setq ts 32)
(setq x 0.0)
(setq y 0.0)
[code]...
I want to know:
1- what can I do for numbers more than 999?
2- How can I know the number of characters inside a font?
3-how can improve my LISP program to have complete characters inside the fonts?
View 2 Replies
View Related
Jul 19, 2013
The attached image shows a table that I created as a AEC Object from my Civil 3D Alignment (i can turn it to 'MText' and then 'Text' in one or two steps). What I need is a routine, or anything, that fills the third column with an information based on the second column: the deflection angle, something like that:
Curve Angle Type of angle
C1 22°30'00'' 2
C2 39°21'28'' 3
C3 44°59'59'' 3
C4 45°00'00'' 4
C5 45°00'01'' 5
Is there something I could read to study to solve it myself and specify my own angles/types of angles?
View 7 Replies
View Related
Jan 4, 2014
I need a lisp file that can read the total length of selected object (lignes, polylines) and summarize them by layers or by color in a table
e.g
command:tl (total length)
select objects
found total length.......
select object (Ent)
total length or [Add/Subtract/Table] :
total length = .......
if table
Enter an option by [ Layer/Color/line Type/line Weight] <layer> :
View 4 Replies
View Related
Mar 22, 2012
By running this routine it returns the following error message:
ERROR: bad argument type: VLA-OBJECT 7
(defun _make_tblstyle (stlname / adoc acmcol tblstyle txh)
(setq adoc (vla-get-activedocument
(vlax-get-acad-object))
)
(setq acmcol (vla-getinterfaceobject
[Code] .......
View 3 Replies
View Related
Mar 19, 2013
Generic lisp file that summaries areas of hatches in a table,
I’m wondering if there is a lisp file that can read the boundary of the study area and the hatches and stick there areas in a table as shown in the attached screenshot
The areas of the roads are derived by subtraction the total area of hatches from the area of the study area.
The dwg file is attached
This is very frequent sort of work and takes a lot of time to be constructed. I’m already using fields to perform this kind of work.
Software: AutoCAD 2014, AutoCAD C3D, AutoCAD M3D, Revit
Windows 7 (Ultimate 64 bits),
Firefox 20.0,
Kaspersky 2013.
View 8 Replies
View Related
Aug 31, 2011
I have a routine, developed for me through this forum, that selects text or mtext, converts to mtext if not already, and puts a background mask with 1.1 border. I was using it fine in Map 3D 2007, but have recently switched to Civil 3D 2012 where it does not work. I get this error message:
; error: no function definition: VLAX-ENAME->VLA-OBJECT
Why does this not work in 2012? How to get it to work?
View 7 Replies
View Related
May 16, 2013
I am trying to flip between Bylayer and color 150. If cecolor is bylayer set cecolor to 150 and if cecolor is 150 set cecolor to bylayer. It seems so simple but it's not working.
(defun c:22 ()
(setq cc (getvar "cecolor"))
(cond
((= cc "Bylayer") (setvar "cecolor" "150") )
((/= cc "Bylayer") (setvar "cecolor" "Bylayer") )
))
View 9 Replies
View Related
Aug 7, 2006
i am looking for a lisp routine which can change all lines in color yellow ( in different layers) to color 8.
View 9 Replies
View Related