AutoCAD .NET :: Insert Block Into Another Open Drawing

Oct 30, 2013

I would like to be able to collect information from a drawing via a sub-form and then insert a block with attributes (populated with collected info) into another open drawing.  The insert operation would be launched from a button on my sub form.

Is this possible?

From the code below I attempted a test to simply select a point from another open drawing but was not successful.  However, once I closed both forms the target drawing file is activated.

Private Sub Button2_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button2.Click
Me.Hide()
Dim docMgr As DocumentCollection = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager
Dim i As Integer = 0
For Each doc As Document In docMgr

[Code]....

View 4 Replies


ADVERTISEMENT

AutoCad :: How To Insert Title Block Into Drawing

Jan 28, 2010

How do I insert a title block into my drawing?

View 9 Replies View Related

AutoCAD LT :: Text Style Changes When Insert Block Into Drawing

Dec 29, 2011

I am trying to create a block which consists of my company logo and some text to use on  my drawing sheets or templates

I have created a block by making a autocad drawing  and  creating /saving it as a block .. When I insert the block into my drawing the text style changes into a different style...  why is this happening and what can be done to prevent this change from occuring. I am using autocad lt 2009 and 2005 the problem is consistant with both versions...

View 3 Replies View Related

AutoCAD .NET :: How To Insert Block Not On Drawing In Search Path

Sep 16, 2011

I am trying to insert a block (using .Net) that does not already exist on the drawing.  It is on a network share, which is in the search path.  If I, from the command line insert the block, it finds it ok and inserts it.  But when I do this from .Net code it does not search for the block.  So how do you get it to search for the block and insert it?

Here is a code snippet I'm using to insert the block:

Dim myDwg AsDocument = Application.DocumentManager.MdiActiveDocument
Using myDocLock AsDocumentLock= myDwg.LockDocument()
Using myTrans AsTransaction= myDwg.TransactionManager.StartTransaction
'Open the database for WriteDim myBT AsBlockTable = CType(myDwg.Database.BlockTableId.GetObject(OpenMode.ForRead), BlockTable)

[Code]....

View 9 Replies View Related

AutoCad :: How To Insert A Block Into Drawing Uses Dynamic Blocks

Oct 17, 2011

I am trying to insert a block into a drawing that uses dynamic blocks. I want the block to be associated to the dynamic block, so that when I alter a linear stretch parameter on the dynamic block it moves the other block.

I am probably missing something obvious, but have now googled my mind into a numb state and can't make any more progress.

View 3 Replies View Related

AutoCAD 2010 :: Insert Lighting Block Into A Drawing

Feb 12, 2012

I have a lighting block I need to insert into a drawing. Who ever drew the block did so upside down (so the top is really the bottom). I can't, for the life of me, figure out how to "rotate" it so that the top is correct. When I rotate the block, it simply keeps the top the top. When I copy and paste it, it stays the same as well. I tried inserting it into a new drawing.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert One Or Another Block Into Drawing

Apr 22, 2013

I am trying to insert one or another block into a drawing, and i need to do this 8 times per drawing. 

