Jump to content

Search the Community

Showing results for tags 'attribute'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions

Categories

  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

  1. Hi all, Again I have found a lisp Lee Mac made that copies a field into a dimension, "copyfield", but it requires that the field already exists... So is there a way to create a field from an attribute in a block and then insert the field directly into a dimension? Thanks in advance.
  2. I have difficult time finding a command that would match a block's attribute (text height, text rotation, and text scale) with a source block. I had found a LISP routine that would match the block itself with a source block but it did not include attributes. I don't need to match attibute values, just the properties. I'm using AutoCAD 2012 with regular blocks (not dynamic)
  3. I have drawing with a bunch of blocks with attributes tags. Among the attribute tags the following three are of importance: ID Next Previous The ID attribute values are already entered in the blocks and are unique. I would like to have a lisp that will enable me to sequentially pick the blocks and fill in the Next and Previous attributes tags with the ID values. Attached is sample file showing the starting point and expected end result. Any ideas how to go about making this lisp? EDIT: I have been able to modify a lisp from @Lee Mac as fist step. But it only works in forward direction i.e to fill in Previous attribute. Im thinking that to get the functionality to fill in "Next", we cannot use single item selection, we will have to use list selection to get the iD of next block and fill in the current block in "Next" Attribute. So the operation sequence will be Start lisp> Click all blocks one by one> hit Enter Any help in achieving this will be welcome. (defun c:ca ( / _SelectBlockWithTag a b des src tag ) (vl-load-com) (setq src "ID" ; Source Attribute Tag des "Previous" ; Destination Attribute Tag ) (defun _SelectBlockWithTag ( tag / e a ) (setq tag (strcase tag)) (while (progn (setvar 'ERRNO 0) (setq e (car (entsel (strcat "\nSelect Block with attribute " tag ": ")))) (cond ( (= 7 (getvar 'ERRNO)) (princ "\nMissed, Try Again.") ) ( (not e) nil ) ( (and (eq "INSERT" (cdr (assoc 0 (entget e)))) (= 1 (cdr (assoc 66 (entget e)))) ) (if (not (setq a (vl-some (function (lambda ( x ) (if (eq tag (strcase (vla-get-tagstring x))) x) ) ) (vlax-invoke (vlax-ename->vla-object e) 'getattributes) ) ) ) (princ (strcat "\nBlock does not contain tag " tag ".")) ) ) ( (princ "\nInvalid Object Selected.") ) ) ) ) a ) (while (and (setq a (_SelectBlockWithTag src)) (setq b (_SelectBlockWithTag des)) ) (vla-put-textstring b (vla-get-textstring a)) ) (princ) ) SampleDrwaing.dwg
  4. Dear Civil Engineers I have a drawing of rebars for a concrete beam as follows: Example: 2x2T16(F.B.)/L=800 It consists: 1-position numbers inside circle. They are not typed them in above drawing. 2- number of rebars: 2x2=4 for two side of the beam 3-T: to show type of the rebar. Here all of them is one type and no need for this letter. 4- 16: size of the rebar, that is diameter of the rebar is 16 mm 5- (F.B.): show the location of the rebar. Here they are on to side face of the cross section. Others or top and bot and add for added 6- L: is the total length of the bar. Here it is 800 mm. All these numbers are typed by a draftsman and I should extract them manually into a table to produce list of rebars beam by beam, which is a tedious and time consuming job prone to mistakes. I think there must be an easy way by putting these figures into another property of the drawn lines (maybe attribute) and the table could be constructed automatically using a lisp or a cad command. So I want to learn this method and instruct the draftsman to put those figures in proper place for my future works. Second question: missing position numbers. Is there an easy way to populate these position numbers? I think there must be other techniques or software for making these drawings and extracting the rebar table, but at present I have no choice except using AutoCAd for drawing these beams and making the table. Will be happy to hear your experience and comments and new software for this purpose.
  5. As posted over at theSwamp, I thought I'd post it here for you guys also CopyText.lsp The program will allow a user to copy the text content from a source object to a selection of destination objects or swap the text content between two objects. The user may select from Text, MText, Attribute, or Multileader objects. Upon choosing 'Settings' the user can alter whether source object formatting should be retained upon copying/swapping to/with objects which permit the use of such formatting. Ideas/criticism/feedback are, as always, welcome Enjoy! Lee CopySwapTextV1-6.lsp
  6. Having written the first draft of my old 'Global Attribute Editor' program almost three years ago, I thought it was about time I offered something new and improved. And so, I've spent some time putting together a new and improved... Batch Attribute Editor A full description of the program, including some 'Hints and Tips' for using it can be found here; but as a brief summary: the program allows the user to modify the values of multiple attributes residing within multiple attributed blocks across multiple drawings. Upon starting the program using the command syntax 'batte' (Batch Attribute Editor) at the command-line, the user is presented with the first of two dialog interfaces: the first screen for input of attribute data; the second for drawing selection. At the top of the first dialog there are three edit boxes in which the user can input a Block Name, Attribute Tag and a new value for such attribute. The program can also process multiline attributes and the attribute value can use Field Expressions. The program also offers the ability to increment an attribute value for each layout/drawing processed. If an attribute value contains markers surrounding numerical data, the numerical section between these markers will be incremented by one for each drawing processed by the program. The user can also reference existing attribute values, facilitating batch prefixing & suffixing of attributes. After attribute data has been entered and a number of drawings have been selected to be processed, the user may click the 'Run' button to modify the listed attributes in each of the select drawings. Some Previews... Attribute Data Interface Editing an Entry Selecting Drawings to be Processed BatchAttributeEditorV1-5.lsp
  7. I have a dynamic block which have some attributes and I'd like to get the contents of the attributes. For example, if the block has 2 attributes, attr1_size and attr2_color, and the value of attr1_size is small , and the value of attr2_color is red, what I need is a list , (attr1_size small)(attr2_color red) I thought the (vlax-invoke (vlax-ename->vla-object block_name) 'GetAttributes) will do this, but the result was like this. (# #IAcadAttributeReference 0eef3e54>) Is there any way to get the attribute value from the random sequence? Or, any other code to get the value? What I finally want to do is clicking a block and automatically insert some new figures according to the value of an attribute. Thank you!
  8. (defun c:awz ( / sUndo enx atent atent_list) (setq sUndo (vlax-invoke (vla-get-ActiveDocument (vlax-get-acad-object)) 'StartUndoMark)) (setvar 'errno 0) (while (/= 52 (getvar 'errno)) (setvar 'errno 0) (setq atent (car (nentsel "\nSelect multiline attribute to change Defined Width to 0: "))) (cond ( (= 7 (getvar 'errno)) (prompt "\nNothing Selected.") ) ( (null atent) (prompt "\nExit.") ) ( (/= "ATTRIB" (cdr (assoc 0 (setq enx (entget atent))))) (prompt "\nSelected object is not an Attribute.") ) ( (= 4 (logand 4 (cdr (assoc 70 (tblsearch "layer" (cdr (assoc 8 enx))))))) (prompt "\nSelected Attribute is on a locked layer.") ) (if atent (setq atent_list (entget atent)) (setq atent_list (subst (cons 41 0) (assoc 42 atent_list) atent_list )) (entmod atent_list) )) (if sUndo (vlax-invoke (vla-get-ActiveDocument (vlax-get-acad-object)) 'EndUndoMark)) )(princ) )(vl-load-com)(princ) by researching past codes from pros like Lee Mac and Grrr, i was able to create this lisp all on my own. At work we have a program that inserts Blocks with a multiline attributes with information set in them and each value is it's own line of text. Unfortunately, sometimes, by that i mean most of the time, if a space is inside the information, it'll "word wrap" and create a new line. It is very annoying having to double click the attribute, then "..." and then change the width of sometimes over 100 attributes. Out of frustration, this Code was born. I welcome everyone to criticize this code as much as they can, i like learning how others would have written it. what i added that wasn't needed, what i needed that wasn't added, what would have been an easier approach. don't hold nothing back! If i didn't give credit to some of the original creators of the code that inspired me, i apologize. you guys deserve all the credit.
  9. Hi, I am Michel Can you kindly to help me to. I need a lisp for a cable routing. I have just a block consist of 3 attributes (TAG, SRTP, MVZ). I need to extract each relating value in separate column in excel. For example, if I select 5 blocks in drawing, I need to have 5 columns, each column has only 3 rows (3 attributes) and the possibility to have different rows for different electric cables in same file. Thank you in advance Michel richiesta.xlsx
  10. Hi, I have a dwg with a bunch of the same block in it (called Cabinet). This particular block has a number of visibility states. I have assigned an attribute (called SetVisState) to the block that I can modify via ATTOUT and ATTIN. I want a LISP routine to check this attribute in each block, then update it's visibility state based on this attribute. Unfortunately I have next to no experience with LISP, so any guidance would be appreciated. I have tried looking around this forum and others, but so far have only managed to run a LISP that checks the current visibility state and then toggles between states (I need it to check attribute value then change vis state accordingly). I tried Lee Macs code for getting attributes, but couldn't figure out how to apply that to my scenario either. Thanks in advance.
  11. I came across the attached LISP routine that allows attribute information to be extracted into an excel document. Unfortunately this code searches the entire drawing for attributes, when I need only specific blocks to be selected. I am looking to modify the following code, so that it will prompt me for a selection window when extracting specific block attributes in a drawing. If anyone can help me with this I would appreciate, as I have no experience writing or modifying LISP. Thank You ATTOUT.LSP
  12. Drawing A: old tag definition Drawing B: new tag definition Hi Guys, I have an opened drawing file A with an old attribute tag definition and brought in another attribute block with the same name but having a new attribution tag definition from a drawing file B. I had purposefully purged drawing A’s attribute block containing the old tag definition, hoping to bring in the same-name attribute from drawing B, having new tag definition. It went well except the Enhanced Attribute Editor still contains the old tag definition of drawing A – even though Battman shows the new defined tags from drawing B. This means that I need to somehow, Purge the old defined tags from drawing A. Am I able to purge the attribute’s definition from a drawing? I am doing this so I may not have to change the attribute block’s name and keep the new tag definition. Thanks for your time, "Mitch"
  13. Hello, I'm searching to make a LISP, to change the layer of an attribute. Actually it in "TopoAlt" Layer, I like to change in "0" layer (or other) I thinked about DXF code but i don't find it with dumpallproperties. "Battman" command would be a good solution but I can't make script "-eattedit" command is pretty close but I'm stopped when It need " attribute selection". If i could scripting "-eattedit" with an automatic attribute selection (like an already made SSGET), I could change the layer, or other properties ! Any Idea ?
  14. Hi, I have 3 drawings, each with 50+ layers. The client wants me to export each individual layer as an individual SHP file, and needs me to run the export every couple of months. I can write up a script file specifying each layer etc, the catch is that I also need to export the Attribute Data from the attached data tables for each item. I cannot seem to get a hook into the Attribute Data using the MAPEXPORT command in a script, e,g: -mapexport" "SHP" "c:\\Temp\\MyLayer1.shp" "Y" "c:\\Temp\\Street.epf" "S" "L" "All" "MYLAYER1" "*" "No" "Proceed" -mapexport" "SHP" "c:\\Temp\\MyLayer2.shp" "Y" "c:\\Temp\\Street.epf" "S" "L" "All" "MYLAYER2" "*" "No" "Proceed" This will export my layers, but minus the Attribute Data from the attribute table. Does anyone have experience in doing this kind of export to SHP? Is it possible to script, or code so that the shapefile contains the Attribute Data? I tried something along the lines of: -mapexport" "SHP" "c:\\Temp\\MyLayer2.shp" "Y" "c:\\Temp\\Street.epf" "S" "L" "All" "MYLAYER2" "*" "No" "D" "MyDataTable" "Proceed" But this was just a stab in the dark, I cannot find any documentation outlining the datatable in the command line use of MAPEXPORT. Note: I can export the shapefile manually and select the data table and it exports as I need it to (by selecting the Data tab in the export dialogue). I have very limited knowledge of Lisp. I hope I have explained my issue well enough. Thanks for any help.
  15. Hi All, I want to make a lisp program to add prefix/suffix to all attributes of a selected block. Say, what I want to add is "(W1)". If the block has two attributes and if the attributes have their values 12134 and 23564, it should become 12134 (W1) and 23564 (W1) This process has to be looped so as to enable editing of multiple blocks one after the other. So far I have this; (defun c:w1() (setq n 1) (while (> n 0) (setq ent (car (entsel "Select Block:"))) ;This is where I am stuck. This is where I need to edit the attributes );While );Function Please help...
  16. i have so many block attribute in my drawing, when i selection attribute and use attout. the result from txt file the list become not sequential. for example : I want the order to remain the same
  17. Hi, I am a beginner with AutoLISP. I have adapted a program found within this forum that adds attributes to an already existing block within a drawing. I have been able to change the font to ARIAL, but I would also like to make it BOLD, how can this be done? (vlax-put AttObj 'Alignment acAlignmentleft) ;; 4 (vlax-put AttObj 'StyleName "Arial") Is there a simple vlax-put command that can set BOLD to true? Thanks
  18. TL;DR I need to connect blocks using attribute values. I created multiple blocks and attribute with different properties (Annotative, scaled attribute text to 1:50, Upside down, Backward, Invisible, Constant, Verify, Preset, Multiple lines, Lock position, Visibility parameters) Request 1: I need to request for help to create a lisp for connect with *lines between attribute definition values since their attribute insertion point or block insertion point, ignoring all properties, included caps, but Visibility parameters not should be ignored, all this just of selected blocks (dynamic blocks, regular blocks, nested blocks). (check dwg attached for more details) Request 2: Add an option for let me choice if I need to ignore just specific attributes tag. (in the attached drawing I ignored between attributes values “tipo” and “nivel”) Request 2: Add an option for let me choice if I need connect just specific attributes tag. (in the attached drawing I connected between attributes values “codigo” and “alimentador”) Request 3: Add an option for let me choice for connect blocks insert point or attribute definitions insert point (check dwg file and images for more details) PD: attached blocks with the name “connect attributes.dwg” PD: if possible use DCL or OpenDCL for the GUI. connect attributes.dwg
  19. Hi guys, Im looking for lisp routine that instantly inserts field for measurement of dimension line to an attribute text or specific attribute tag in a block. i.e. I have this dimension line "dim A" and a tag "cutting_length" in the attribute, such that the attribute value will change according to the dimension. Thanks in advance!
  20. I've been looking for a routine that will allow me to transfer an attribute from one block to another. Ideally I'd like to click on one block which contains the attribute I want (from a field called ID_1), then click on another block and copy the attribute to another specific field (ID_2). I need to do this to quite a few blocks so I'd like to just continue to click between the two types of block. I thought I could modify the code on this page http://www.cadtutor.net/forum/showthread.php?32085-Need-Lisp-to-update-attributes, but this appears to place the same attribute on every block I click. Any help is greatly appreciated!
  21. Hello, In this DWG i need to pair text (which is room function) with block attribute "FUNCTION" that i've created. I can do this manually but it's over 1000 blocks ,so that make me wonder is it possible to create LISP which take nearest text into block attribute. I've found that LISP (https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-text-value-to-a-block-attibute/td-p/7949545) but it's swaping texts over rooms for example in room where laboratorium is located it name it biuro which is located next to it. Sorry for my plain english, I'm not native speaker. Thanks in advance! test_1.dwg
  22. Hello, I am student and I need help to make civil drawing to map drawing. I have a drawing which has rf_id and polylines but rf_id is block reference and this is not related to polyline. How can I relate these values together?
  23. I have created Dynamic Block with grips and Attribute linked to the parameter. Now I override that attribute value to a manual value through a program and change the parameter. Now, when I move the grips of dynamic block, the attribute value linked to it doesn't change and remains as manual value. Is there any way/ program to retrieve the relation between attribute and parameter value? Pls find attached Program and Dynamic Block. You can override linked values of "WIDTH" & "LENGTH" by 'double-clicking' on block and entering manual value. Upload & Run the program with command "DChange". This will change the shape of block as per manual value. After this, when you will stretch the grips of block, it will change the shape; but, the attribute value "WIDTH" & "LENGTH" will not change. Can this linking between Attribute & Parameter revived so that attribute values will change with moving grips? Straight Duct.dwg DChange.lsp
  24. Hello Guys, I have a doubt, someone knows if has some Lisp to get the last digits (specified - user input) of a dwg file name (in Windows explorer) and write it on a specific attribute name on a internal block. Eg.: I have a folder with 600 pages dwg files, so, the last numbers of it is a specific item to show the page number of that file, it's possible read these numbers and write in an attribute inside dwg to correct the page index.
  25. Hi, is there a way to save my drawing with its name in a directory by using a Attribute value. Example: Drawingname: test.dwg blockname: TitleBlock Attribute: SF:WE Attribute-Value: test2 And it should save the drawing in: C:drawing/test drawing/(attribute-value)/... but it should be in a dialogbox, so i can choose the specific subfolder the direcotry up to the attribute-value is fix.
×
×
  • Create New...