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. When I generate a new drawing it creates a text file with information. Autocad updates text automatically from this file using specific layers that the string is on in the drawing. Depending on what layer a string is on, that will determine what information it is updated with. With that being said, it will not update ATTRIBUTES within a BLOCK. Can someone help. I am willing to discuss and assist with figuring this out. I will be automating some information for my titleblocks and ALL of our titleblocks are blocked with attributes. Here is the code used to update the info (defun uinfo () (princ "\nUpdating Drawing Information...") (if (= found 1) (progn (setq dummy (read-line infile)) (setq desc (read dummy)) (setq dummy (read-line infile)) (setq drawing (read dummy))) (progn (setq desc '(1 . "- NEW EQUIPMENT -")) (setq drawing '(1 . "- UNASSIGNED -")))) (setq sset (ssget "X" (list (cons 0 "TEXT") (cons 8 "TITLE")))) (setq lp 0) (while (< lp (sslength sset)) (setq ent (entget (ssname sset lp))) (setq entinfo (cdr (assoc 1 ent))) (if (= (substr entinfo 1 4) "Desc") (entmod (subst desc (assoc 1 ent) ent))) (if (= (substr entinfo 1 4) "Draw") (entmod (subst drawing (assoc 1 ent) ent))) (if (= (substr entinfo 1 3) "Dwg") (entmod (subst drawing (assoc 1 ent) ent))) (if (= (substr entinfo 1 4) "DESC") (entmod (subst desc (assoc 1 ent) ent))) (if (= (substr entinfo 1 4) "DRAW") (entmod (subst drawing (assoc 1 ent) ent))) (if (= (substr entinfo 1 3) "DWG") (entmod (subst drawing (assoc 1 ent) ent))) (setq lp (1+ lp))) (setq sset nil) (setq lp nil) (setq sset (ssget "X" (list (cons 0 "TEXT") (cons 8 (strcat tcircuit "-EQMRK"))))) (setq lp 0) (if (/= sset nil) (while (< lp (sslength sset)) (setq ent (entget (ssname sset lp))) (setq entinfo (cdr (assoc 1 ent))) (if (= (substr entinfo 1 4) "Desc") (entmod (subst desc (assoc 1 ent) ent))) (if (= (substr entinfo 1 4) "Draw") (entmod (subst drawing (assoc 1 ent) ent))) (if (= (substr entinfo 1 3) "Dwg") (entmod (subst drawing (assoc 1 ent) ent))) (if (= (substr entinfo 1 4) "DESC") (entmod (subst desc (assoc 1 ent) ent))) (if (= (substr entinfo 1 4) "DRAW") (entmod (subst drawing (assoc 1 ent) ent))) (if (= (substr entinfo 1 3) "DWG") (entmod (subst drawing (assoc 1 ent) ent))) (setq lp (1+ lp)))) (princ "Done.") (prin1)) Here is the actual routine used to provoke the update of all information in the drawing based on its respective layer. (defun C:UPDATE () (setvar "CMDECHO" 0) (setvar "MENUCTL" 0) ;; (command "._snap" "0.03125") (command "plinewid" "0.0") (if (null filename) (setq filename (getstring "\nPath and name of update file: "))) (if (null tcircuit) (progn (C:EQUIP2)) (progn (makenames tcircuit) (checklayers tcircuit))) (if (null tcircuit) (progn (princ "\nCurrent name has not been established") (princ "\nplease type EQUIP and establish current equip. or make new")) (progn (openfile) (seek-tcircuit) (if (= (getvar "userr1") 0.0) (setvar "userr1" 3.0)) (if (= (getvar "userr2") 0.0) (setvar "userr2" 1.0)) (if (ssget "X" (list (cons 8 "CIRCUIT-INFO") (cons 0 "TEXT"))) (uinfo) (repeat 2 (read-line infile))) (if (ssget "X" (list (cons 8 "TITLE") (cons 0 "TEXT"))) (udates) (repeat 2 (read-line infile))) ;; (uinfo) ;; (udates) (if (= found 1) ;; (progn (udp) (uext) (uldar) (uvalve)) (princ "\nNO INFORMATION TO UPDATE")) (closefile))) (command "._-layer" "s" PIPING "") (princ)) I need to add to the code so that it will update the defined text strings of attributes within a block. IF you have any input or any questions I would appreciate everything.
  2. psuengineer84

    Dynamic Block Fields

    I cannot figure out how to get a field to update to a linear parameter within a dynamic block. See attached. There is a regular dimension string on the left and my custom dynamic block on the right. Don't mind that the action parameters do not affect the field, as I will update that when I figure this thing out. Thanks! SMALL_DIM.dwg
  3. Hello, I'm trying to make blocks with attributes and i watched video on youtube to do so .But when I insert the same block I need to name the tags twice. I don't know how it happens and it bugs me. Please help! A second question is that when I load the block in another dwg file, the base point isn't the same as it was on the existing file. how does this happen and how can i reset the point? and please use simple words because I'm from the Netherlands and I only know basic English:( thank you very much, Pakowano
  4. Hi all, I have a drawing with Attributes and Dimension. I want get value Attributes and Dimensions to Excel (2010) (view file Now.rar attachment). Please, help me get value Attributes and Dimensions to Excel by autolisp. Thank you very much! File: Now.zip
  5. Hi guys, When I insert a dynamic block containing text attributes, it brings up a list of questions for me to fill in the information (as normal). For convenience, I would like them to appear in some sort of logical order. Does anyone know how this can be achieved? To rearrange the list?
  6. I am a little new to assigning attributes. My company had a block with two attibutes that I need to alter. When the block is inserted, it asks a quantity. The other attribute is titled location. I am told if needed, all these quantities can be totaled per drawing. It has a title of "location". Two things: Can someone explain how to replicate this action? And is there a way to show all properties of a field for an attribute? Thanks, Nobull
  7. Hey All, If you are familiar with the "Fields" associated with text attributes, you may be able to answer my question.. If you set up a date to fill-in automatically when you open a drawing, will it update from day to day? Or once its set up, will it remain on that date..? Please let me know if i am unclear..
  8. I 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
  9. We have a drawing border that uses four lines of attributes for tracking revisions. I'd like to write a routine to move the values in each line up one line, so the latest revision is always on the lowest line. I can extract the attribute tags and their values into an associated (dotted pair) list easily enough. Since each line has attributes that are prefixed with a '1_', '2_', etc, I thought it would be easy to simply iterate through the list to change those numbers. It turns out that I was partially right. The list is easy to get, working with dotted pairs is not. My list looks like this: ("1_REV" . "1") ("1_DATE" . "04-11-13") ("1_DESCRIPTION" . "ADDED A BUTTERFLY VALVE TO THE BYPASS LOOP") ("1_BY" . "ABC"). I'd like to change all the instances of '1_' to '2_' in the list. I might be making this too hard, I know I could simply store those values to variables and then just create a new list, then push the new values into the block attributes, but that seems somewhat inelegant.
  10. Hi all, could you please give me a solution to update block attribute value in multiple layouts with out changing the existing values. eg: Tag DT3 Value "part-01" I need to edit the value as "MEP Part-01" The multiple layout have different numbers. So I need to add "MEP" to all layouts. Thanks for reading
  11. Can a AutoLISP command be written to read an attribute in a block and draw a circle with the attribute as the diameter using variables? The appilcation is taking the diameter of a tree trunk (the attribute), multipling by 12, and drawing the canopy circle on hundreds of those blocks. So the circles drawn will vary in size. Not sure how this could be set up, i'm NOT familiar with LISP writing AT ALL. 1) Read block, single, mulitple or definition? 2) Read Attribute 3) Varaible of attribute, (attribute is an inch measurement...it needs to be multipled by 12 to get feet for final use as circle diameter drawn) 4) Draw circle, variable, with diameter coming from attribute variable (attribute in inches that is multipled by 12) 5) Center point or circle to be block's base point Thanks everyone, always such great help here!
  12. Hi guys, I have a requirement to create a block with a few attributes, but the attributes require a bit of composition behind the scenes. Here's an abstract example. I need a block that represents a computer's identity. Each computer has 2 references that need to result in attributes that I can extract. One attribute is a unique reference across the project, and the other attribute is a room reference, and many computers can be in the same room. Here are some example references. Computer A Unique Reference: DF.SALES.01 Room Reference: DG.SALES.07 Computer B Unique Reference: DF.SALES.02 Room Reference: DG.SALES.07 Computer C Unique Reference: DF.SALES.03 Room Reference: DG.SALES.07 Computer D Unique Reference: DF.ADMINISTRATION.01 Room Reference: DG.ADMINISTRATION.02 Computer E Unique Reference: DF.ADMINISTRATION.02 Room Reference: DG.ADMINISTRATION.02 As you can see from the above, the 'common' part for a computer is the middle 'SALES' or 'ADMINISTRATION' part, which 'technically' only needs to be put in/typed in by the user once for each computer. I need to automate this process to reduce user input error, such that they only enter 'SALES' or 'ADMINISTRATION' once and don't end up creating the below, which would be invalid. Computer F Unique Reference: DF.RECEPTION.09 Room Reference: DG.SALES.07 Thus I imagine I need a third property/field/attribute to specify 'room', and then formulate the Unique Reference and Room References, using this 'room' part in the middle. The end goal here is that I need to be able to extract the above two references for each 'computer/block' and get them into Excel, and I need to be able to modify the 3 properties (room, unique reference and room reference) quickly, ideally using something like EATTEDIT, which is how we have edited attributes in the past. Apologies that this may seem like an odd request! The use case above is abstracted, it's actually not for computers at all but I figured it would make more sense than complicating it with the actual application! Many thanks in advance for any thoughts.
  13. I have made a few blocks that contain a few attributes. I have populated the Tag, Prompt, and Value for each block. When I insert the block the value seems to take on a life of its own and populate with text different than what I have entered. Any Ideas?? Block.dwg
  14. Hi All, I'm having trouble getting my attribute definitions to work with my blocks. I'm trying to create a tag that can flip around (dynamic) and have a tag number easily entered (attribute). I notice that I could only get the attribute definition to work during a drawing insertion is when I wblocked out my block and inserted that drawing file. I was not able to insert the drawing file that had the block in it. I can't seem to make a dynamic block drawing file, and then insert that dynamic block drawing file if I want the attribute to work.. Do you understand?? EDIT: I got it after more fidgeting...
  15. 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)
  16. So, to give some background information, I have 0 experience with LISP programming, and am an intern at an engineering company. I really would love to score "brownie points" by automating an extremely boring and time consuming task. I have experience with other languages, and can work off of a good base. So here's what I would like the routine to accomplish: 1.) Figure out the name of the title block (the title block will be in the same location on each and every file) 2.) Use that name to modify 5 attribute values of that block (each title block has the same attribute tags: NAME, DRAWING_NUM, SN, DATE, DESIGNER) 3.) Save in a new location. So, for example, lets say the drawing I want to modify is at the location C:/USER/ME/, and is called drawing1.dwg. Lets say that it's title block is called "blanksheet", the routine then needs to modify the 5 attributes (NAME: DrawingName, DRAWING_NUM: 123456, SN: 000, DATE: 10 10 12, DESIGNER: Me) of the block "blanksheet". Then, after it modifies everything, saves it in the location C:/USER/YOU, and is called drawing2.dwg. I'm not even sure if this is doable within the bounds of AutoLISP, so any feedback is appreciated. Thanks in advance!
  17. Hello all, I have two blocks with different attributes. want a connection between the two blocks especially in the areas marked in yellow. node when the value changes from 56 to 101 to make update the labels. Attach an example. best regards Sample Annotation Pipe for link.dwg
  18. I am trying to create a custom attribute editor by using fixo and metal_pro's code as a base but I'm getting runtime error '424' object required. The de****** is pointing out line AttList = oBlkRef.GetAttributes but I can't figure out what's wrong. I know the basic's of VBA but i'm new to it, so any help would be appreciated. Option Explicit Dim oBlkRef As AcadBlockReference Sub Change_it() Dim inspt As Variant Dim oEnt As AcadEntity Dim i ParentSymbolForm.Hide ThisDrawing.Utility.GetEntity oEnt, inspt, "Select object:" ' Checks if you selected a block. If TypeOf oEnt Is AcadBlockReference Then Set oBlkRef = oEnt ' Check for attributes. If oBlkRef.HasAttributes Then Dim AttList As Variant ' Build a list of attributes for the current block. AttList = oBlkRef.GetAttributes ' Cycle throught the list of attributes. For i = LBound(AttList) To UBound(AttList) ' Check for the correct attribute tag. If AttList(i).TagString = "TAG1" Then ParentSymbolForm.ComponetTag.Text = AttList(i).TextString End If If AttList(i).TagString = "DESC1" Then ParentSymbolForm.TextBoxDesc1.Text = AttList(i).TextString End If If AttList(i).TagString = "DESC2" Then ParentSymbolForm.TextBoxDesc2.Text = AttList(i).TextString End If If AttList(i).TagString = "TERM01" Then ParentSymbolForm.TextBoxPin1.Text = AttList(i).TextString End If If AttList(i).TagString = "POS1" Then ParentSymbolForm.TextBoxSwPos1.Text = AttList(i).TextString End If Next End If ParentSymbolForm.Show Else MsgBox "You did not select a block." End If End Sub Private Sub SelectButton_Click() Call Change_it End Sub Private Sub ChangeButton_Click() Me.Hide Dim AttList As Variant Dim i ' Change attributes for the selected block. AttList = oBlkRef.GetAttributes ' Cycle throught the list of attributes. For i = LBound(AttList) To UBound(AttList) ' Check for the correct attribute tag. Select Case AttList(i).TagString Case "TAG1" AttList(i).TextString = ParentSymbolForm.ComponetTag.Text Case "DESC1" AttList(i).TextString = ParentSymbolForm.TextBoxDesc1.Text Case "DESC2" AttList(i).TextString = ParentSymbolForm.TextBoxDesc2.Text Case "TERM01" AttList(i).TextString = ParentSymbolForm.TextBoxPin1.Text Case "POS1" AttList(i).TextString = ParentSymbolForm.TextBoxSwPos1.Text End Select Next End Sub
  19. Hi, Recently I've gotten into this type of problem. Have an ATT "A" that is set. I can change it and it will change. But I also have an ATT "B" which works the same way as the "A". I've added a MTXT into the block so that both ATT's A and B will work together, meaning they will always be in a dead center - something like text (no matter what the string is, you can Align it Middle Center), using a FIELDS option, and parameter set to VALUE. It works when placed into the drawing, but need something that once I place the block and want to edit the VALUE, the Fields will update/sync. I'm asking for some guidance from you guys. Thank you in advance for the help. Vee A and B.dwg
  20. Is there any way to rename a tag without using battman? I need to replace some drawing borders and some of the attribute tags on the new border are named differently from the tags on the old border. I'd like to be able to use transparent commands to make a script file to do it automatically instead of calling up battman, clicking through and typing on every single one.
  21. I have hundreds of drawings with attributes that are duplicated. I can't go through each individual drawing, call up BATTMAN and delete them one by one. I need a way to automate the process. The duplicates always show up in EATTE and show up most of the time in BATTMAN. I need a lisp that will find and delete duplicates shown in RED while leaving the originals intact. Can anyone help?
  22. Hi all, I am jumping 8 versions to 2012 and have found many great changes and some surprises. I've located this command but it changes the all text strings that match? I tried naming the block but that didn't work. Can anyone enlighten me? 2. Gobal edit – Modify > Object > Attribute> Global. Command is –ATTEDIT – a. Editattribute one at a time > enter N b. Editonly visible on screen > enter N c. Enterblock name specification > enter d. Enterattribute tag specification > enter e. Enterattribute value specification > enter f. Enter string to change > enter text makingsure it is case sensitive g. Enternew string > enter text
  23. Hello Everyone! As my first post I'm going to give a doozy. I've searched and searched, but can't find a lisp or info that helps me with my problem. Maybe I can find some help here - even though I've already turned grey, I'd still appreciate it. So, here we go... I insert attributed blocks into my drawings that list part number, model number, etc. Along with these attributes, there's another tag that is an incremental number (used in our Bill of Materials). If there are two identical parts (i.e., same model number), the incremental number needs to be the same; if the parts are different, the next sequential number needs to be used. Doing this by hand is not only time-consuming, but tends to be extraordinarily erroneous. So I'm looking to make a lisp routine that I can run to auto-number these blocks. I'm thinking that I can insert my blocks (or re-use them, copy, etc.) without too much concern over the number tag, then run the lisp at the end to give the numbers to each unique block. It'd be nice if any numbers already there could stay the same (we re-use drawings all the time). Block: BOMTAG Tags: ITEM (Increment Number) MODEL (Model Number) PART (Part Number) I don't know a ton of lisp, so I don't know that I can make it on my own, but maybe a nudge in the right direction could keep me from wasting a bunch of time. Any ideas? Make a list of blocks, do something with them, give if-then statements, re-number if needed, move to next block. Easy to type, hard to program. Free rendering to anyone who gets the winning code. Thanks so much, I appreciate any help. -stu
  24. I need to use detail callouts on a regular basis. They all have to look the same, even though some appear in paper space and some in model space. I've gone to a user block. The attribute style has a width factor of 1.25. I overrode it in the block and changed it to 1.00. When I draw a multileader with this style, the block has text with width of 1.25. AutoCAD has overridden my override. On a similar note, when I change the multileader definition from the default _DetCallout to the user-defined DetCallout (note the underline), the existing multileaders don't update, and I can't figure out how to make them update. Is it a bug, a quirk, or something else? Does it really matter what you call it if they never fix it?
  25. I have a routine that replaces one block with another block based on the block name. I need help making it run only if a specific string of text is found in one of the attributes within the found block. Can someone help? Thanks. (defun c:name () (setvar "attreq" 0) (setq ssblocks (ssget "x" '((0 . "INSERT")))) (if ssblocks (progn (setq lstblockmap (txtfile2lst "C:\\path\\filename.txt" ) ) (setq lstblocks (sel2lst ssblocks)) (foreach enblock lstblocks (setq strblockname (car (getval (setq stroldname (strcase (getval 2 enblock))) lstblockmap ) ) ) (if strblockname (progn (prompt (strcat "****** " strblockname " found.******")) (progn ;;;;;Do more code ) ) (progn (prompt "No block definition, Skipping...") ) ) ) ) ) )
×
×
  • Create New...