Search the Community
Showing results for tags 'attribute value'.
Found 8 results
AutoLisp for deleting value of an attribute inside block of a block
pp2104 posted a topic in AutoLISP, Visual LISP & DCLHi! I am just new here and also a newbie in doing lisp routines. I was wondering if there is an autolisp that could possibly delete a text value of a specific attribute text inside a block of a block. I don't want to totally delete the attribute, just the value. I already tried several examples on the internet but doesn't really get to my satisfaction and as to how I want it to be. The only available lisp routine that I found so far is just yes, deleting the value but only works if the block attribute is outside the title block or even inside the title block itself but not when the attribute block is already inside a block of the title block. I need to do this for over 80 drawings and I was hoping to not doing it in an old fashioned way of opening each drawing just to edit-in-place the title block and then deleting the value of that attribute. Can anyone help me please? that would be very much appreciated. Thanks in advance.
Hi all! I would like to give (notedit) a tag attribute value to existing multiple blocks. The attribute is defined as ‘SIGNCODE’ but the value of thisattribute is currently empty.Also I need to givedifferent values to the ‘SIGNCODE’ for multiple blocks in the same file. I am using AutoCAD 2013. The full story is: Due to my project’s requirements, I hadto add additional attributes to existing block. Now I need to fill the valuesof these additional attributes. Each value applies for more than one blocks in the file. Example: If my file contains 300 blocks I wouldlike to give a ‘EX3’ value to the ‘SIGNCODE’ for 100 blocks, a ‘FB’value to the ‘SIGNCODE’ for 50 blocks, and a ‘AE’ value to the sameattribute for the rest of the blocks in the file. PS: I checked older post ‘Editing the same attribute in multipleblocks at one time???’ but the ATTEDIT solution does not work in my case. Alsoselecting multiple blocks and then filling the properties pallet does not work as theblock attributes do not show in the properties.. Your help highly appreciated!
Reading Attribute value is being trimmed by empty space
Muthanna posted a topic in AutoLISP, Visual LISP & DCLHi everyone, I am a software developer , i program in C# C++ and Java, but lately i have been given a task to help out our engineering department to write some code + script to fix cad prints which they have issues with. our problem is we use a third party application which generates an AutoCad drawing. this third part application sets the dimscale to 1:000; But the drawing's title block scale attribute has has the correct scale value. My task was to write code in lisp and our script to automate this process; which will requires the program to read the value for the scale attribute and apply it to the drawing dimscale. after reading some tutorials and searching the web i cam across some functions that did most of my task...Thanks to this community and its forums. my main function that reads the attribute value i got from on of the threads as shown below: (defun c:AttLst (/ ss eLst bEnt aEnt aEntLst aVal blkLst) (vl-load-com) (if (setq ss (ssget "X" (list (cons 0 "INSERT") (cons 66 1) (if (getvar "CTAB") (cons 410 (getvar "CTAB")) (cons 67 (- 1 (getvar "TILEMODE"))))))) (progn (setq eLst (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))) (foreach e eLst (setq bEnt (cdr (assoc 2 (entget e))) aEnt (entnext e)) (while (= "ATTRIB" (cdr (assoc 0 (setq aEntLst (entget aEnt))))) (if (= (cdr (assoc 2 aEntLst)) "SCALE") (progn (setq aVal (cdr (assoc 1 aEntLst)) blkLst (cons (cons bEnt aVal) blkLst)))) (setq aEnt (entnext aEnt))))) (princ "\n<!> No Attributed Blocks Found <!>")) (alert (vl-princ-to-string blkLst)) (princ)) This function works great when the scale value has no white spaces; but when there is white spaces it only returns the right side of the scale value example 1 : SCALE 1:5 ==> Result = (( TitleBlockName. 1:5)) example 2 : SCALE 1 : 10 ==> Result = (( TitleBlockName. 1 : )) as you see in example 2 the return value is missing the right side value can you please help me with this issue to figure out why its returning the left side only?
Find and Select blocks that have certain attributes & Change colour in multple files
liamdonnelly0209 posted a topic in AutoLISP, Visual LISP & DCLHi All. I am trying to achieve the following: for example... in 100 floor plans there are blocks that have certain attribute values. i want to be able to create a script/lisp that will find all blocks that include a certain piece of text ie "window" in the attribute value and change the block to a certain colour. Essentially it is the same way that the "FIND" command works but via command line/lisp/script etc instead. This will be so i can apply this specific task without user input on the 100 floor plans. Is there a way to do this as ive searched hundreds of terms/forums/ideas etc and came up with only find and replace tools or change all text in a drawing to certain colour. Your help is greatly appreciated =]
Find values in blocks and calculate weight
DTrain314 posted a topic in AutoLISP, Visual LISP & DCLI am trying to simplify my companies current process of updating BOM. We currently type all part dimensions in an excel spread sheet to get the weight of different group of materials. I wanted to make a lisp that after changing one or many of the dimensions in the BOM blocks it would recalculate the weight, avoiding any typo errors when manually recalculating. Ideally it would compare the item number (eg "37014") and then multiply the 2 dimensions and quantity. Then add all of items and put the total in the bottom right block of that group (eg "753.5") I am not sure how to start this lisp any help will be greatly appreciated. all the blocks are called "97bill" and the attributes are "bubbleno" "qty" "material" "itemnumber" "total-units". Thanks
Clearing Block Attributes
stenna posted a topic in AutoLISP, Visual LISP & DCLMorning Everyone, I've just won a fabulous project with a very well known supermarket producing phasing drawings for their new store fit-outs; I receive their drawings in DWG format with as you can imagine thousands of blocks detailing the shop fixtures. Each blocks contact a minimum of 5 attributes that they use for merchandising etc. This information is of no use to me what so ever and I would like to delete the information from the block as it messes up my phasing drawings making them illegible . Is there a lisp or any code that could remove all the attribute entry information (nothing else without resetting the block as they are mostly dynamic blocks) so I dont have to select each and every block to delete the information. I have tried freezing the attribute layer out of the drawing but this doesn't work due to not all the attributes being setup on the same layering standard . Look forward to hearing from you all Stenna
Building a text string using Attribute Values
kronk posted a topic in AutoLISP, Visual LISP & DCLHi guys, I'm a new member as you can see, but i've been coming here for many years to find information about lisp. I've done a thread search and haven't located a solution to my issue. I am self taught, so there is only so far i can go without getting the experts involved. My question (i think) is very similar to this thread http://www.cadtutor.net/forum/showthread.php?31762-Need-help-extracting-attribute-values-in-Lisp What i need to do is: 1. Extract two attribute values (Tags are "DRGNO" "DRGREV") from an inserted block (Block name "DRG_SHEET.dwg"). 2. Build a string in the Command Line using those 2 values. It seems very simple, i just haven't fully wrapped my head around the list manipulation tools in AutoLISP. Any help would be greatly appreciated. Thanks, Scott.
Can Attribute Values Change Visibility States
Alaskachick posted a topic in AutoCAD 2D Drafting, Object Properties & InterfaceThe Question: Can Visibility States be changed by an Attribute Value instead of the drop down arrow? The Situation: I am building an annotative block that the user wants to change appearance (ie different hatches inside a circle) based on an attribute value (1,2 or 3). The attribute is invisible and is one of +/-40 other attributes. I can change the appearance with visibility states and the little pull-down arrow on the block or the properties menu, but the user wants to be able to change it with attribute value. Is this even possible?