Search the Community
Showing results for tags 'tag'.
-
Copy Multiple Block Attributes from one block to another one click
lamonmar posted a topic in AutoLISP, Visual LISP & DCL
I have a drawing that has two different blocks (see attached), what I needed to do was transfer over the attributes of one block over to the other (both have different tags). For example copying over attributes in "rev0_date" from the first block tag over to "revslot1date" in the second block tag , I ran across some code in the forums that did just that created by Lee Mac.The problem with it is it only transfers one attribute over, I modified it a little but its still not exactly what I need. The way it currently works is - It asks me to choose the first block with the attributes to copy, once selected it then asks me to choose the second block that will have the attributes pasted to it, once I've selected them, it then pastes the first specified tag attribute in the first block to the second, after that I have to repeat the process again, clicking the block with the attribute to copy and then choosing the second block to paste, I have to keep repeating these steps, clicking the first block then the second over and over until all the tag attributes have been copied over. My question is how can I stop having click the first and then second block over and over again for each tag and instead only have to go through the process once (click first block, then second and then transfer all the attributes over at once). Here is my current code (sorry if its a mess I'm very new to this): (defun c:blockswap ( / _SelectBlockWithTag a b des src tag ) (vl-load-com) (setq DAT1A "Rev0_Date" ; Source Attribute Tag 1 DES1A "Rev0_Desc" ; Source Attribute Tag 2 REV1A "Rev0" ; Source Attribute Tag 3 RDB1A "Rev0_Drawn_By" ; Source Attribute Tag 4 REV1B "RevSlot1Number" ; Destination Attribute Tag 3 DES1B "RevSlot1Description" ; Destination Attribute Tag 2 DAT1B "RevSlot1Date" ; Destination Attribute Tag 1 RDB1B "RevSlot1DrawnBy" ; Destination Attribute Tag 4 ) (defun _SelectBlockWithTag ( tag / e a ) (setq tag (strcase tag)) (while (progn (setvar 'ERRNO 0) (setq f (car (entsel (strcat "\nSelect Block with attribute " tag ": ")))) (cond ( (= 7 (getvar 'ERRNO)) (princ "\nMissed, Try Again.") ) ( (not f) nil ) ( (and (eq "INSERT" (cdr (assoc 0 (entget f)))) (= 1 (cdr (assoc 66 (entget f)))) ) (if (not (setq z (vl-some (function (lambda ( x ) (if (eq tag (strcase (vla-get-tagstring x))) x) ) ) (vlax-invoke (vlax-ename->vla-object f) 'getattributes) ) ) ) (princ (strcat "\nBlock does not contain tag " tag ".")) ) ) ( (princ "\nInvalid Object Selected.") ) ) ) ) z ) (and (setq aa (_SelectBlockWithTag DAT1A)) (setq ab (_SelectBlockWithTag DAT1B)) ) (vla-put-textstring ab (vla-get-textstring aa)) (and (setq ba (_SelectBlockWithTag DES1A)) (setq bb (_SelectBlockWithTag DES1B)) ) (vla-put-textstring bb (vla-get-textstring ba)) (and (setq ca (_SelectBlockWithTag REV1A)) (setq cb (_SelectBlockWithTag REV1B)) ) (vla-put-textstring cb (vla-get-textstring ca)) (and (setq da (_SelectBlockWithTag RDB1A)) (setq db (_SelectBlockWithTag RDB1B)) ) (vla-put-textstring db (vla-get-textstring da)) (princ) ) drawing.dwg -
Exchange Same-Name Attribute Block With New Tag Definition
"Mitch" posted a topic in AutoCAD Drawing Management & Output
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" -
I remember coming across a function that would highlight or mark a specified drawing area. Kind of like what you get when the hatch command detects a gap in the boundry selected. Small red circles that remain until a regen or redraw. Did I imagine it or does such a function exist? I know it can be replicated by some sort of entmake or grvecs/grdraw combo... but like I mentioned I thought I remember seeing that exact function somewhere. Anyway thanks for your time.
-
Dear folks, We all know that Revit has tagging capabilities and I know that AutoCAD can also do that with Lisp. Lets assume we have 5 different solid hatch each in different layers like: Layer Name - L1 Layer Name - L2 Layer Name - L3 Layer Name - L4 Layer Name - L5 I want to place a block named LNAME with an attribute and place them onto hatches and get the Object->Layer proporty in it. I attached the sample file. Thanks in advanced. MA LISP-TAGGING.dwg
- 11 replies
-
- lisp
- layer names
-
(and 1 more)
Tagged with:
-
Change Attribute Tags for Blocks using Lisp
hosannabizarre posted a topic in AutoLISP, Visual LISP & DCL
I am pretty keen to know if it is possible to change attribute tag names using lisp (or some other strategy). I have lots of different blocks, and they all have two attributes. The tag for attribute 1 is "X", with a value of "100" The tag for attribute 2 is "Y", with a value of "200" Is is possible to change all the blocks in the drawing, such that the attribute 1 tag is renamed from "X" to "A", and the attribute 2 tag is renamed from "Y" to "B". I would like, if possible, to preserve and leave unchanged the values associated with the respective attributes, and change only the tag. So basically, once the script is done, I will still have blocks with two attributes, one with the tag "A" and a value of "100", and another attribute with the tag "B" and the value of "200". To clarify; I'm not interested in replacing attribute values, but rather changing attribute tag names. Hope this is comprehensible to someone, and maybe even achievable. -
Hi all, I am newbie in Revit. I want to scale down the "room tag" (defined in original "M_Room Tag.rfa" or "Room Tag.rfa" files) to use it in some small areas. I know how to change the font size of labels, but I tried with no success to change the border of label. Who can help me? I appreciate any help or clues directing to solve the problem. P.S. I made a mistake typing "room tag" in title of thread, unable to correct it.
-
Get Block data without picking the block...?
BShick5088 posted a topic in AutoLISP, Visual LISP & DCL
Good morning, I have a piece of LISP that allows me to pick a block then pass the data into a new block's attributes, the problem is that when I run it in a script file it does not seem to pick the blocks using the coordinates given even though it does if it is manually typed in to test the function.... Is there someone that can show me what I need to change in the attached LISP to automatically fix the block data and not require the user to pick anything, just use the block names...? Thank you all very mush for helping. Copy Attributes to new blocks.lsp -
Lisp routine to inert tag number text on to drawing in a box or rectangle
arbrier posted a topic in AutoLISP, Visual LISP & DCL
I need a lisp routing which does the following: -Pick a point -Draw a leader to a 2nd point -Draw a rectangle or preferable a box with rounded ends in which I can insert text -Maximum of 15 characters (based on current text settings) -Leader will go any direction depending on 2nd point, but text is always same orientation -Do a WIPEOUT behind text box It would also be nice if the text is editable. Allen Brier-
- tag
- lisp routines
-
(and 1 more)
Tagged with:
-
Changing an attrtibute tag definition without BATTMAN.
bustr posted a topic in The CUI, Hatches, Linetypes, Scripts & Macros
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. -
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?