AutoCad :: An Attribute That Is Multiplication Of Two Other Attributes Within Same Block
Oct 21, 2010
I have a block with several attributes. One of the attributes is the result of mulitplying two or more of the other attributes together. I want this to be calculated automatically everytime one of the attribute values changes.
They need to stay within the same block (I think) for when i extract the data to a text file.
If its not possible with attributes, will fields be any better? (I know even less about those than I do attributes!)
I made a dynamic block (REINF_ID) with attributes that i will use to determine the reinforcement of structural walls on elevations. I inserted an attribute called LIGN1 which will be visible and the other attributes such as DIA(bar diameter)-SPC(rebar spacing)-POSITION(rebar position) will be invisible.
Now, in the block editor i want to insert 3 fields in the LIGN1(visible) attribute default value that will link to other attributes in the same block. example: LIGN1 default = 25M(DIAattribute) @(text) 300(SPCattribute) EF(POSITIONattribute). When i insert my block in a dwg and i decide to modify the DIAMETER(invisible attribute) from 25M to 30M for example, I want the value in the LIGN1 attribute to update to show the new DIAMETER.
When I regen, it does not modify the attribute (LIGN1) 25M to 30M, it keeps the default value of the attribute (25M).
I wrote this little piece of code (attached) that explode all the blocks in the current drawing.This is magical, compared with what we had to do in VBA.
This works perfectly but now I want to go deeper and managed blockreferences with attributes.Based on my code, I can determine if oBTR.HasAttributeDefinitions is true or false.
If the blockreference has attributes, I suppose I will have to use Explode instead of ExplodeToOwnerSpace.
My first question is, using explode, I need before to know in which space the blockreference is inserted (Model or any layout) so to insert the exploded entities correctly. So, is it possible from a blockreference to get its own SpaceId?
An another idea I had is to edit the blockreference (not the block definition) to replace attributes with text...
I was given a customers title block but there are no defined attributes. I'm using AutoCad Electrical 2010. I have to double click on the title block and the edit block definition box pops up. I select the block to edit and click ok. I would like to use the enhanced attribute editor on these title blocks. Is there a way to define the attributes on this kind of title block using the enhanced attribute editor?
select all blocks on certain layers in a drawing, check attribute CIRCUIT in each block if it starts with MS then attribute CONTROL = switched. I hope thats clear enough the way
(defun c:control() (graphscr) (Setq sc (ssget "X" '((0 . "INSERT")
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.
Is there a way to create a block with attributtes that automatically complete x, y, z, lat, long for the insertion point of the block?
I am trying to complete text in paperspace that will automatically fill in the lat long of a point in model space without using a table. I have tried field insertion with reference to a cogo point, but it doesn't give options for position on a cogo point. If I pick a block with attributes, it will let me pick any attributes, and x,y position for the block.
Cogo points show all the information I need to propagate in the properties....but how do I get that to translate into the text using fields or some other method?
Dell Precision T3600 - Windows 7 64-bit NVIDIA Quadro 600 Intel(R) Xenon(R) CPU E5-1607 0 @ 3.00GHz 3.00GHz 8 GB ram - Two 1TB raid
I would like to change sub block from a visibility after setting it. Here an example of code to get the right visibility, I don't really know how to update a sub block by name or by handle(seems to change inside dynamic block).
Dim Block As AcadBlock Dim BlockRef As AcadBlockReference Dim DynEntBlock As AcadEntity Dim DynObjRefH As IAcadBlockReference [Code]........
Is it possible, via whatever methods (lisp?) to be able to have a premade block with an attribute and insert it into a drawing then assign a value to it by selecting another existing block in the drawing and using one of its own attribute’s values?
For example, say I have a block representing a telephone and it had an attribute called "PhoneNo" and I inserted it into a drawing showing an office floor plan that had blocks in each office space that are telephone junction boxes with attributes "PhoneExtension". I would like to be able to autocomplete the entering of the “PhoneNo” data by selecting one of the telephone junction boxes in the drawing and using its attribute’s value.
I have an existing title block a few text attributes, to which I wish to add a watermark. I have added it in the block editor as a normal attribute, with the same details as the other attributes that work, only a different tag name. It has a default value, "DRAFT" and is tagged "WMARK". It works fine in the Block Editor, and If I test the block I can edit it to display whatever I want, but if I save the block and open it from Autocad proper, the attribute is not in existence, either as a default value, or editable from block properties, attribute editor or title block editor, whereas all of the other attributes are there. I have used BattMan to verify the settings of the attribute, and the only difference is that the others all have "L" in the "Modes" column, but I think that means that their position is "locked" whereas my new attribute is justified "aligned" therefore cannot be "locked" (This is some assumption on my part, as the documentation on the "Modes" column is almost non-existent). I cannot afford to waste much more time on this issue, as the boss is breathing down my neck, but editing watermarks on every drawing after every revision is frustrating, when it could be an attribute that is editable from the title block editor.
I need to match few attribute values from one block to different block. I download a lisp file called; ca.lsp which can match the single attribute value. I modified it for more than one attribute value matching. It is ok but still wish to overcome two issues for batch prcess
1. picking up the blocks by selection
2. click the alternative block numbers of times to match the numbers of attribute values I needed.
How to modify this lisp I can run it by block name selections instead of picking selection which enable me to run batch process for numbers of drawing? That will be good...
Lisp & Demo file attached (Match attribute value, A, B & C to Attribute 1, 2 & 3).
Is there a way that I can create a block with text ('A') and when I insert the block and populate the block another block block will update also? I am wanting to create a block for x-sec flags, and detail callouts that update their detail titles.
Drawing 1 : Contains tree blocks that have a specific scale dependant on the tree size
Drawing 2 : Contains a block with just a point and attribute data about the tree (name, size etc.)
This block is approximatly at the same location as the tree block (0,1 m precision)
Problem I want to join these two items together. In other words, in the tree block that is scaled correctly i want the attribute data with the name, size etc. These blocks don't have a corresponding unique number or something like that.
I can insert a block with block attributes using the Inter op very easily:
Dim theBlock AsAcadBlockReference Dim pickScreenVBA = myDoc.Utility.GetPoint(, "insert the hydrant") theBlock = myDoc.ModelSpace.InsertBlock(pickScreenVBA, "Hydrant", 1.0#, 1.0#, 1.0#, 0) Dim varAttributes AsObject varAttributes = theBlock.GetAttributes varAttributes(0).TextString ="3 Ports" varAttributes(1).TextString ="Salt water"
Works great, but when I try using the non-inter op, all the example insert new Attributes and not add block with existing attribute (so I end up with duplicate attributes for each block - i.e "Salt water" attribute is added to the block each time I run the code),
Are they any examples that does the same as above using the non-interop code?
I'm trying to add some attributes to an existing block using the block editor, but after I save and close it I cannot see any 'placeholders' despite adding a default value and the attributes work fine when I double click the block.
I've tried using the ATTSYNC and BATTMAN commands but nothing works and there are no invisibility states applied to either the attribute or block and all layers are switched on.
I just tried making a quick block from scratch and it seems to have the same affect, except the default value will show, but no 'placeholder' shown if left blank.
I swear with previous version I could see the tag when a value hadn't been applied, so is it that the version I now use (2012) does not have this feature or it's disabled?
I am a little new to assigning attributes. My company had a block with two attributes 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: How to replicate this action? And is there a way to show all properties of a field for an attribute?
I'm trying to chnage the text of the sheet number and total sheet number attributes for each layout in my drawing. I have code that adds and deletes the specified pages, now I need to edit the attributes to reflect the correct page and correct total amount of pages. Here is my code, based on my old VBA version.
I know there is a problem with the line:
For Each item In myBTR.ObjectId
I've used a number of websites and books, but I would really like to find something that teaches about block tables, block table references, block table IDs so I can get a better understanding of breaking stuff down to get the info I need.
Public Sub updatePageNumbers() Dim myDWG As Autodesk.AutoCAD.ApplicationServices.Document Dim myDB As Autodesk.AutoCAD.DatabaseServices.Database Dim myTransManForPageNumbers As Autodesk.AutoCAD.DatabaseServices.TransactionManager Dim myTransForPageNumbers As Transaction
I have a drawing template (block) where the drawing number is displayed in two locations (attributes). The same value has to be entered in both attributes.
Is there any way of "echoing" the data from one attribute to other attributes (or text objects)?
In the blockeditor I can change the draworder so the attribute is partly under some lines. But the draworder in the blockeditor of the attribute doesn't work in the normal modelspace; the blockattribute is allways on top.
Working in Autocad 2011, PC version.My drawing has blocks that contain (1) visibible and editable attribute. Also contain (4) invisible and constant attributes. I need to update text information in the (4) invisible attributes. Using BATTMAN seemed the easiest way to do this, but when "Sync" ing the changes, the rotation angle/placement of the Visible attribute changes globally in the drawing.
(Many of the Visible attributes location were adjusted to prevent overlapping with other drawing lines.
How can I update text values of invisible attributes without rotating/adjusting the placement of my visible one?I've tried -attedit & attredef - neither of them did what I needed.
I have a block which includes some Multiple lines attributes.
Now I don't want them to be multiple lines any more.
How can I change them to single line attribute?
In the block editor, the "Multiple lines" in the properties palette is gray out. I have create single line attribute and replace the multiple line attributes one by one.
Why don't make the Multiple lines property editable? This problem is since Multiple line attribute first time introduced.
Interesting thing is single line attributes can easily changed to multiple line attributes through the properties palette!
I've got 1800 attributes that need to be numbered from 1 to 1800 from left to right.
I got a Lisp that can do that but the only thing is when I select it with selection window, he wil sort all atributes on their unique handle code. So I have the first 40 attributes going from left to right with groups of numbers at the wrong place like 1-10, 31-40, 21-30, 11-20 instead of 1-40.
This is because when you copy an attribute he wil place a new unique handle coded attribute and the copy contains the previous handle code.
But if I select them one by one from left to right and run my lisp it just works fine cause it seems it doesnt look at the handle code to place the numbers in that order.
So is there a way that I can select multiple attributes, like I'm selecting them one by one from left to right, so I can bypass this attribute handle code?
I got too smart for myself today in bringing an old drawing up to current standards...Everyone seems to want their block attributes to be zero - I have blocks where the attributes are best when they match the rotations of each blocks.
I have an old drawing that was rotated (as it should be) at approx 2deg.
I used a lisp routine to global edit all the blocks that needed to be at zero. BUT for some reason (and after hundreds of blocks were corrected), I noticed I now have two blocks that should NOT have been in the set have had their attributes rotated to zero....and the attributes should be at the same rotation as their block's rotation.
Because those two blocks have a fixed tic mark, I can click on the mark to see what the block rotation is, then rotate its attribute to that rotation, but I have hundreds of blocks! One-at-a-time sucks....
Any chance there is a GLOBAL way to edit an attribute rotation to match its own block's rotation?
Function ReadDWG(ByVal DWGName As String) Dim AcadApp As AcadApplication Dim AcadDoc As AcadDocument Dim Extracted_title As String RichTextBox1.AppendText(Path.GetFileName(DWGName)) RibbonLabel1.Text = "Opening AutoCAD"
[Code]...
I am using the above code to read block attributes depending on the name. But now I need to read the active drawing (drawing will be open and should read from the active document). In the above code I have referenced interop.dll. without that can I retrieve the block attributes. How to read the block attributes from the active document.
Using ACAD2014LT. I want to use the first variable attribute value as a variable in subsequent attributes in the same block. This will be extracted and used for tag references in a PLC program.
Along the line, i know I can change the enclosed character ( ' ), but can I remove it?
And I generated this code for read this file and insert one block with attributes for each line of text…..
If txtPath.Text() = "" Then MsgBox("Select DB .txt.", MsgBoxStyle.Exclamation) End If On Error GoTo ControlErroresBD Dim AcadDocPt As Document = [Code] ....
‘To the end of this line I can insert the block,,,,,,, but I don’t know how to write the attributes…… I tried with the next code but it doesn’t work…. My bloque has 3 attributes and every tag named with “PN”, “CD” and “CT”
Dim AcadObj As Entity For Each acObjId As ObjectId In AcadBlockRef.AttributeCollection AcadObj = AcadTransPt.GetObject(acObjId, OpenMode.ForWrite) Dim acAttDef As AttributeDefinition = TryCast(AcadObj, AttributeDefinition)