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 I have 96 different hatches. I have a template block with only 2 lines of text: Area and Name. I want this block to appear in the middle(ish) of a hatch when i click on it, with "Name" attribute beeing the layer the hatch is on, and the "Area" attribute of the block is the Area of the hatch, divided by 1000000 and m2 behind it. Is this possible?
  2. Hi, Task 1: I need help on adding prefix to an attribute tag named ITEM_NUMBER but dont want to increment. Below is a code from Lee Mac that has prefix + increment and I tried to manipulate it but was unsuccessful. Could some one help me please? Also, prefix would change between different drawings. So, if its asks for prefix, would be great. Task #2 The ultimate goal is that once I add prefix to item number, I will copy this and modify to add prefix to BALIN tag (which is a balloon). This way I will have same prefix+number for the ITEM_NUMBER and BALIN tags. Task #3 Once this is done, and everything arranged on the drawing, I would like a utility to renumber the item numbers by removing prefix and re-incrementing it. And while doing that, It should changes at both places at once (since the prefix + number are exact both places). The tricky thing here is that multiple balloon could reference the same number since that part could be used at multiple places. Not sure if this sounds feasible? But if it does, It will save a big time headache for me since some of my drawings have about 50+ items and balloon which needs to be arranged. (defun c:incatt ( / tag pre ss1 ) (vl-load-com) (setq tag "ADDRESS" pre "ADDRESS: ") (if (setq *num* (cond ( (getint (strcat "\nSpecify Starting Number" (if *num* (strcat " <" (itoa *num*) "> : ") ": ")))) ( *num* ))) (while (setq ss1 (ssget "_+.:E:S:L" '((0 . "INSERT") (66 . 1)))) (if (vl-some (function (lambda ( x ) (if (eq tag (vla-get-tagstring x)) (not (vla-put-textstring x (strcat pre (itoa *num*)))) ) ) ) (vlax-invoke (vlax-ename->vla-object (ssname ss1 0)) 'getattributes) ) (setq *num* (1+ *num*)) (princ (strcat tag " Attribute not found.")) ) ) ) (princ) )
  3. So I have a lisp program that draws some attributes. I want to be able to write a lisp program that will change the value of the selected attributes and I want the CCTNUMBERS to be in chronological order. I want the lisp to be able to take the smallest number and puts it in on the attribute that is to the most left of the selected window and the largest number to be on the right. Any ideas on how I can write this lisp? I don't even know how to be able to grab the respective attribute information let alone change it. Help please. This is what I have: This is what I want:
  4. Good Morning, I am brand new to AutoLISP and am not picking it up quite as well. I'm trying to make a LISP that will insert around 1500 blocks at designated coordinates off a list I will make in Excel (or can transfer to a txt). The excel list will have X,Y coordinates, an angle of rotation, and 2 or 3 attributes. This LISP will not be for a long time use, it's mainly to get a large insertion completed for editing as construction comes along, so I only need to make it for functional purpose. If someone can guide me better in how to extract the information from the list into the LISP, that's the main thing I'm having trouble picking up. Thanks for any help!
  5. Hi All, I'm sure this is possible but I don't even know where to start. I am happy to do some reading if someone can direct me to a tutorial or web-page that will help me... I want to toggle the visibility of certain objects based on the contents of particular attributes in my title block, for example: (simplified text program) case: title_block_attribute = DRAFT Display Draft.JPG title_block_attribute = FOR REVIEW Display Review.JPG encase; or maybe: if title_block_attribute = DRAFT then "display Draft.JPG" = 1 endif; Can anyone help me with this? I've tried Google, but I haven't even found the right search terms that yield even close to what I need! Cheers, Pawnsurfer
  6. 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.
  7. 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
  8. 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
  9. 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
  10. 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?
  11. 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
  12. 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..
  13. 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
  14. 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.
  15. 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
  16. 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!
  17. 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.
  18. 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
  19. 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...
  20. 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!
  21. 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
  22. 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
  23. 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
  24. 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.
  25. 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?
×
×
  • Create New...