AutoCAD .NET :: Change Block Attribute

Apr 20, 2011

How to access the BTR, read and write BRef, attDef, AttRef etc. But this has me stumped. There are a few different examples  but can’t find anything that works and don't know why.

I have inserted a block in modelspace, I have the BlockRefID and now want to change its attribute values. This finds the attributes tags but doesn’t write the sValue. Why it isn’t writing the value to the block.

Public Sub ChangeAttributeValue(ByVal BlockRefID As ObjectId, ByVal sTagName As String, ByVal sValue As String)

Dim doc As Document = Application.DocumentManager.MdiActiveDocument
Dim db As Database = doc.Database
Dim tr As Transaction = db.TransactionManager.StartTransaction()
Dim br As BlockReference = DirectCast(tr.GetObject(BlockRefID, OpenMode.ForWrite), BlockReference)
[code]........       

View 7 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Check Block Attribute Then Change Different Attribute In Block

Aug 31, 2012

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")

[Code].....

View 1 Replies View Related

AutoCAD 2010 :: Change An Attribute From A Value From Another Attribute In The Same Block

Oct 5, 2012

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.

View 2 Replies View Related

AutoCAD 2010 :: Change Block Attribute And Apply That Change To Multiples?

Aug 14, 2012

i have tons of column tags but wants to change the distance between column size and the circle and make the font smaller. I can do this individually but can't do one by one..... is there any way i can adjust all by one command or one magic touch?

View 3 Replies View Related

AutoCAD .NET :: Change Block Reference Attribute

Mar 7, 2010

I have an issue regarding nested entity.

I have a nested entity block reference. In this entity I have three blocks. if I change any of the block reference attribute definition in the nested block reference then it is changing the original block itself.

Actually I am getting the handle of the selected block reference in the nested Entity. and change the attribute reference later. but it is making change in the block itself and other block reference too.

Here is my

