AutoCAD Visual LISP / AutoLISP :: Match Multiple Attribute Values From One Block To Another Block

Feb 12, 2012

I need to match few attribute values from one block to different block. I download a lisp file called; ca.lsp which can match the single attribute value. I modified it for more than one attribute value matching. It is ok but still wish to overcome two issues for batch prcess

1. picking up the blocks by selection

2. click the alternative block numbers of times to match the numbers of attribute values I needed.

How to modify this lisp I can run it by block name selections instead of picking selection which enable me to run batch process for numbers of drawing? That will be good...

Lisp & Demo file attached (Match attribute value, A, B & C to Attribute 1, 2 & 3).

View 3 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Block Attribute Values In Paperspace Multiple Pages

Feb 25, 2013

I have several title blocks each in their own paperspace pages. Could have the attribute filled in, but more than likely only one page will have values filled in the attributes. I am looking for a VL method for finding which pages title block is filled in so that I can get those values and fill in the equivalent attributes for all of the other pages. Currently I am using a long set of :
 
(IF (setvar "ctab" "8.5x11") (IF(TBLSEARCH "BLOCK" "TB-8.5x11") (IF (/= "" (get-att "OWNER" "TB-8.5x11")) ; Function to read a named attribute(editblk "TB-8.5x11") ; Function to pull up the attdia(IF (setvar "ctab" "11x17") (IF (TBLSEARCH "BLOCK" "TB-11x17") (IF(/= "" (get-att "CUSTNMFIRST" "TB-11x17")) (progn ; At the last page ditch the [Code]..........

 The example is just a very simplified version of what I'm doing. I just need to find the information, if it exists in any page and store it for later. Afterward, I'll fill in each page's Title Block with the stored information.

I know that this can be done much more efficiently. As I am currently flipping through the pages too much action is occurring on the screen and it makes some people nervous. With VL I should be able to run the search quietly, but I would still like to (setvar "ctab" "to the page with the filled attribute value") after the LISP is finished storing values.

View 7 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 :: How To Retrieve (2) Attribute Values From One Block

Aug 24, 2011

Here's my situation:

I have a block named "WIDGET-A". And in that block are (4) attribute tags whose names are:

"ID"
"TAG01"
"TAG02"
"TAG03"

The user will be prompted to pick the value displayed at any of the "TAG##" attributes - they will select the attribute tag they want (we don't know which one it is, we just want to assign that value of the attribute tag they clicked on to a variable called "VAR2".

Now, what we also want AutoCAD to evaluate, behind the scenes, is the value of the attribute tag named "ID" which we know always exists in the block and then assign that value to a variable called "VAR1".

Is there a way for AutoCAD to do this all from only a single user pick on top of an attribute value, in a block whose name isn't always going to be 'WIDGET-A' either.... But the block, whatever it's name, will always have the attribute tag "ID" with a value in it, and we always want to capture the value of whatever attribute tag within the block that the user clicked on.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Remove All Block Attribute Values

Jun 17, 2013

I need a lisp sub-function that can empty all attributes of a specified dynamic block. The idea being that the specified block contains data that changes often and in order to repopulate the block's attributes with new data to replace the old I wish to just blank out the old data first, because it's possible that the new data may not utilize as many attributes and all of the old data must be removed. 

The thing is the block I'm after is on several layouts, CTABs and they all need to be wiped clean.

View 9 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 :: Get Attribute Values From Multiple Blocks With Same Name?

Mar 21, 2013

This time I'm wrestling with getting the values from multiple blocks. The blocks all have the same name but at least the attributes have names this time. Each block have exactly 4 attributes, like: att1 (a number representing chronological order), att2 (some data), att3 (the actual date as a string of when the data was added), att4 (some more data)

I need to get and store the attribute's values. I was hoping to make a selectionset of the blocks and step through using the chronological order number.

At this point I have tried several combinations of foreach and ssget "x" (list (cons 2 MYBLOCK)), but I keep getting errors that I'm sure are telling me that I'm not passing the correct information to the function for iterating through. I'm banging my head.

(DEFUN c:GFOR (/ ATTLST REVBLK CNT CNT1 BLK RBLK ATTVAL ATT REV#)
(SETQATTLST(LIST "R#" "INIT" "DATE" "DESC")REVBLK(ssget "x" (list (cons 0 "INSERT") (cons 2 "REVISION")))CNT0CNT10 )
(vlax-ldata-put "dict" "RevTotal" (BLKCNT "REVISIONS")) (FOREACH BLK REVBLK (SETQ RBLK (ssname BLK CNT1)) (setq ATTVAL (mapcar '(lambda (x) (vla-get-TextString x)) (vlax-invoke (vlax-ename->vla-object RBLK) 'GetAttributes))) (foreach ATT ATTLST (SETQ REV# (STRCAT "REVISION" (1+ CNT)))
(vlax-ldata-put "dict" REV# (member ATTVAL)) (setq CNT (1+ CNT)) ) (SETQ CNT1 (1+ CNT1)) ) (PRINC))

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extracting Attribute Values From Multiple Dwg Files To An Excel File

May 11, 2013

how to extract the attribute value of a  particular block in multiple drawings to an excel file.

Eg... there are nearly 800 drawings where I need to list down the description and Drawing number which is mentioned in the title block name "Title". The Drawing Number and the description is done in same attribute block. extract the data into an excel file or txt file. All the drawings are saved in one location.

View 7 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 :: 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 :: 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 :: List Block Attribute Value

Feb 3, 2012

I'm looking for a lisp routine that will globally list all the values from a specific attribute tag within a specific block. The attribute tag is "COMMENT" and the block name is "FSD".

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Title Block Attribute

Jun 24, 2013

I can't find my notes on how I fixed it. When we insert our title block, it automatically inserts the drawing number. For one user, it doesn't work. The title block inserts, but it won't put in the drawing number. I seem to remember I need to change a setting or something to get it to work, but I can't remember what it is.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Align Block With Attribute Value?

Apr 15, 2013

I started a lisp that moves blocks according to their attributes and align numeric value in x 0.0. I work currently selected point by point. I will wish it to run at once on a selection set (I am angry with entsel).

(defun c:test (/ sel ent st newpt)
(if (setq eset(ssget))
(progn

[Code]....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Block And Fill In Attributes With Var Values

Nov 4, 2011

I am using 2008 and I have a dynamic block with attributes that I want to insert with the below program and have the attritute values filled in automatically.  I have done this with other programs in the past and they worked great with literally no problems.  They were not dynamic blocks may be the reason this does not work. Why the block will not fill in the attributes like it should.  Occasionally in my testing I see a message about "units" when I am inserting the block but I have my insunits set to 0.  I have attached one of the blocks I want to use.  I am thinking either you cannot do this because it is a dynamic block or there is a new variable that won't let it work. 

(setq upisosym "L:/AcadUtilsJack/Programs/InsertIsoSymbols/ELL90BW_Flip_01" isosym "rat")
(setq upod "3" upsch "sched" upmatl "matl" uprat "400")

I found these two new variables and turn them off or 0 thinking they might be the problem???

(setvar "INSUNITSDEFTARGET" 1)
(setvar "INSUNITSDEFSOURCE" 1)
(defun c:JD ()
  (setvar "attdia" 0)
  (setvar "attreq" 1)

[Code] .....

View 9 Replies View Related

AutoCAD 2010 :: Match Attribute Values In Same Block

Jan 4, 2013

How to get attribute values to match in the same block? In my titleblock have the clients name displayed a couple of time in the block. I want to be able to change the clients name in one spot and have it change in the other. I have tried to use fields but the field will only display the default value of the attribute.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Moving Attribute Block With Tag String Name

Dec 20, 2013

I have a lot of attribute blocks in my drawing which i want to move them one by one

so , here is what i want to do :

I have numbers (or texts) in my work area and this numbers also exist in my attribute blocks .. i wanna move my attribute blocks with tag name value reference to my specify area if tag name values are matching with text or numbers in this area .. every block will check my selected tag string and will be move on matching text in my work area.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Update Block Attribute With Variable

Mar 8, 2013

I would like to create a lisp that does the following:

Update a titleblock attribute with a $variable.

The titleblockname is variable / not static.

The attribute is not variable / Static, DW_SCALE

The titleblock is always places on the same layer, BL$4----

The (custom)-plotscale is stored in the $var "gvpsc".

I've tried to ajust the following lisp code. But I couldn't extract the part I need.

The problem is, the code checks all the layouts and updates all the titlblocks one by one.

Truely a good code. 

The only problem is, I don't have multiple layouts and I have a variable titleblock name.

Here is to code i've tried to convert to something I could use.

(defun C:UPD-DPC () (setvar "cmdecho" 0) (setq blkname "DPC-STEMPEL");(getstring "
Enter the name of block to update: ")) (setq att1 "DW_DATE");(strcase(getstring "
Enter the name of the attribute to change: "))) (setq newatt (strcase(getstring "

[Code] ....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: One Attribute At Two Different Locations Inside Of One Block

Aug 5, 2011

Is there a way (or a “trick”) to have one attribute at two different locations inside of one block (I want to avoid filling in the same text twice when this block is inserted or edited)?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Best Way To Increment A Single Attribute In A Block?

Aug 25, 2011

I have a series of blocks that I need to insert into a drawing, maybe 100-200 times and then change one of the 6 attributes by an increment of 1.

I've looked at some of the older posts and have not been able to do this. Is it possible to take the tag regerence, in this case OUTLET_REF and automatically add 1 to it when the symbol is inserted.

Can this be done using Diesel or with a bit of lisp?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add Attribute To Current Block In Drawing

Jan 22, 2013

i have a for example a block with one attribute and would like add a new attribute. i´m trying to read the current block and redefine - it comes a new attribute in propertieswindow but not graphical.

 (defun c:ent () (setq bn (getstring "
give a block name ")) (setq bez (getstring "
give a attribut name ")) (entmake (list (cons 0 "BLOCK")(list 10 0 0 0)(cons 2 bn)(cons 70 2))) (setq fe (entmakex (list (cons 0 "CIRCLE") (cons 8 "0") (cons 10 '(0 0 0)) (cons 40 1)))) (entmake (list (cons 0 "ATTDEF") (cons 8 "0") (cons 10 '(0 0 0)) (cons 11 '(0 0 0)) (cons 40 1) (cons 1 bez) (cons 3 "TOP") (cons 2 "NAME") (cons 70 0) (cons 73 0) (cons 50 0) (cons 41 1) (cons 51 0) (cons 7 "STANDARD") (cons 71 0) (cons 72 0) (cons 210 (list 0 0 1)) (cons 74 0) (cons 62 256) (cons 39 0) (cons 6 "BYLAYER"))) (entmake (list (cons 0 "ENDBLK")(cons 8 "0"))) (entdel fe) (entmake (list (cons 0 "INSERT")(cons 2 bn)(cons 10 '(0 0 0))(cons 66 1) (cons 62 256) (cons 39 0) (cons 6 "BYLAYER"))) (entmake (list (cons 0

[code]....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Block Attribute Update Routine

Nov 3, 2011

I'm trying to find a routine that will look for ABC block and updates its NUM attributes depending on what's shown in the DESC attribute.  There are about 5 of these ABC blocks in a drawing.  Block ABC has 2 sets of attributes: DESC and NUM. 

When run, it will look at the value of tag DESC, if it contains value XXX, then it will change the NUM value to 1111.  And if DESC contains value YYY, then it will change the NUM value to 2222.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Edit Block Attribute Properties

Jan 26, 2012

I'm looking for a lisp routine that i can globally change the text height and width factor of a particular block attribute. The name of the attribute tag is "TAG". I would like to be able to select all the blocks that i need to edit and then specify what text height and width factor i want to change to.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Create A Custom Block With Attribute

Mar 16, 2012

i'm relatively new to lisp routines. I've been trying to create a routine that will create a custom block with attribute with an option to select which drawing border size is being used. This is what i've got so far;

(defun c:NEW_REV_NOTE ()
(PRINC "
Drawing Size:")
(SETQ Paper_Size (GETSTRING "
[A1/A3] <A1>: "))
(IF (= Paper_Size "A1")
   [code]....

I'm going wrong at the moment I get an error message when I try to load the file "; error: syntax error".

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Plot A File With Block / Attribute Name

Jan 23, 2012

I would like to :

-select an attribute block in my layout viewports

- select a directory where the PDF will be saved

- select the printer

and zoo.

All my layouts will be printed. The files will be created. The filename will be the attribute name (different in each layout viexports).

[ACAD2011 CIVIL3d]

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Block Rename To Attribute Text Value

May 17, 2013

I wanna change my block name to attribute text value, any similar lisp code?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Copy Block Increase Attribute Number

Jun 19, 2012

I have a simple hexagon block with one attribute, i need to be able to copy it and as i do it increases the number by one.

the Block name is note1-2006 the attribute name is NOTENUM. I have tried using some other Lisps but i cant ge them to work. Sometimes i have to put 40 of these on a sketch i hate copying and changing the attribute by one everytime. so it would be nice to copy and as i pick mutliple spots it increase number. Dont know if there is a way to ask user to keep same number or increase. This would save me so much time.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine Measure Command And Block Attribute Value?

Nov 28, 2011

I am trying to create a lisp that prompts you to select multiple lines, and then prompts to enter a name of a block you wish to use. With that information use the measure command to place the entered block along the selected lines with the spacing set to the value in the blocks attribute.

I have a lisp that does most of this with the exception of the extracting the value of the block size to use as the distance between blocks, the current lisp just prompts for the distance.

I have a lot of blocks with different spacing so it is hard to remember the distance.

Here is the current Lisp i use:

(defun c:MEB (/ blk ss l name)
; TharwaT 04. 04. 2011
(if

[Code].....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Automating Changes To Title Block Date Attribute?

Jul 18, 2011

I'm using Autocrat 2004.

I have a attributed titleblock. Sometime in the future I will need to change the date attribute to another value, i.e.. 7-11 to 9-11.

I can't place a text string in the title block because this title block is used for multiple drawings and the date will be different for different sets. I can't have numerous title blocks because of the client's requirements.

Question:

Is there a way to write a script to open a drawing, look for the specific attribute, change the date value, save and close the drawing - across multiple sheets? Would a lisp routine called by the script be able to do this? Or a script file called by the original script file? CAn you even use a script file in this manner?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Check Attribute Of Block With External Database

Mar 2, 2013

I have a block with:

tag1: XX

tag2: YYYYYY

tag3: ZZZZZZZZ

I have an external file check.txt with string:

XXYYYYYYZZZZZZZZ

I would like to create a lisp program that check the attributes of block using an external database, if tag1+tag2+tag3 = XXYYYYYYZZZZZZZZ ok end program, if not  make a circle on block :

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Batch Rename Using Attribute From Title Block

Oct 22, 2009

I am working on a large project where a 3rd Party firm has turned over 100s of drawings that we need to get into our system. The problem is that they did not name their physical files properly. We have a particular numbering system for our drawings, the engineering firm did fill in our attributed title block properly and used our numbering system correctly within the drawing. However, their physical file name follows their format. We need to have the physical file name match the information in the title block to get into our system.

Is there a way to "Batch Rename" these files by reaching into the title block and then renaming the physical file to match the attribute?

I have to be honest, I may use AutoCAD 50 to 60 hours per week, but I am no programmer! I am just the go-to person here for AutoCAD whom is stuck trying to come up with a efficient solution for the project team whose engineering firm could not follow our procedures! I was hoping some sort of batch routine could take care of this problem for us instead of us having to individually rename each physical file one by one.

View 9 Replies View Related







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