AutoCAD .NET :: How To Copy Blocks Through COM
Nov 22, 2012
I got a question about access AUTOCAD through COM.Previously I have one VB6 program, which read blocks from an external dwg files and insert into AUTOCAD2010's activepage.
Now I want to upgrade to VB.NET2010, but found one big problem cannot be resolved, that is, how to copy blocks from an external dwg files?I use the command below to copy blocks from dwg file:
Call GetBlocksFromDwg("d:abc.dwg", obj_Doc)
obj_'s definition is:
Dim obj_Doc As Autodesk.AutoCAD.Interop.AcadDocument
Previous VB6 source codes:
Private Sub GetBlocksFromDwg(DwgName As String, Target As Object)
Set DbxDoc = obj_Acad.GetInterfaceObject("ObjectDBX.AxDbDocument.18")
DbxDoc.Open DwgName
Dim Objects(0 To 0) As Object
For Each entry In DbxDoc.Blocks
[code]....
View 9 Replies
ADVERTISEMENT
Nov 22, 2012
I got a question about access AUTOCAD through COM.
Previously I have one VB6 program, which read blocks from an external dwg files and insert into AUTOCAD2010's activepage. Now I want to upgrade to VB.NET2010, but found one big problem cannot be resolved, that is, how to copy blocks from an external dwg files?
I use the command below to copy blocks from dwg file:
Call GetBlocksFromDwg("d:abc.dwg", obj_Doc)
obj_'s definition is:
Dim obj_Doc As Autodesk.AutoCAD.Interop.AcadDocument
[Code]....
View 2 Replies
View Related
Aug 21, 2008
How can I copy selected blocks with new name? or one by one but in fast way? I am doing that using BEDIT but doing one by one and talks long time.
View 9 Replies
View Related
Apr 11, 2011
I have a question. I have several 3d models i've set up with 3d blocks in each one. They're separate to cut down on drawing size. I want to create a database of blocks so to speak by copying all the blocks into one drawing. I tried going through Design Center to copy the blocks in, but it won't let me just copy them. Is there a simple way to do this?
View 1 Replies
View Related
Oct 27, 2013
AutoCad Architecture 10, How can you copy blocks to different drawings?
View 2 Replies
View Related
Feb 24, 2012
I have a drawing in house that has issues. When using edit/ copy and edit / paste on a block within the drawing, the block changes to another block when pasted. On a side note, it comes in at the rotation of the original object which was copied. I believe that I am using V.2000
View 8 Replies
View Related
Jun 19, 2013
In the overlay & sensor coverage file I have created some blocks. all the sensor coverage have dashed lines.
However, when I paste them into another document they partially dissapear and the dashed lines turn solid.
View 4 Replies
View Related
Jan 22, 2013
Can you open two dwgs and copy blocks from one design center to the other?
View 3 Replies
View Related
Feb 10, 2013
My entire office has been experiencing drawing crashes as a result of moving or copying certain blocks within a dwg. The problem seems to occur only while executing a Move or Copy command on a block with attributes, and zooming or panning while doing so. My heart sinks instantly because the block will disappear when placed, and I know I am doomed to crash.
I am usually able to pan or zoom a few times, and if I act quickly a Save will work before the drawing then crashes. We have recently switched from 2011 to Civil 3D 2013, and the problem still persists. The two culprits are our slope arrow block as well as hex call-out. Both blocks contain attributes and are frequently used through out our drawings, and this problem proves to be most frustrating when pressed for a deadline.
View 5 Replies
View Related
Jun 10, 2013
I have a dynamic block with stretch property.
It changes length after copy/paste.
A sample drawing is attached here.
View 8 Replies
View Related
Jan 31, 2013
In Autocad 2013, when I highlight a drawing in model space and copy, then go to new drawing and paste to original coordinates, everything comes in fine except for blocks. the blocks get thrown far away from everything else.
View 8 Replies
View Related
Jan 12, 2013
Why is there no dynamic block for the Imperial Hex Nut in the tool palettes?
Can I copy the Metric and convert it to become Imperial?
Where do I change Metric to Imperial in this dynamic block?
View 1 Replies
View Related
Aug 25, 2011
I have to obtain a selection set of blocks (by window selection and/or single-picks if the user desires) and then an attribute value which I have previously assigned to a variable called TAGVAL to the attribute tag name called PART in that selection set of blocks.
I found a cool routine called RepAtt, but it isn't quite set up to do what I need...
(defun RepAtt (Tag / SourceBlk ValueToCopy SelSet) (vl-load-com) (if (setq SourceBlk (car (entsel "
Select Source Block:"))) (progn (mapcar '(lambda (p) (if (equal (vla-get-tagstring p) Tag) (setq ValueToCopy (vla-get-textstring p)) ) ) (vlax-invoke (vlax-ename->vla-object SourceBlk) 'GetAttributes ) ) (ssget ":L" '((0 . "INSERT") (66 . 1))) (vlax-for DesBlock (setq SelSet (vla-get-activeselectionset (vla-get-activedocument (vlax-get-acad-object)) ) ) (foreach att (vlax-invoke DesBlock 'GetAttributes) (if (equal (vla-get-tagstring att) Tag) (vla-put-textstring att ValueToCopy) ) ) ) (vla-delete SelSet) ) ) ) (RepAtt "WIDGET");<-- Tag Name
View 1 Replies
View Related
Apr 15, 2011
I found a lisp to get block attribute data to a other block. See attachment. I can only apply it to one block. I like to apply it to selected blocks or blocks in a group. Is this possible?
View 9 Replies
View Related
Aug 23, 2013
I have a keyboard shortcut for Copy (see directly below). This command doesn't copy multiple. But if I type "Copy" at the comment prompt (AutoCAD 2013) the copy multiple is the default. Copymode is already set to "0".
(DEFUN C:C()
(setvar "SNAPMODE" 1)(COMMAND "_COPY")
(PRIN1)
)
View 4 Replies
View Related
Feb 28, 2011
(defun CELBLKS ( / e blk ss blkl)
(setq blkl "" ss (ssadd))
(while (setq e (entsel "
[Code]....
i have this lsp, it works great but how can modify it if i want select with a window.? exemple: if i have 3 differentes blocks, i want to select them with windows and the lisp select all blocks that are identical of those 3.?
View 9 Replies
View Related
Aug 22, 2013
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.
View 6 Replies
View Related
Aug 8, 2013
How to find no of times specific blocks used in a drawing?
View 9 Replies
View Related
Jul 15, 2011
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.
View 1 Replies
View Related
Aug 2, 2012
We used a bespoke program to convert our drawings to Java applets for web usage. This does not cope with dynamic blocks at present and we have started to receive drawings from our clients using them.
I need to replace this with standard static blocks based on one of two criteria. Either:
1) Replace based on visibility state (have generic chair block with multiple different chair types set by visibility type, need to replace depending on which type it is set as)
2) Replace based on parameter (have table with size set by dimensions, need to replace with static block for each dimension)
View 0 Replies
View Related
Jan 7, 2014
I have over 100 blocks that I need to add the exact same objects and visibility state to. Is there a way to globally make this change, or even to copy the visibility states from one block to the next without having to recreate the states in each block? I thought I had previously run across a routine on here that would make changes to multiple blocks at once, but I can't seem to find it now.
View 1 Replies
View Related
Jan 24, 2012
I have a project in 3D that I would like to export to Stadd. This requires lines rather than blocks. Is is possible to convert the blocks in the attached dwg file to to lines that are centered on those blocks?
View 9 Replies
View Related
May 18, 2012
The AttSync command does what it advertises fairly well. My problem is that I have thousands of small blocks in a single drawing. (My current drawing has 2100 block references with four attributes in each one.) I may change the attribute values in a few of them and need to re-sync the attribute locations. When I run AttSync it updates every single block insertion. One of two things are desired:
1)Flag each block insertion as having been sync'ed, reducing the number of objects requiring synchronization when AttSync is called again. Provide a way to force all to be sync'ed.
2)Allow a selection set in the AttSync command after selecting the block to sync.
Either or both of these would a great time-saver for those of us with large numbers of blocks with attributes.
View 1 Replies
View Related
Apr 24, 2013
I built a building foundation for a grading plan and I have another building that is the exact mirror of it. I have tried to mirror it. Didn't work. I created a block of the feature lines and inserted it with a -1 x value but I can't explode it. I tried the regular explode and xplode. Neither worked. I can use the the block to draw feature lines over but it just seems so much easier if I could figure out how to explode the block.
C3D 2013
View 2 Replies
View Related
Jan 24, 2012
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.
View 9 Replies
View Related
Apr 29, 2013
I am using AutoCAD 2013 on Windows 7 platform
95% of the blocks on the palettes have the images associated, and named, per the block name.
I have 48 blocks that the images are named like this "Block tool_F2149212-4649-41F5-95E6-4A978EC376F5_2".
I have tried resaving the blocks and recreating the blocks to no avail.
How to get these few blocks to have images that are associated with the actual block name and not the generic "block_too" name?
View 4 Replies
View Related
Dec 4, 2013
I am trying to update blocks for a client. Each block has a line of text with the block name in it. I would like to automate these with a field so that if the block name changes or a new block is created from that one, then the field would update as well. I am running AutoCAD LT 2012 currently.
View 8 Replies
View Related
Nov 20, 2013
I wish to have a single dimension alter the dimensions in a set of nested blocks, similar to shared parameters in Revit. For example, I have a circle that has a fixed diameter that I wish to control in all blocks. I have set the diameter to barDia so now I wish to manipulate the dimension from outside the block.
Am I able to share the parameter across all the blocks?
View 1 Replies
View Related
Jun 20, 2012
I was trying to alter the standard blocks on the tool palette. How I messed everything up but I basically have two huge problems now.
1. I am missing the necessary default blocks that should be under my edit block directory.....all the Aecb files.
2. Now when I try and put in a receptacle or any other standard block a triangle with an exclamation point shows up upon insertion.
I attached a picture of the "edit block definition" and the troubled symbols.
View 1 Replies
View Related
Feb 19, 2013
I received a file that has a large number of blocks with unnamed blocks inside. I need them all to be by layer, and i really don't want to explode it.
How can I can do it?
View 6 Replies
View Related
Oct 1, 2011
I have been working on a drawing with 3 different dynamic blocks for several weeks and everything has been working perfectly. However, all of a sudden this afternoon, the text in all 3 dynamic blocks disappeared and will not display on the screen in paper or model space, and does not print.
As best I recall, I was creating a polyline viewport when this text disappeared.
I cannot turn the text on in these dynamic blocks. The text in on layer 0 which is on, and is unlocked and unfrozen. Additionally I have turned on, unlocked and unfroze all layers in the dwg and this does not work. I have also checked the text layer in the block editor and it is on layer 0.
When I click on any of the blocks, all the information appears to be correct, ie: door numbers, text style, etc. The text, however, just does not appear. Also I have never set any invisible text parameters and when I open the block editor, nothing in the invisible text area is selected or select-able.
Previous versions of this drawing, which I saved yesterday, display all block text perfectly. Perhaps there is a setting I accidentally hit which caused this problem?
I have tried repeatedly turning on all the layers, unfreezing, unlocking, changing parameters in the Style menu. I closed Autocad and turned the computer completely off and back on again.
View 1 Replies
View Related