AutoCad 2D :: Copying Attribute Values To Another Attribute?
Jun 15, 2013
I want to copy attribute values. I'm making a catalogue of all the reinforcements in my drawing so I need to name those reinforcements. So what I want is to make a string of text that I don't need to totally modify everytime. Something like this:
Amount of reinforcement bars - 5
Diameter of the reinforcement - 12
Division of reinforcing bars - 100
Reinforcement bars: 5-T12-k100
So the only attributes I'd edit would be the first three not the last one. So how can this be accomplished?
I have an attribute blocks and this att block has two tag values , is there a simple code for to change 1st tag values automaticly according to 2nd values ?
for example :
1st tag (50x50) - 2nd tag ( 100 ) ==> 50x50-100
if i enter 201 valuse to 2nd tag then 1 st tag has to change as 100x100
if i enter 501 valuse to 2nd tag then 1 st tag has to change as 150x510
I'm trying to write some code that adds values to attributes of a specified block. I'm able to search for the block, but I'm having trouble editing it.
Dim acDoc AsDocument = Application.DocumentManager.MdiActiveDocument Dim acCurDb AsDatabase = acDoc.Database Dim acTransMgr As Autodesk.AutoCAD.DatabaseServices.TransactionManager= acCurDb.TransactionManager
Using acTrans1 AsTransaction= acTransMgr.StartTransaction Dim acBlkTbl AsBlockTable = acTrans1.GetObject(acCurDb.BlockTableId, OpenMode.ForRead) If acBlkTbl.Has("blockname") Then
*** here I need to get the object found in the active block table and edit it's attributes by attribute name **** End If End Using
I am using AutoCad LT 2013 and I am looking to extract at the Wire#, the To_Device and the From_Device. I really dont care about the block name but if I have to have it fine with me. I have tried to follow the extraction file within AutoCad LT but havent been able to figure it out.
Using C# (VS2010, Acad2012) i've created a block, imported it, given it the required attibute tags and values, and then created an array out of this block for a total of "x" identical blocks for our purposes. As these blocks are desigend to represent real-world products, is there any way that one of my attribute values can reflect a hyperlink to the manufacturers datasheet?
So essentially
Product Info [URL] ....
Also, one of my functions lists all of the blocks in the current drawing and tallys them up and drops them into a table where it reports the block name, details, and quantity. I would also like this block name to be a hyperlink as well...is this doable?
I am utilizing the ESRI ArcGIS for AutoCAD plugin to edit feature attributes in AutoCAD Map 3D 2009.
Is there a way to control/restrict available attribute values, similar to a Domain in an ArcGIS Geodatabase?
The .dwg I'm editing was created from a personal Geodatabase by using the 'Export to CAD' tool in ArcGIS 9.3.1 basesd on SDSFIE schema, so maintaining consistent attribute values is imperative.
Is there a way to have attributes automatically update? For example, we often "save block as" from block editor to create a new block. We usually have block name on defpoints layer so designers can see block name on screen.
We now have to edit this text each time new block is created from existing block. If default value of attribute could be the block name it would save time and errors.
Say I have a block that contains two attributes, one contains a value that is a number and another contains a value that is letters. I have many of these blocks placed in a drawing, could you create a lisp that would return the sum of the number value and return it to the command line along with the letter value. Something like this:
Is it possible to have 4 attributes in a block match or equal each other? I would like to make it so if I edit an attribute the other 3 attribute contents will update to be the same.
How to get attribute values to match in the same block? In my titleblock have the clients name displayed a couple of time in the block. I want to be able to change the clients name in one spot and have it change in the other. I have tried to use fields but the field will only display the default value of the attribute.
I have a attributed block with multiple attributes (called pkey). In some cases these block attributes will the same values save for one, "Total".
example:
pkey #1 Value AA, Value BB, Value CC, Total 20
pkey #2 Value AA, Value BB, Value CC, Total 30
Is there a way by which I can have AutoCad group these blocks together (when extracted into a table for example) and have the SUM of those "Totals" added together to produce a result such as:
Value AA, Value BB, Value CC, Total 50.
I've explored using fields, but I don't think they work in this case, unless I'm using them wrong.
How to avoid the conflict between the “attribute” values?
I wanted to label the points (stored in txt file) using the lisp file ascpoint.lsp; This requires to build a block with 4 attribute values,But how to ensure that there is no conflict between the labels of the coordinates represented in the 4 attributes? They may overlap depending on the number of characters of the value of each attribute (coordinate).
The 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?
Any routine where I could keep picking on my exit arrow blocks (showing how many persons exiting from each space) one-by-one and the program would add up the numbers. For example I pick on blocks with numbers of 2, 4 & 3 and I would get 9.
In VBA, how can I batch convert field attributes in blocks to text attributes while retaining the blocks? Is there a simple way to univerally convert them all at onceusing VBA? The plotted values for the fields must be retained, too.
Explode will not retain the value of the field.
Burst will not work as it explodes the blocks as well.
You can right-click on the field and slelct "Convert to text" from the RCM. So I know that the process exists within CAD, just need to batch the process for a quantity of DWGs at a time - in VBA.
Background: Someone exploded an attribute block and copied it hundreds of times throughout a project, each time changing the Attribute Tag to match the Value they expected to appear in their drawing. The drawing must be xrefed, so the attribute definitions do not appear.
(There is only 1 attribute in the block.)
Proposed Solutions:
1:AutoLISP routine which copies Tag data from Attribute Definition into Value of Attribute Block:
Prompt-Select Attribute Definition
Copy Tag data
Prompt-Select Attribute Block
Paste data into Value
(Allow repeat to speed workflow)(*PREFERRED*)
2:AutoLISP routine which copies Tag data from Attribute Definition into Default Value and creates a new Block:
Prompt-Select Attribute Definition
Copy Tag data
Paste data into Default Value
Create New Block
(Select Multiple Objects)(Creates tons of new blocks which are messy)
I am using M Text Attributes to store imperial lengths in the drawing, feet inches and fractions (stacked). When I read back the Text String property which, is the M text Attribute.Contents parsed, I am having problems because the parser does not add a space between the inch and the fraction. So, is there any setting that could be used to tell the parser to add the space between the inch and the fraction?
creating a block with attributes. I did manage to get my block set up and inserted in a dwg, but I am unable to change the "value" of any attribute. Unless I click on the "..." button next to the value field.
I have a block named "WIDGET-A". And in that block are (4) attribute tags whose names are:
"ID" "TAG01" "TAG02" "TAG03"
The user will be prompted to pick the value displayed at any of the "TAG##" attributes - they will select the attribute tag they want (we don't know which one it is, we just want to assign that value of the attribute tag they clicked on to a variable called "VAR2".
Now, what we also want AutoCAD to evaluate, behind the scenes, is the value of the attribute tag named "ID" which we know always exists in the block and then assign that value to a variable called "VAR1".
Is there a way for AutoCAD to do this all from only a single user pick on top of an attribute value, in a block whose name isn't always going to be 'WIDGET-A' either.... But the block, whatever it's name, will always have the attribute tag "ID" with a value in it, and we always want to capture the value of whatever attribute tag within the block that the user clicked on.
This time I'm wrestling with getting the values from multiple blocks. The blocks all have the same name but at least the attributes have names this time. Each block have exactly 4 attributes, like: att1 (a number representing chronological order), att2 (some data), att3 (the actual date as a string of when the data was added), att4 (some more data)
I need to get and store the attribute's values. I was hoping to make a selectionset of the blocks and step through using the chronological order number.
At this point I have tried several combinations of foreach and ssget "x" (list (cons 2 MYBLOCK)), but I keep getting errors that I'm sure are telling me that I'm not passing the correct information to the function for iterating through. I'm banging my head.
I need a lisp sub-function that can empty all attributes of a specified dynamic block. The idea being that the specified block contains data that changes often and in order to repopulate the block's attributes with new data to replace the old I wish to just blank out the old data first, because it's possible that the new data may not utilize as many attributes and all of the old data must be removed.
The thing is the block I'm after is on several layouts, CTABs and they all need to be wiped clean.
We have generic drawings of assemblies we use in layout drawings as standard details. We insert them as blocks with one or two dimensions that vary (geometry remains the same-these are just representative for information).
We could define these as attribute values so that a user types a length that displays in the drawing but if we wish this to be part of a dimension we would have to explode the dimension to manually replace the mtext dim value with an attribute tag.
This seems unsubtle so I edited the dim value to be a field referencing the attribute value and made the tag invisible. This worked in the drawing-the attached shows the attribute tag ALL THREAD and the resultant dimension text (as a field value) replaced with the default value LENGTH.
When the drawing is inserted as a block it duly prompts for a value for ALLTHREAD and any value can be typed-`1200, 3500, 1672 etc. but the dimension does not update from the default value LENGTH, even after using attsync, regenall. So, if the drawing recognizes the attribute then how come it cant recognize the graphic via a field reference and update it? Is it buried too deep in the database hierarchy for LT to make sense of it maybe?
I dont want to explode the dim but it looks like I may have too if this cannot be made to work.
How to connect to MySQL database and insert data from a set of blocks containing attributes?
Something like:
block 1:
- x coordinate; - y coordinate; - handle;
block 2:
- x coordinate; - y coordinate; - handle;
block 3:
- x coordinate; - y coordinate; - handle;
I've just got the second part (retrieving info from the blocks), but when it comes to connect to the DB I'm completely lost.
For the DB I'm using XAMP for Windows, thus using localhost, user ('user123'), pass ('pass123') and table ('table123'). The table has ID (PriKey and AutoInc), px, py and hdl fields.
I have only one user with this problem. He tries to edit an attribute block and when he selects one of the values and erases it the default value doesn't erase. He then has to enter some text and erase that and it works.
What I really want to do is on our fire alarm blocks we have 3 different attributes one for the address, the candela and one for misc info. I want to make an attribute that takes the number from the candela (15,30,75or 110) and change a different attribute to a value depending on which candela we use (such as 15=.078, 30=.113, 75=.195 or 110=.259). But I don't want the .078,.113,.195,.259 to print out on paper, I want to export block information excel file so I can add up all values.
There is a BLOCKA that I'd like to extract its attributes - Tag and Color - into an external format (excel). There after, I'd like to import it into the drawing and based on its color attribute value, change the value to that color in the drawing.
How can specific attribute values be extracted from a drawing and assigned to a variable in lisp.
The existing title block is having attributes : Area, Sub area, Description, Drawing type. I want to extract this values and assign it to some variable which I have already listed and then it shall be assigned to some other attributes in the same drawing with Area1, Subarea1, Description1, Drawing type1... and so on.. Both the attributes shall be in the same drawing file.