AutoCAD VB :: Delete Blocks With Specific Names In Multi Layout Drawing
Apr 25, 2011
In autocad 2011 ... I am looking for some sample code to delete all blocks with specific names in a multi layout drawing. There may be multiple blocks with the same name.
This is what I have so far ... this code collects the objects and loops through the layouts and the blocks ... if it finds the text "REVBLK" in the block name ... I want it to delete the block ... it does delete some of them but not all of the blocks ...
Dim E1 As Object
Dim ATS As Variant
Dim EA As AcadAttributeReference
Dim objLayouts As AcadLayouts
Dim LayerNextNo As Integer
Set objLayouts = ThisDrawing.Layouts
LayerNextNo = ThisDrawing.ActiveLayout.TabOrder
I have the same block repeated multiple times in a drawing, and I want to delete the last attribute in all of the specific blocks. When I edit the block in block editor, the attributes do not show up. After I explode the block, there is no text. The attached image shows the properties of the block.
my plot file names don't include the drawing name, only the layout name. it used to include the drawing name. i must have changed something but i don't what.
Dell Studio XPS 9100 Intel Core i7 CPU 930 @ 2.8GHz 12GB Ram 64 bit C3D 2012 SP3.0
How to select or delete the unwanted switches in my layout drawing ? I can select it ... may i know what layer is that and it doesn't appear in my model drawing...
We have a new title block which now contains various fields to automatically populate the drawing number, number of sheets, issue etc. The problem we have is when we go to zoom all or extents on a layout tab it moves the layout to the right each time. If we only have one layout or we use a plain title block i.e. with no fields, the zoom works fine (layout stays put in the center). This is also true if we directly insert a field onto the layout - again no problems.
The cause of the problem only happens when a block containing a field is inserted onto the paper space of a layout and,there are multiple layouts containing blocks with fields.
When I create drawings, I generally have quite a few layout tabs. Also, thse tabs are numbered 1 through to N. On many occasions, a revision or addition may be necessary and it may have to be inserted in between two existing tabs. Doing so is not a problem, however, keeping the numbering sequence in order without having to rename every tab in that file is a problem.
When I manually add a new layout from a template, I do NOT get any extra layers, but when I use VB to do the same thing, I get extra layers.
In the original drawing, I have layers called "SHEET", "TEXT", and "VIEWPORT" (among other layers).
In the template where I get my new layout, I also have the same layer names ("SHEET", "TEXT", and "VIEWPORT").
After the new layout gets read in, I now have extra layers called "$0$SHEET", "$0$TEXT", and "$0$VIEWPORT". Why does this happen using VB, but not when I do it manually? Is there anything I can do to the code to change this? I understand the layer names are the same, but they're the same whether I do it manually or by code.
Public Function importLayout(ByVal templateFileName As String, ByVal templateLayoutName As String) As ObjectId Dim idLayout As ObjectId = ObjectId.Null Dim doc As Document = Application.DocumentManager.MdiActiveDocument Dim ed As Editor = doc.Editor Dim oLock As DocumentLock = doc.LockDocument() Dim
Our configuration management tool requires a DWG for our system assembly drawings. A single DWG with all the sheets layed out in a sheet space. Right now I do a "Save As" out of inventor and it creates X number of seperate DWG files and then I stitch them together in AutoCAD by taking each sheet and placing them into a single sheet space (copy paste). My work flow would be much faster if I could get Inventor to create a single sheet space with all the active or selected sheets as a single DWG output.
I've been given about 14 DWGs from another company all on different discs. Each DWG is a page to a set of Shop Drawings. All objects are in model space. I want to combine all of them into one drawing but every drawing has similar block names with different objects associated with the block and when I copy the objects from one drawing to antoher, the blocks morph into the exisiting block, if that makes sense. Just a poor initial set up.
Anyway, the solution to this, I have found, is to rename the blocks in each drawing to have room numbers on the ends, giving them unique names and avoiding the "morph" upon inserting. I have about 15 blocks per drawings to add -XX with XX being 01-14. Is there an easy way to modify them or do I need to do the RENAME command as many times as needed in each drawing?
I have a big complicated mesh surface and under every mesh edge there is a line (I have imported it from another software). Now I want to delete lines but I cant select them one by one because it take too long.
I have a drawing done by a colleague. The problem is the blocks not shown in multi view.... I checked the layers and isolation but i cant find the solution.
I recently updated our CAD Library to dynamic blocks. In the process of updating our drawings, we realized that we could not use BLOCKREPLACE to replace dynamic blocks with another dynamic block (with new name) once the dynamic element has been changed. I realize that this changes the state of the block and anonymous block names are created.
I need a simple solution so that members of my group can easily replace dynamic blocks with new dynamic blocks.
A way to create a windows shortcut to a drawing that opens a specific Paperspace Layout?
For example, I have a drawing located in a Windows folder called 'Appraisal Maps', the drawing contains 2 paperspace layouts, one of which is named Show Me Stakes. I would like to have a Windows shortcut of the drawing inside of a Windows folder called 'Staking-Show Me', so that when I double click the drawing it will open up and automatically switch to the proper paperspace layout.
I am wanting this for two reason, 1) so that we do not create multiple drawings and actually use the power of autocad layout tabs and layer management. 2) so that when management opens up the drawing it goes directly to the proper layout minimizing their head scratching as to what is going on.
I am having a little trouble with gps coordinates. I am trying to snap to a specific gps coordinate on my layout. I have a "gps block" that spits out the proper coordinates but i am not sure how to move to a specif point. My layout is set up such that when i use my "gps block" on a known point it spits out the northing and easting, however, when i try to actually type in a specif northing and easting, it is no where near the point i am looking for on the layout.
Looking for a method of selecting multiple blocks that have been arrayed within a drawing. I have tired with filter and qselect however there is no way to filter out blocks by name contained within an aray. Would be great if there was a .lsp routine or arx file that could deal with this.
Autodesk Inventor Professional 2013 SP2 64-Bit Edition Windows 7 HP Z400, Intel Xeon W3550 3.07GHz 12.0GB RAM, ATI FirePro V4800 (FireGL)
I have a Room Tag (multi-view block) that was created in a previous release of AutoCAD Architecture that is not coming in at the correct scale in AutoCAD Architecture 2011. When we used to insert this block into an 1/8"=1'-0" drawing, it came in at a scale of 12.0,12.0,12.0. Now when we insert it into a 1/8"=1'-0" drawing, it comes in at 9.0,9.0,9.0. So, at 1/4"=1'-0" it comes in at 4.5,4.5,4.5; when it should be 6.0,6.0,6.0. I have many custom blocks that we have created for door tags, section refs, etc. and would just like to know what scale factor needs to be adjusted to fix this small issue.
I have one drawing, which has 79 layouts itself. I want to delete some same objects for all layout. Is there any command to edit all layout at one time.
is there an way to display attribute data using a multi-leader inside a single dynamic block.
To elaborate, I'm trying to create a borehole dynamic block that I can enter the ground level and end of borehole level as attributes, and have them show up in a multi-leader. The reason for the multi-leader is that I can add a background mask to it and it automatically adjusts the length of the outline obox around it.
I just want to insert the borehole block from a tool palette, enter a couple of attributes, stretch the bottom down to whatever level, and I'm done.
I've been playing with it all weekend trying to get fields to show the attributes and I can get it to work if I use another block for the levels (multi-leaders), but even then I have to into the fields an mess with them. It's go to be east so my CAD guys can do it without slowing down, otherwise they may as well carry writing everything out long-hand as they do now.
I have 200+ page drawings and need to open each dwg to erase same block and text strings. Any way to batch erase same blocks and strings in multi-pages?
How do I manipulate a height parameter all of the dynamic blocks in the drawing from one single field? Say a field located in the drawing properties or on the drawing itself.
For example: Multiple blocks of different walls of same height with other blocks of things on located on those walls, dependant on the wall height, all linked to and changed by a single field. Possibly a Wall Height field located in the custom tab of the drawing properties.
I can pickout each of the blocks and change them at the same time in properites menu because they all share the same parameter name. I would just like to have that height parameter of every block in the drawing, that has that specific parameter controled by a single field. Which I could enter a new height at anytime that would change every block in the drawing to that height.
I need a way to count furniture blocks that are located in specific ROOMS. More specifically, I'm looking for a way to select MULTIPLE different blocks at once (with a WINDOW selection) and label them a specific room number. I don't want every block with the same properties universally updated (since some will be in other rooms). I also don't want to have to select each block in every room and update its attributes manually (this would both take a long time and things may be re-located over time).
I would like to be able to print a report and compare it to our Microsoft Access database. I know there are other furniture-CAD programs that will do this, but is AutoCAD capable of doing this on its own? I have millions of square feet to check furniture for and this would save me days- if not weeks of time!