AutoCAD .NET :: Populate List Of Block Names - How To Edit Attributes
Mar 10, 2012
my job is to make an editor for blocks in C#. There should be a WPF-window were the user can see a list of blocks. He selects one and than he should see an overview about block attributes like insertionpoint, basepoint, rotation and scaling and he should be able to edit these attributes in this form.
I know how i can populate a list of block names, but I fail at finding an opportunity to edit these attributes.
I have one drawing with several thousand instances of the same block in it. Each block has a 'name' attribute. I want to populate those block attributes with a spreadsheet. What is the best way in AutoCAD 2013 to do that?
Ideas: the old ATTOUT, ATTIN commands from Express Tools....rather a dated method, but it might work
dbConnect: I've never used it, but might work.
Data Extraction Wizard: I think is just for data extraction from a drawing, but again not sure.
I want to make a price list, using attributes in block and then extracting them to cell matching some cells with excel
While in data extr wizard for some reason I cant get the size column to set in ascending order.. Why does size 10 brake the logic?
Can I edit the extracted data without launching data extr wizard?
Data extr wizard brings a data in one table what if I want the table to display other types of attribute ( example see pic for instance instead of EL i have SS no problem until now, but my matched data link in excel is for EL and not for SS)
Its hard to explain Basicly i selected the column in excel for one type of attribute "EL" and I want fo a different name of same attribute different cell matching.
I am inserting a block (strSectionBlk) into an AutoCAD 13 drawing using VB .NET. This block has an attribute with tag "FAB_HEIGHT" and I want to edit its string to the value of a variable "strFabHeight" at the time of the insertion of the block. The insertion of the block is fine but I've failed to edit the attibute.
Public Sub InsertSection() 'Call the Function that decides the name of the head section block strSectionBlk getSectionDwg(strModel, strHeadType) 'Start the database Dim db As Database [code]....
I am inserting a block that has one attribute with tag "FAB_HEIGHT". I have not been successful in editing this attribute.
Public Sub InsertSection() 'Call the Function that returns strSectionBlk (the Head Section drawing) getSectionDwg(strModel, strHeadType) 'Start the database Dim db As Database db = HostApplicationServices.WorkingDatabase() [Code] .....
I cannot edit any block attributes in my drawing. When attempting to do so, the command line states: "The object is on a locked layer". All of the layers in my drawing are unlocked, on and not frozen.
I have been using blocks for P&ID's for about 3 months now, and had no issues. But for some reason when insert a block now the attributes window does'nt pop up, so i can't edit the text ? The only way i have been able to get round this, is by using property inspector to edit the text
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?
I am trying to generate a plant list or plant legend in autocad 2004. I have block references that I have created that have block attributes such as qty, plant name and size. I know in other software drafting you can generate a plant list or parts list, but can't find the method in autocad either in help option or in my autocad book.
In the parent assembly a text iproperty exists called "child list". I would like to set this value via an ilogic rule that does the following:
For each child in the assembly where paremeter "include" = true, add the value of iproperty "filename" to a comma delimited list that will become the value of text Iproperty "child list" in the parent assembly.
The result should look something Like iproperty"child" = "filename1,filename2,filename3,filename4, etc..."
The rule must iterrogate all children, both parts and assemblies, and must go beyond 1st level children.
The output does not have to be comma delimited but must be delimited with something (eg tab, :, etc..)
The number of children is unknown
Is there a character limit imposed on a text iproperty?
Long short, we have dozens of drawings and the original base view was deleted, so the title block uses the next view placed to populate. We would like to drop in a new view, and use that as the view the title block looks to. The only way we've figured how to do this is to delete the other 8 or so views (that are already all detailed)., place the view we want to populate the title block, then redraw all the views we just deleted.
Is there an easier way to chose a new base/primary view for a drawing?
I am working on some office templates and I am unable to change some of the original attributes names. I have googled and read some articles on the autodesk site and have not figured it out as of yet. I am using autocad 2012. I have inserted a jpeg file for you to see. The names in the TAG row are what im trying to modify.
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]........
I am fishing around for information that will abstract my macro one more level. I coded an excel macro to run the following statement on a given set of drawings:
Yielding text files which I consolidate into Excel to generate a full attribute extraction of the drawing set. My question concerns the extraction template file used in the ATTEXT command (shown as ExtTemplate in the code above). As it stands now, the Excel user must provide the attribute tags they want to extract and then I generate the proper extraction template in the background. My goal would be to eliminate this step from the user side and simply extract all attributes in the drawing instead of a designated few.
If you know a better way to do this using the ATTEXT command or a way to do this without the ATTEXT command at all, I would be grateful to hear it. From my current perspective however, I believe I would need to query the drawing to get a list of all attribute tags it contains, then configure the extraction template to use all the tags from that query. I cannot figure out a way to generate this list of tags. So, that is my question
I have a drawing (let's call it "main.dwg") with an external reference (let's call it "file.dwg") as the bulk of its content. The drawing "main.dwg" has 16 layout tabs, each with several mview windows.
Needing to make some changes to "main.dwg" for the first time in a couple months, I just opened it and was having issues with freezing out layers in the mview windows. It turns out that "file.dwg" appears twice in the xref list under two different names (let's say "File 1" and "File 2") with the same target path.
Besides the disorganization created by the double xref, it makes freezing layers in the mview windows twice as complicated, since each layer now appears twice in the layers list. For example, since layer 0 appears in "file.dwg", "main.dwg" contains the layers "File 1|0" and "File 2|0".
Detaching "File 2" in the xref list removes both references. Retargeting "File 2" to a different file retargets both references. Detaching both and reinserting the xref resets the layer freeze settings in every mview window, making every layer visible again.
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'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 am trying to export attributes from an autocad file using LIST and I keep running into trouble with the file cutting out data. I am wondering if there is a way to print the LIST file that AutoCAD creates to a text file so that I can get all of the data in one go instead of having to repeatedly "Press ENTER to continue:"
I am learning autolips and i found a problem that i can´t solved.
(vl-load-com)(defun c:pmb ( / ss ent pt )(prompt " selec block : ")(setq ss (ssget '((0 . "INSERT")))) (setq ent (ssname ss 0)), (setq pt (cdr (assoc 10 (entget ent)))) (command "point" pt)) wich this code you select one block and insert one point at insert point´s block.
which this other code yo select all block and insert all point.... but in one block
I have a text file with a list of image tile names with their bottom left hand easting and northing see attached. I have a lisp that asks for the name of the image then should insert the image at its coordinate with a predefined scale and rotation but it isn't working so I would like an alternative method to test.
I have a drawing with a bunch of blocks. the blocks repeat themselves, but I need to define different attributes to each one of them and then being able to extraxt a list that I can read in excel.
I'd like to get rid of all AEC block names in my template. I've tried BLDSYSPURGE and that didn't work. We don't currently use ACAD MEP for it's intended purpose so I just want these out of the block name list in our template for now. Is there a way to do so?