AutoCAD Visual LISP / AutoLISP :: Changing Color Of Text In Table Cell
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
ADVERTISEMENT
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
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
Jun 29, 2012
I am looking for a way to change the text style used by a table style with Visual LISP. So far I have been able to get the IAcadTableStyle object from the acad_tablestyle dictionary, but there is no property for text style. Is this even possible? Code and results are below.
(defun DumpTableStyles ()
(setq dict (vla-get-dictionaries (vla-get-activedocument(vlax-get-acad-object))))
(setq TableStyles (vla-item dict "acad_tablestyle"))
(vlax-for TableStyle TableStyles
(vlax-dump-object TableStyle)
)
)
[Code]....
View 3 Replies
View Related
Sep 28, 2013
What is the best way to change the color of two pieces of specific text in lisp? I want to change where it says (strcase ln6) & (strcase ln7) to the color of green. I tried it a couple of different ways but I'm having some trouble. First I am setting the current layer with a color of blue. I am then running the text command a couple of times. I want to run the mtext command a couple of times but I want the text to be green & I want the width factor to be .85
View 9 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
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
Feb 8, 2013
Can you change the color of a block attribute with lisp like you can with the built in Enhanced Attribute Editor function eg
I can change the value of the attribute LAMP but can I also change its color from the color of the layer its created on?
(while (not (equal ck "SEQEND"))
(setq e1 (entnext e1)
e2 (entget e1)
ck (cdr (assoc 0 e2)))
(if (= (cdr (assoc 2 e2)) "LAMP")
(progn
(setq e2 (subst (cons 1 lamp)(assoc 1 e2)e2))
(entmod e2)
(entupd e1)
(setq ctr (+ ctr 1))
)
)
)
View 9 Replies
View Related
Jul 27, 2013
I need to create a command which could change a color of an allready existing selection set when activated. For example i have a command which creates a cube, where each specific group of lines were added to different selection sets. how can i recall any created selection set by its name and change its color?
View 9 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
Oct 15, 2012
I want to override the measurement in a dimension with a string of text using a LISP command.
E.g.. "select dimension"
type new text for dimension
replace dimension measurement with new text. I can get the entity and its values, buy not sure which value to change for the "text override".
BTW Acad 2012.
View 3 Replies
View Related
Aug 4, 2013
I have inside every text,Mtext contents different text style like Arial_1 , Arial_2.
How i can give all the contents inside one style ? the normal procedure i will enter inside text to enter editing mode and changing text format style one by one. I want it once.
I want to save my routing of entering every text to change its content text style.
(Notice:select all from outside without editing mode will not do the job)
View 2 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
Dec 21, 2012
I am trying to speed up some basic drafting of text revisions. In the P (plumbing) we call out the fixture units for a water pipe, along with the fixture units, the pipe size changes.
Is there any way to add numbers in an attributed block? (I have a lisp that works on text & mtext, but not attributes)
1.1. Example: Like if you have a block with two attributed text fields, the 1st field {x} is a number (fixture unit), and the 2nd field {y} is a number (pipe size). I would want it to only add the 1st text fields. [If possible then change the 2nd text field according to a changeable chart. (see #2)]
1.1.1. This is how the block looks like: x (y")
1.1.1.1. x could be any number from 0.5 – 10,000 (only using 1 decimal place, and only as needed)
1.1.1.2. y could be any number from the following list: ½, ¾, 1, 1¼, 1½, 2, 2½, 3, 3½, 4, 5, 6
Is there a way like in excel that you can set up a formula that will give a numerical result depending on other input? Like pipe size that change depending on the number of fixtures. There would need to be two different formula, one for hot and one for cold values (The value would be set at the beginning of the job; typically these values would not change later in the job). This could be separate text or if possible using the attributed block as described in #1.
2.1. Example: Like if you have a block with two attributed text fields, the 1st field {x} is a number (fixture unit), and the 2nd field {y} is a number (pipe size). I would want it to change the 2nd text fields according to the value in the 1st text field. If the value in {x} is 0.5 – 1.0, it would result in ½; 1.5 – 7.0 = ¾; 7.5 - 17 = 1; 17.5 – 36 = 1¼; ect.
2.2. In excel it would be =IF(x)<1,"1/2",IF(x)<7,"3/4”,IF(x)<17,"1",…{all #’s in between} …IF(x)>5000,"6")))))
View 9 Replies
View Related
Sep 3, 2013
I have too many blocks with specific layers inside.
develope lisp can change all to layer 0 but keep color and linetype as it is.
I will use this as a part of script to change multiple block.
View 9 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
Sep 19, 2013
I'd like to change a layer's color from command line because of a user icon. I figured out from previous topics that I should use macro similar to this: ^C^C_filedia;0;-la;s;Verdeckt (ISO);c;1;l;dashed;;_filedia;1;re;
(I want to use this macro to change layer's linetype, too, but that's not the point)
The only problem with this macro: layer's name contains a space therefore Autocad tries to recognize Verdeckt as a command (and macro interrupts there) instead of setting Verdeckt (ISO) as the current layer. I've tried using different quote marks, none of them worked (' and " and <>). I hope there's a method for entering a parameter that contains space.
Software: Inventor Series 2011 SP1 x64
OS: Vista Business x64
CPU: E6400
RAM: 2*2Gb GeIL
VGA: Quadro FX 550
View 5 Replies
View Related
Aug 23, 2011
how to make a toolbar button so that when i click it and select a few single text, it will automatically change the text base point to be at "MIDDLE CENTER"....
At the moment, i use to create a button with macro of " ^C^C_text;j;mc "....But the problem is whenever i use this button, i still need to type "MC" at the command prompt.. How to make it so that after i click the button, all i need to to is just select the text..
View 9 Replies
View Related
Nov 27, 2013
find duplicate Text & highlight with any color (numbers or text string) ? I have a drawing and have to find duplicate text string, file is bigger and need make this automatic find, & highlight the duplicate text.
View 4 Replies
View Related
Jun 27, 2012
How to change the dim text color in current dimstyle with a lisp routine? I want to modify current dimstyle instead of override current dimstyle, so it can change all existing dim text color under the current dimstyle.
View 9 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
Mar 29, 2013
I'm looking for a way to copy a text or a simple line, circle... ; after I copied it, the last entity change its color to green.
View 3 Replies
View Related
Nov 16, 2012
i failed to find one which would change string of a text to other for all types of objects. I mean it was usually either only multitext, or only text, dimensions or attributes.creating one which would change in abt 200 drawings:
-001
-002
-003
to:
-00001
-00002
-00003
in attributes, text, multittext, leaders, multileaders, dimensions..... at the same moment?
It is meant to be used in ScriptPro (by loading lisp in script).
If not possible, then can also open each file and run the lisp in each of them - still would save lot of time.
View 4 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