(defun C:detector (/ filename gas pressure)
(repeat 8 (initget 1 "Gas Pressure")
(setq filename (getkword "
Enter Detector Type [Gas/Pressure]: "))
(if (= filename "gas") (command "-insert" "*T:\acad\schematic_circuits\suny\sunygasdetectornew.dwg" pause "" "")
(or (if (= filename "pressure")
(command "-insert" "*T:\acad\schematic_circuits\suny\sunypressuretransmitternew.dwg" pause "" ""))
) ;;end or
) ;;end if
) ;;end repeat
)

View 4 Replies View Related

AutoCAD 2010 :: Block Insert Point Is Different On Drawing Than On Xref

May 4, 2012

I have a drawing where I have placed all of my natural gas piping.  I have all of the annotative blocks set to 3/32"=1'-0" and 1/32"=1'-0" scales.  They are both correctly displayed in this drawing. 

When I xref this drawing into another about half of the 1/32" blocks show up correctly.  The other half are shifted to the right off of the plan.  All of the 3/32" blocks show up correctly.

View 9 Replies View Related

AutoCAD .NET :: Code To Insert A Dynamic Block Into The Current Drawing

Oct 15, 2010

I need simple code to do just one thing, inserting a dynamic block that is stored in a separate file on my computer (like C:/base/b-22) in the drawing that I'm currently using. For example, I have a windows form with a list box with names of many dynamic blocks that are stored on my c drive, I would like to pick a block with a name and upon a click event of a button or other will go get this block from a separate file and insert it in the drawing I'm currently using, and would need to be able to pick the point of where I want the block to go. I'm using autocad 2010 with visual studio 2008- using the new autocad .net language.

View 9 Replies View Related

AutoCAD 2013 :: Editing Architectural Title Block - Cannot Insert Into Drawing

Mar 5, 2013

I'm trying to edit an architectural Title Block. I've went into block editor and did attribute definitions. However, when I save it I can't insert it into a drawing. Is there anything I can do to prevent this from happening?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Create / Insert Block In Drawing

Sep 26, 2013

take a look at this piece of my LISP-routine.

(command "_.block" pause pause ss "")

where:

ss  -  is a Selection set of some entities

In the rest of code, I don't change the values of initdia, or cmdecho, or whatever else  

I haven't sill understood them that well.The problem is the following:

When My routine executes this line, I am promted for:

1. block name - that's OK

2. insertion point - that's OK

3. then the block-command receives correctly the entities from ss-selection set - that's OK

4. then all the object dissapear! **Problem here**

The block is created... I can insert it in the drawing from the block-data base...

But is there a way to let this block stay in the drawing ? without disappearing?

View 2 Replies View Related

AutoCad :: Plan View Of Gate Crane As A Block To Insert Into Drawing

Aug 23, 2011

I need a plan view of a gate crane as a block to insert into my drawing. It is not necessary to be detailed and a simple one is acceptable.

Is there any place to find it. Attached photo shows what I am looking for.

1.jpg

View 6 Replies View Related

AutoCAD Civil 3D :: Drawing Land On Site When Xref Or Insert As Block

Jun 24, 2013

I'm using C3D 2013.  I received a survey drawing (unknown version) from a third party.  I tried both xref'ing and inserting as block into my drawing and it was over 7,100' SW from my site.  BUT when I copy from 0,0,0 in his drawing and paste 0,0,0 in my drawing, it lands on my site.  If I xref my drawing into his drawing, it lands on his survey information.  Why doesn't his drawing land on my site when I xref or insert as block?

View 6 Replies View Related

AutoCAD .NET :: Insert Block From External DWG File / Specify Insert Point By Click Mouse

Apr 2, 2013

I write a program, this program needs to insert some standard illustrations. I made these standard illustrations into different blocks. And I store these blocks in a dwg file. Everytime I need to insert some illustrations, I just click the mouse on the current drawing, I want the illustration inserted. These means the following points:

(1) Import the blocks to the current drawing, if the blocks have already been imported, then do nothing.

(2) Specify the insert point by clicking the mouse, and I want the block's insert point to coincide with the mouse clicking point.

View 1 Replies View Related

AutoCAD .NET :: Open Drawing And Read Block Attributes In Each Layout

Jan 8, 2014

I need to open a drawing and read block attributes in each layout.

  Dim AcadApp As AcadApplication
  Dim AcadDoc As AcadDocument
 Try
  AcadApp = GetObject(, "AutoCAD.Application")
Catch ex As Exception
 
[Code] ....

how to read each layout block attributes?

View 1 Replies View Related

AutoCad :: Insert OS Tiles Into A Drawing Using Insert XRef Command

Aug 2, 2013

I am trying to insert OS Tiles into a drawing using the insert x-ref command. I have managed to insert 192 tiles but still need to add 29 more tiles to complete. When I try to insert another x reference AutoCAD just goes into a continual loop. Have to force AutoCAD to crash after ten minutes.

I am using AutoCAD 2014 MAP and have just had a new system built (i5 processor, 8GB RAM).

View 9 Replies View Related

AutoCAD 2010 :: Dynamic Block Grips - Block Does Not Change When Insert In Another File

Oct 28, 2013

I have created a dynamic block with a stretch, flip and rotate.  Everything works great in its file.  When I insert it in another file, the grips move but the block does not change.

AutoCAD 2014

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Point At List Block And Dynamic Block

Apr 18, 2013

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
 
(vl-load-com) (defun c:pmb11 ( / sele cod bloque nbloque lista pt ) (prompt "
block: ") (setq sele (ssget ( List'(0 . "INSERT"))) Cod 0 )cod (1+ cod) (repeat (sslength sele) (setq bloque (ssname sele cod)) (setq pt (cdr (assoc 10 ( entget bloque)))) (command "punto" pt) );repeat ) 

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert A Block / Explode And Rename Nested Block With Suffix

Nov 30, 2012

I have a block that i want to insert several times and revised each one to be different to do this i would have to insert it and rename the blocks that come in and then reinsert i would like to insert and have a lisp explode the main block and rename the other 2 blocks with a suffix at the end depending on how many times its in the drawing... can this even be done? My original block name that will be first inserted is "BENT PULLEY NOTES" it needs to explode after i drop it in and then there are 2 blocks within that called "Bent Pulley" and "Bent Pulley DYN" that i was hoping to keep the names but add a number at the end depending on how many are in the drawing already...

here is a lisp that i have found... it would work if i didn't have nested blocks and only wanted the one block to be insert and not explode...

(defun c:Test (/ e i name Bname )
(setq e nil)
(command "_.-insert" "Drawing1.dwg" pause "" "" "")
(if (setq e (entlast))

[Code] .......

View 9 Replies View Related

AutoCAD .NET :: Insert Block And Drag Jig Hiding Inserted Block At 0,0

Apr 11, 2013

I have a pallete button that inserts a block then a drag jig to position it. The block is first inserted at 0,0 and dragged.

The block at 0,0 remains visible while a "duplicate" block is dragged. Is there a way to hide the original?
 
Insert block then calling the drag jig..
AddViewBlock(New Point3d(0, 0, 0), 0, ColorIndex, trans) psr = ed.SelectLast() DragView(psr.Value, "Bar Insertion Point")
 
In the DragView procedure I have:

 Public Sub DragView(ByVal SS As SelectionSet, ByVal sPrompt As String)
'....
Dim ppr As PromptPointResult = ed.Drag(SS, vbLf & sPrompt, New DragCallback(AddressOf MyDragCallback))

View 4 Replies View Related

AutoCAD .NET :: Insert Dynamic Block And Position And Stretch The Block?

Apr 6, 2013

I am trying to insert a dynamic block and position and stretch the block, using the linear parameters, depending on values entered into a form.

I managed to create a form that would draw a series of boxes. And i managed to create a routine that would insert a block and size it depending on fixed values but i can't link the 2 together.

Win 7 Pro 64bit, Dell Precision M6500

View 8 Replies View Related

AutoCad :: How To Delete Block From Insert Block List

Oct 20, 2007

I am using Autocad 2007 I made several blocks with att. And I use this drawing and copy it to the samples/design center folder so that I can see the blocks that I created on the Design center window for use on different other drawings.

My problem is that if I make a cange on the ORIGINAL block drawing how can I update the inserted blocks on the other drawings? I try to delete the block from the local drawing insert block list (is this possible?) to paste the block again with the new changes, but somehow even when I grab the new modified block to inserted again when I do it, it takes the shape of the old version!

View 6 Replies View Related

AutoCad :: Create Block To Insert On Title Block

Oct 26, 2012

Is it possible to create a block to insert on our title block that will populate itself with a list of drawings and names?

I know this is possible through the use of LISP and the Sheet Set Manager, but could this be done through a combination of attributes and fields (we want the same functionality in LT).

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Point At Block Insert Point

Sep 26, 2012

trying to insert point instead of block.

(setq blok (entget (car (entsel))))

(setq point (cdr (assoc 10 blok)))

(setq XX (rtos (car point) 2 20)) ;; x koordinata bloka

(setq YY (rtos (cadr point) 2 20)) ;; y koordinata bloka

(setq ZZ (rtos (caddr point) 2 20)) ;; z koordinata bloka

(command "point" xx,yy,zz) is not working

!xx="5582453.414999999" but when i (atoi xx) i get 5582453 no dedimals...

how to create valid insertation point from xx, yy and zz?

View 6 Replies View Related

AutoCAD .NET :: Insert Block Reference Using Block Name

Nov 17, 2012

Drawing contains a block with "BlkName". I want to insert blockreferences of this existing block using .Net. All shows how to insert a new block and then use the BlockID returned by the insert function. In my case I only have the block name and there is no Block id. How to get it or how to create a block reference of an existing block?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Another Drawing Layout Tabs Contents In Current Drawing

Mar 7, 2013

I want to insert another drawing layout tabs contents in current drawing.

It's easy for MODEL tab, but for LAYOUT tabs, I dont know how!?

I prepared a code for INSERTING MODEL tab in current drawing:
 
(defun INS_DWG (TAB path dwg P / blk)(setq blk (strcat ""*" path dwg """));(setq N (vla-get-count (vla-get-layouts)));;Number of LAYOUT TABS in dwg(if (or(= TAB 0) (= TAB nil))(command "INSERT" blk P 1 0)); TAB=0 or omitted ==>Insert MODEL;(if (= TAB 1));==>Insert the 1st LAYOUT in dwg file;(if (= TAB 2));==>Insert the 2nd LAYOUT in dwg file;and so on....);;;usage:;;(INS_DWG 0 "c:\test\" "test.dwg" '(0 0))

View 8 Replies View Related

AutoCAD LT :: Insert Using Block Name

Oct 12, 2012

Using the command -insert -blockname = filename successfully? What I have tried is:

^C^C_-insert;"Insulation - 25-50mm"="K:/All Staff Personal Folders/Personal_Charles Edwards/Autocad/Blocks/Detail Blocks/Insulation - 25-50mm.dwg";

Trying to run this I get:

Command: _-insert
Enter block name or [?]: Blockname="K:/All
""K:/All.dwg": Invalid file name.
*Invalid*

View 4 Replies View Related

AutoCAD .NET :: Insert Block From Other DWG

Nov 12, 2012

I have to write a procedure for insert a block with attributes from an external file and set the annotative scale block to current scale. where I cand find an examples?

View 2 Replies View Related

AutoCAD .NET :: Insert Block With Different Name

May 3, 2011

is there a way to insert a block in the drawing, but with a different name, so it can be edited separately?

I have block A in the drawing and i want to insert it again, but then edit it while the ones already inserted stay unchanged. So i would need it to be inserted as A_1.

View 1 Replies View Related

AutoCAD .NET :: Insert 3D Block Into UCS

Aug 24, 2013

I defined a 3d block..It is defined along X axis...I want to insert it into a ucs by picking 2 points( insertion, and direction) and that Block Z axis to be parallel with UCS z axis

I insert the block first then I rotated it..I have got this

P1 is insertion poit

P2 is the point for direction

P1 world is p1.transformby(current ucs)

Dim Xax_block As Vector3d = Block1.BlockTransform.CoordinateSystem3d.Xaxis.TransformBy(Block1.BlockTransform)
 Dim VectorP12 As Vector3d = P1_world.GetVectorTo(P2_world)
    Dim RotAX As Vector3d = Xax_block.CrossProduct(VectorP12) ' here is calculating the perpendicular vector between x axis of the block and the vector from point1 and point2
      Dim Rotation1 As Double = Xax_block.GetAngleTo(VectorP12)
      Block1.TransformBy(Matrix3d.Rotation(Rotation1, RotAX, P1_world))

By picking 2 points is inserting the block along the line between 2 points...But is not having as normal the z axis of the ucs..

View 2 Replies View Related

AutoCad :: How To Insert 3D Block

Feb 29, 2012

I have a problem with inserting 3d blocks in autocad 2011. While inserting a block, i specify insertion point on-screen and blocks seems to be inserted to right place but block itself is far away from the drawing (eg. if i type zoom --> extens = drawing and inserted block are totally different locations on model screen.)

View 1 Replies View Related







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