static public void CONTACTS()
{
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
string contactName = string.Empty;//to hold contact name, from xdata
[code].......

View 3 Replies View Related

AutoCAD VB :: Change Block Attribute Default Value

Feb 15, 2012

I have a problem: There are a lot blocks in my DWG with 3-5 Attributes. I change the Values of the attributes in the .Text String but they aren't set as default values of the block attribute. Now i want to set the actual value as default / initialize value of the attribute without entering every time in the block editor

with the following code its possible to change the text string. I can set the attribut.textstring as default value?

Public Sub changedefault()
Count = ThisDrawing.ActiveLayout.Block.Count
For Index = 0 To Count - 1
Blockstring = ThisDrawing.ActiveLayout.Block(Index).ObjectName
[code]......

View 2 Replies View Related

AutoCAD .NET :: Change Attribute Color / Layer Per One Block Only

Jun 19, 2013

I've read this post:

[URL]

Everything works fine, but I have one problem.

I just want to change colors for all objects in current model space. But this command also changes attributes/blocks definitions (I mean, any new block which I insert has the color that I specified previous).

Where I have to change the code?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Block Layers Based On Attribute Name Tags

Oct 11, 2011

What I am trying to do is grab the value of the owner tag (of which there are four), and use that value to determine which layer to place it on.  What it seems to be doing is hanging.

Here is what I have so far:

(setq SSBlks (ssget "x"'((0 . "*INSERT"))))
(while (/= (sslength SSBlks) 0)
(setq w(sslength SSBlks) V 0)
(setq attentity (ssname SSBlks 0))
(setq attname (entget attentity))
(setq cntr 0)
(while (< V cntr)

[Code] ......

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Transfer Attribute Block Values To Another Attribute Blocks

Jul 3, 2012

I wanna transfer my attribute block values to another attribute text blocks , is there any lisp for that?

Is there a possibility for sum tag values of choice attribute blocks to inside of another attribute text block ?

View 2 Replies View Related

AutoCAD 2010 :: Can't Change Attribute Value In Enhanced Attribute Editor

Dec 21, 2012

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.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change A Specific Attribute From Specific Block To Specific Value

Dec 7, 2011

I've had a simple lisp I've been using for years that suddenly disappeared.  It required that you identify a block name, tag name, and the value that you want the tag to be.  All of this is performed via command line, so it is scriptable.  Since I lost it, I've been experimenting with -attedit.  This command comes frustratingly close to what I'm looking for, except it only appends an existing tag, or replaces a specific string within the tag; I can't get it to replace the entire tag, regardless of its value.

1> Any lisp routine that does what I describe?
or
2> How to make -attedit replace a tag value without regard to what the value currently is (like a * wildcard)?

View 9 Replies View Related

AutoCAD 2010 :: Inserting New Block And Entering Attribute Data By Selecting Another Block?

Aug 13, 2012

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.

View 5 Replies View Related

AutoCad :: Attribute In Title Block Exists In Block Editor But Not In Project

Sep 6, 2012

Autocad 2011, Electrical package,

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.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Match Multiple Attribute Values From One Block To Another Block

Feb 12, 2012

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).

View 3 Replies View Related

AutoCAD Civil 3D :: Transferring One Block Text Attribute To Another Block?

Nov 8, 2013

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.

AutoCAD Civil 3D 2012 SP4
Windows 7 (64)

View 6 Replies View Related

AutoCAD 2013 :: Importing Attribute Data From A Block Into Another Block?

May 30, 2013

I have 2 drawings with the following content :

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.

View 2 Replies View Related

AutoCAD Inventor :: Block Attribute In Part Sketch Block

Feb 28, 2012

Is it possible to create a text block attribute in part sketch mode?

View 2 Replies View Related

AutoCad :: Creating A Block With Block Attribute?

Jun 10, 2013

I'm creating a block with a block attribute.

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.

View 9 Replies View Related

AutoCAD .NET :: Get Attribute From A Block

Feb 2, 2012

I need to open a drawing and read the block attributes and find a block with name "ABC" and attribute named "Text" in "ABC" block. for which i am using the below code which is working perfectly.

Try AcadApp = GetObject(, "AutoCAD.Application") Catch ex As Exception AcadApp = CreateObject("AutoCAD.Application") End Try AcadApp.Visible = True Try AcadDoc = AcadApp.Documents.Open(DWGName, True) RichTextBox1.AppendText(" - Opened File Successfully" & vbCrLf) Me.Refresh() Catch ex As Exception RichTextBox1.AppendText(" - Can not Open this Drawing" & vbCrLf) Me.Refresh() Exit Function End Try Dim Obj As Object For Each Obj In AcadDoc.ModelSpace If Obj.ObjectName = "AcDbBlockReference" Then RibbonLabel1.Text = "Find Block: " & Obj.Name Me.Refresh() ' Check for attributes. If Obj.HasAttributes Then Dim AttList As Object Me.Refresh() If Obj.Name.ToString.ToLower = "abc" Then ' Build a list of attributes for the current block. AttList = Obj.GetAttributes ' Cycle throught the list of attributes. For _i = LBound(AttList) To UBound(AttList) ' Check for the correct attribute tag. If AttList(_i).TagString = "Text" Then return AttList(_i).TextString.ToString End If Me.Refresh() End If Next End If End If End If Next Obj

 But i want to know whether is there any way to get the block named "ABC" directly without looping through all the objects.

View 2 Replies View Related

AutoCAD Map 3D :: Block Content Many Attribute?

Feb 21, 2012

I have a block content many attribute.  When I'm create the block whit this many attribute, the order of this attribute is not properly.  I know autocad have a command to class this many attribute in order but i search it and i don't know where is it.

View 1 Replies View Related

AutoCAD .NET :: Attribute Collection From A Non-placed Block

Apr 19, 2011

I need to get the Attribute Collection of a named block which is not been placed in the drawing, but it does exist

Dim paaltype As String
Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim acCurDb As Database = acDoc.Database
Dim acDocEd As Editor = acDoc.Editor

Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()
paaltype = "paal01"
Dim acBlkTbl As BlockTable
acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead)
If acBlkTbl.Has(paaltype) Then
‘block exist, how to get the attributecollection
End If
acTrans.Dispose()
End Using

View 2 Replies View Related

AutoCAD .NET :: Attribute To Move To Block Without Old ATT?

Sep 10, 2012

How can I add an attribute to a block without the other attributes to move from their position. With the ATTSYNC belongs unfortunately not because the old attributes moved back to the original places that I will not.

View 9 Replies View Related

AutoCAD .NET :: Append Attribute To Block

May 9, 2011

I wan't to append a new attribute to a new block. But I get an error that there is no database. The loaded file has no attributes

Dim mDialog As New frmPaalDefinitie()
For Each item In lvPalen.Items
mDialog.tsPaal.Items(item.imageindex).enabled = False
Next
mDialog.ShowDialog()
If mDialog.DialogResult <> Windows.Forms.DialogResult.OK Then Exit Sub

[Code] ........

View 4 Replies View Related

AutoCAD .NET :: Get Specified Attribute From Block Without Loop

Aug 9, 2012

I know how to get/set attribute within loop at block's AttributeCollection.But I'm wonder if I can set value for specified attribute without loop. Or I always have to iterate on each attribute in block's AttributeCollection?

View 9 Replies View Related

AutoCAD LT :: Block Attribute Crashes Mac Pro 3 / 1

Jan 8, 2014

Im running AC LT 2012 version #F.51.M.310 on a Mac Pro 3,1 and a MacBook Pro 6,2.  The Mac Pro 3,1 is not a supported machine.  I have no issues on the MBP 6,2.

It seems to run fine on the MP 3,1 except one very important issue.  When I open a block attribute editor Dialogue then cancel or save, it crashes AutoCAD.  If I use the Property Inspector instead it is fine.  Double clicking a block to edit its text attributes is a VERY hard habit to break.

Mac tends to fix things through updates in the App Store.

Is this the most up to date AC LT 2012? I have yet to find that version # listed anywhere.  Is this an issue of just being an unsupported machine?  I have been searching for weeks to resolve/identify this problem to no avail.

View 2 Replies View Related

AutoCAD .NET :: Get Specified Attribute From External Block

Mar 21, 2013

How to get attributes from block located at external drawing?

View 2 Replies View Related

AutoCad :: Create Block With One Attribute Value

Oct 27, 2012

I'm drawing a block library for myself. I would like to create block with one attribute value who will be repeated few time in the block (in mtext or attribute). As example, here is the original block (I wrote only the text of the block):

Ix.0
Ix.1
Ix.2

where x is a variable e.g. attribute

Then when I insert the block, attribute ask for value. Then if I type 2 I want to have
I2.0
I2.1
I2.2

If I type 3:
I3.0
I3.1
I3.2

View 0 Replies View Related

AutoCad 2D :: Convert A Block To Attribute

Jul 18, 2011

It is possible to convert a block like below straight into an attribute without actually creating the attribute manually?

View 7 Replies View Related

AutoCad :: Block Attribute Calculation

Oct 2, 2013

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.

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!

View 5 Replies View Related

AutoCAD .NET :: Select Block Reference By Attribute Value

Nov 29, 2012

I have a drawing with many block references on it and they have some attributes.

I know how to find the block reference witch the attribute value, and even change it but I don't know how to select it once I have the object ID of the block.

How can I do the selection without asking the user to select it?

View 6 Replies View Related

AutoCAD 2010 :: Attribute Text Twice In A Block?

Apr 27, 2012

I need to create blocks in which the same text appears twice.  I've created an invisible attribute to hold the text and created two mtext object containing fields that point to the attribute value.

The text fields show the default value of my attribute but will not change when the attribute is set on an placed instance.  After setting the attribute on an instance I've tried UPDATEFIELD and REGEN but still I see the default value.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved