AutoCAD Visual LISP / AutoLISP :: Changing Color Of Attribute?

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


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Routine For Changing Attribute Tag Width Globally In Blocks

Jul 15, 2013

Any lisp routine for changing the text width of all the attributes in a block globally. I want to change it from 1.0 to 0.8. I have attached a symbol where the attritube tags will be the same.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Attribute Height Is Changing Each Time Routine Is Run With An Annotative Block

Apr 30, 2012

I only do programming when absolutely needed so it usually only happens every couple years. I wrote this routine to count nested blocks inside of dynamic blocks to count parking spaces. The routine worked fine but was relying on the ltscale to scale a block containing an attribute for the total number of spaces. I want to update the routine to use an annotative block so the scale doesn't have to be set. I changed my block containing the attribute but now when I run my routine, the attribute height gets changed each time the routine is run. The text just gets larger and larger. Here is the portion of the routine where the attribute info is gathered and updated with the new value for that attribute. If you need the entire routine, I can post it with a slight modification so it will work outside our network.

(defun updateattrib ()
(setq CNT 0) ; sets count to 0
(while (< CNT (sslength ss)) ; starts loop while CNT is less than the number of objects in the group

[Code].....

I am running this in Civil 3D 2010 but will want it to work in 2013 so if the solution will only work in 2013, that is fine with me.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Export / Import Attribute Values And Its Color

Apr 24, 2012

There is a BLOCKA that I'd like to extract its attributes - Tag and Color - into an external format (excel).  There after, I'd like to import it into the drawing and based on its color attribute value, change the value to that color in the drawing.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Changing Color Of Selection Sets?

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

AutoCAD Visual LISP / AutoLISP :: Changing Blockeditors Background Color

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

AutoCAD Visual LISP / AutoLISP :: Changing Text Color And Width Factor

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

AutoCAD Visual LISP / AutoLISP :: Changing Color Of Background In Model Space

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

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 View Related

AutoCAD Visual LISP / AutoLISP :: Transfer Attribute Block Values To Another Attribute Blocks

Jul 3, 2012

I wanna transfer my attribute block values to another attribute text blocks , is there any lisp for that?

Is there a possibility for sum tag values of choice attribute blocks to inside of another attribute text block ?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Convert Attribute Tag Into Attribute Value?

Dec 8, 2011

Background: Someone exploded an attribute block and copied it hundreds of times throughout a project, each time changing the Attribute Tag to match the Value they expected to appear in their drawing.  The drawing must be xrefed, so the attribute definitions do not appear.

(There is only 1 attribute in the block.) 

Proposed Solutions:

1:AutoLISP routine which copies Tag data from Attribute Definition into Value of Attribute Block:

Prompt-Select Attribute Definition

Copy Tag data

Prompt-Select Attribute Block

Paste data into Value

(Allow repeat to speed workflow)(*PREFERRED*)

2:AutoLISP routine which copies Tag data from Attribute Definition into Default Value and creates a new Block:

Prompt-Select Attribute Definition

Copy Tag data

Paste data into Default Value

Create New Block

(Select Multiple Objects)(Creates tons of new blocks which are messy)

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change All Block Element To Layer 0 Without Changing Color / Linetype

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

AutoCAD Visual LISP / AutoLISP :: Using Macro Parameter Contains Space (changing Layer Color From Command Line)

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

AutoCAD Visual LISP / AutoLISP :: Get Attribute Value

Jun 3, 2013

I am trying to find a lisp that would get an attribute value (tag name = NBR_5) . I'm trying to run a simple routine that would let the user place the value from the titleblock attribute as text on a drawing. I see a ton of articles regarding getting attributes but I am not well versed in programming.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get The Value Of Attribute

Dec 30, 2011

Is there a quick way of getting the value of an attribute?

I have an attributed block called "tp_attributes" and it has and attribute called "OrderNum".

I just want to be able to quickly grab that value.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Check Block Attribute Then Change Different Attribute In Block

Aug 31, 2012

select all blocks on certain layers in a drawing, check attribute CIRCUIT in each block if it starts with MS then attribute CONTROL = switched. I hope thats clear enough the way

(defun c:control()
(graphscr)
(Setq sc (ssget "X" '((0 . "INSERT")

[Code].....

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Sum Of Attribute Values

Jul 29, 2005

Say I have a block that contains two attributes, one contains a value that is a number and another contains a value that is letters. I have many of these blocks placed in a drawing, could you create a lisp that would return the sum of the number value and return it to the command line along with the letter value. Something like this:

Sum--------Item
128 RP
389 TD1
2389 SP4

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Get Attribute Value From Block

Jun 17, 2013

I continue with my problems.....

I get attribute value from block and put it in a list:

(repeat (setq cnt (sslength sset))
      (setq attValue (GetAttributeValue (ssname sset i) "tag1"))
       (setq attValue2 (GetAttributeValue (ssname sset i) "tag2"))

 [Code]...

When I try to put them in a table...

 (foreach item lst
        (vla-setText mytable
                     row 0
                      (last item)
                    )
        (setq row (1+ row))
      )   

only put  one ( attValue2) at column, and i like  put 2 values, each one in a column in the same row

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Copy One Attribute Value?

Nov 2, 2012

i want to select a block and the lisp copies TAG1 into my clipboard (i want to paste it in excel)

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Sum Attribute Tag Values

Jul 17, 2013

Lisp or lisp code for sum attribute tag values and paste result to an another attribute block tag?

i attached jpg for explain to what i want to do .

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Fix A Block Attribute

Mar 29, 2012

I need fix a block attribute named "NrPunct.dwg"

MyProblem:  after I insert the block “NrPunct” in my drawing ,, I cannot modify "textHeight", when I edit the ATTDEF (or attribute) with the command “DDEDIT” . Why?

You see my arrow in the picture pozamea.jpg…

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Substituting Text With Attribute?

Apr 29, 2013

I run into some issues where i need to change an attribute based on where a block is located on a drawing.  I started this routine to select the block, and then select the text that I want to change the block attribute to.  It seems like everything is working up until this point.  What I want to do is then replace the first selected with the second selection.  How would I go about doing that?  here's my code so far:

(defun C:uf ()
(if (setq fuse (nentsel "
Select Fuse Attribute: "))  
(progn     
(setq en (car fuse))    
(setq enlist (entget en))      
(setq fuseatt(cdr (assoc 1 enlist)) )   )  )      
(if (setq mt(car (entsel "
Select Text: ")))  
(progn          
(setq enlist2 (entget mt))    
(cdr (assoc 1 enlist2))     
(setq wiren(cdr (assoc 1 enlist2)) )     )          )
)

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Line Length To Attribute Tag

Sep 30, 2013

Is there any simple code for to sum length of lines which is i am choosing and copying result to chosen attribute tag ?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Read Attribute Value Which Is A Field

Dec 15, 2011

(cdr (assoc 1 (entget (entnext (car (entsel))))) ...

gives the string value of the attribute, but i would like to retrieve the field value attached to that attribute.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extending Attribute Definition

Jul 6, 2012

I am trying to customize AutoCAd for a special domain where attribute values need to have a type. I can have a clean integrated solution by manipulating the acad.dcl or base.dcl .I am using AutoCAD 2012 . I want to extend the " define attribute" and "edit attribute" dialog boxes to promt the user for a value type when they define an attribute .I can't find the definition for these dialog boxes in acad/ base dcl files. Ideally I want to add another tile definition to these dialog boxes .If that is not possible atleast spawn a different dialog box  from the "define attribute " dialog box that will collect the value type from the user.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: EditTitle Block Attribute

Jul 16, 2013

I am trying to update my Title Block with a LISP routine (As the title implies).

So far, this is what i have...

(defun c:aTest (/ ss att)  
(if (setq ss (ssget "X" (list (cons 0 "INSERT")(cons 2 "TB_PARAMOUNT_ELC")       
(cons 66 1)(if (getvar "CTAB")(cons 410 (getvar "CTAB"))              
(cons 67 (- 1 (getvar "TILEMODE")))))))    
(progn      
(foreach ent (mapcar 'cadr (ssnamex ss))    
(setq att (entnext ent))    

[Code]...

The title block, block name is static. The attribute name is static.

My ultimate goal is to copy the value of one attribute and "paste" that into the value of another attribute, and itterate this through the entire project.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Attribute Text

Jun 24, 2012

I have a block "MANAGER" with Two Attributes "CETOP" and "CEBOT" I would like a lisp to replace what ever is in those attributes with defined text, for my purposes "Text1" and "Text2". I would like a simple routine that even I can understand so I can apply it to a couple of other lisp projects I have.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Edit Single Attribute Value

Oct 30, 2012

I want to edit 1 attribute value in a block to number all my blocks (eg A001, A002, A003...) (example picture attached)

I know about the at tout and at tin but I need a lsp routine that only changes one attribute value without having to double click and go through that.

i attached a lsp routine, how to edit and remove everything except the value part.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Dxf 1 Group In Multiline Attribute?

Jul 23, 2012

significance of extra dxf 1 groups in the entity data of a multiline attribute? I am looking at one for the first time, so I don't know whether or not to expect multiple 1 groups. In the single example I have created there are two and the first one seems to be ignored. Can I count on that being the case all the time? Data for the one I'm looking at follows, and what shows up on the drawing display is only the contents of the second dotted pair with 1 as a key.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
((-1 . <Entity name: 7ec37d18>)
(0 . "ATTRIB")
(330 . <Entity name: 7ec37d10>)
(5 . "323")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")

[code]...

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Set / Get An Attribute Of MVBlock Viewblock

Apr 24, 2012

From what I can gather the attributes of a MVBlock are on the Viewblocks inside of it.

With LISP, how can I access these attributes to get and set them?

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Adding Up Attribute Values

Oct 26, 2012

Any routine where I could keep picking on my exit arrow blocks (showing how many persons exiting from each space) one-by-one and the program would add up the numbers.  For example I pick on blocks with numbers of 2, 4 & 3 and I would get 9.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved