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


ADVERTISEMENT

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 :: Insert Dynamic Block From File With Multiple Dynamic Blocks

Jul 16, 2010

I have a drawing ("SURUBURI.dwg") with several dynamic blocks ("M12", "M16", "M18" ... an so on...). I want to insert in my current drawing, one of the blocks from SURUBURI.dwg, for instance the block named "M12".

For that i tried creating a new command "INSERT_M12" that has the following script :

^C^C-INSERT; "I:/Ionut Mihaila/Goodies/SURUBURI.dwg/M12"

Now obvious that doesn't work, but i think it shows clearly what i want to accomplish. So is there an other way to do this?

View 9 Replies View Related

AutoCAD VB :: Get Current Project Number And Drawing By Using Some Vba Code?

May 13, 2011

Is that possible to get the current Project number and Drawing by using some vba code?

View 2 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 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 2010 :: Insert Block To Inherit Current Layer?

Jan 12, 2010

There are certain occasions where I would like to insert a block to inherit the current layer in an active AutoCAD drawing. This happens frequently when a client requires a certain layering standard and I have a block from another drawing with different layering standards. To correct this it usually involves several steps - Explode and change the layer, setbylayer, bedit, etc,

Is there a command to where I can directly insert a block and its layers change to the current layer of the active AutoCAD drawing?

View 9 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 :: Can't Insert A Particular Dynamic Block

Jun 12, 2008

I have created a dynamic block and when I try inserting it another block comes in instead. This is happening inspite of the fact that the correct block is shown in the preview window. I have purged and audited the parent drawing as well as the block I am trying to insert. Also I have opened the block in the autocad program. and when I select all, to erase everything on the drawing, it lists 2 (two) in model space and then 1 (one) in paperspace. I assume that the listing in model space is the layout page as well as the block. Anyway I am doing this to select all and then remove the block from the selection group, which I want to retain.

I insert the block on another drawing, from another job. It came in but you have to explode it for the visibility icon to appear, and then It does not behave the way it is suppose to

I am attaching the block, I have not been able to make a weld symbol with all of the parameters that I want so I have created the body of the weld in a separate block that show's the different types of welds as visibility parameters. This is the one that is not working on a drawing where it is inserted.The name of the block is ( w_body.dwg )

View 8 Replies View Related

AutoCAD 2013 :: Insert And Scale Dynamic Block From Tool Palette

Apr 25, 2013

I am currently using Autocad 2014 and I am attempting to insert a dynamic block from a tool palette. I would like to click on a dynamic block in the tool palette and have it prompt for the (uniform) scale. It seems simple enough but either all the dynamic properties are lost  or it is inserted at 1"x1" (the scale of my original block). How to get this to work?

View 3 Replies View Related

AutoCAD .NET :: Insert Dynamic Block From File And Change Visibility States

Dec 19, 2011

I am trying to insert a Dynamic Block and change it's Visibility State. I can insert the block, and the visibility state changes, however, if I manually try to change it after, it does not change, even though the value has changed. My code executes and returns no errors, so I am assuming that I have done something wrong, or missed something out.
 
public class MyCommands { [CommandMethod("MyGroup", "Bolts", "MyCommandLocal", CommandFlags.Modal)] public void MyCommand() // This method can have any name {

[Code].....

If I insert my block manually, I can change the states and it works fine, but the code seems to break the block.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Dynamic Block Programmatically?

Feb 23, 2008

I figured out how to entmake a Block with attributes based on user input for insert point, rotation, etc.

My block is a detail bubble that is a circle with a tail, that cuts the object and shows direction of cut. I will include that with this post.

My problem lies in this. I've used dynamic block features such as linear for the tail length, and the cut length, and angle for the direction of the tail.

My old routine was simple, it would ask for detail point and angle. From that it would insert a block that was just the bubble and draw the tail and cut with a polyline.

Since then I've been able to use entmake, which is a lot more powerful for creating entities in AutoCAD. But for the life of me I can't figure out how to add the dynamic properties of my "new" detail block that has the tail, cut and bubble in one.

what I need in the entmake statement to make this create programmatically instead of inserting the block, then modifying it, if possible.

View 9 Replies View Related

AutoCAD Dynamic Blocks :: Actions And Parameter Grips Obscure Drawing-block In Block Editor

Mar 28, 2011

My drawing- block is a little bit complicated, it contains few actions and parameters and everytime i open block editor to add, or to modify some action I can't see my drawing because actions grips and parameters grips obscure my drawing. I tried to refresh layout but it doesn't work.

please take a look on attached jpg.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Dynamic Block At Default State

Feb 15, 2013

When scanning the BTR (Block Table Records) and encounter a "*U" block definition

how can i know if it relate to dynamic block and have it's name?

acutally my current goal is:

when insert a dynamic block at default state (no change in it's dynamic properties/actions)

it's 'Name and 'EffectiveName is equal, when set some of it's properties it turns to dynamic anonymous

with Name = "*Unn"

Can i programaticlly set the block reference to be dynamic anonymous (with out setting any of it's properties)

cause i would like to modify it's BTR (with out effecting the original BTR dynamic block) but do not want to convert it to static anonymous block.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Dynamic Block With Visibility State Pre-selected?

Dec 24, 2013

I currently insert certain dynamic block into drawings with a short function that first inserts the specified dynamic block and then immediately changes the visibility state to one specified as an argument to the function.

I'm wondering if it is possible / better / faster to somehow insert the dynamic block with the decided visibility state simultaneously. I've been amazed by many capabilities of VL so I wouldn't at be surprised if this can be done. (the dynamic blocks I'm inserting could have many multiples in the drawing but I need this method to only affect the one being inserted at the time the function is called. I currently use entlast to decide which one is being inserted.)

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Dynamic Block And Modify Stretch Points

Nov 30, 2010

I have a dynamic block that I would like to insert via a lisp routine. When the routine is run from my menu I would like to select two points on the drawing area. Then I would like my dynamic block to be inserted at one of the points I selected and then I would like a specific "point" of my block to be stretched to the other point that I selected. I was wondering if this is possible with LISP? I have my old LISP program I wrote that draws a leader and then inserts my block but that was before I started working with dynamic blocks.

Here is my current

(defun c:wldsym()
(setq osnapold (getvar "osmode"))
(setq orthold (getvar "orthomode"))
(setq dimsc (getvar "dimscale"))
[code]...........  
  
wld1r.dwg is my current block. It has some dynamic properties already. But I'm trying to add new properties that can be seen in my working test drawing wld1r-new.dwg

When using my code with "wld1r.dwg" you can see how everything behaves right now. Then open "wld1r-new.dwg" and note that the insertion point and a stretch point my default are in the same spot. Work with the two stretch points and look at how the block reacts.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add Attribute To Current Block In Drawing

Jan 22, 2013

i have a for example a block with one attribute and would like add a new attribute. i´m trying to read the current block and redefine - it comes a new attribute in propertieswindow but not graphical.

 (defun c:ent () (setq bn (getstring "
give a block name ")) (setq bez (getstring "
give a attribut name ")) (entmake (list (cons 0 "BLOCK")(list 10 0 0 0)(cons 2 bn)(cons 70 2))) (setq fe (entmakex (list (cons 0 "CIRCLE") (cons 8 "0") (cons 10 '(0 0 0)) (cons 40 1)))) (entmake (list (cons 0 "ATTDEF") (cons 8 "0") (cons 10 '(0 0 0)) (cons 11 '(0 0 0)) (cons 40 1) (cons 1 bez) (cons 3 "TOP") (cons 2 "NAME") (cons 70 0) (cons 73 0) (cons 50 0) (cons 41 1) (cons 51 0) (cons 7 "STANDARD") (cons 71 0) (cons 72 0) (cons 210 (list 0 0 1)) (cons 74 0) (cons 62 256) (cons 39 0) (cons 6 "BYLAYER"))) (entmake (list (cons 0 "ENDBLK")(cons 8 "0"))) (entdel fe) (entmake (list (cons 0 "INSERT")(cons 2 bn)(cons 10 '(0 0 0))(cons 66 1) (cons 62 256) (cons 39 0) (cons 6 "BYLAYER"))) (entmake (list (cons 0

[code]....

View 9 Replies View Related

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 .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 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 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 Architecture :: Dynamic Block In Drawing

May 10, 2013

dynamic block in a drawing - when i make a change in the block editor, it doesn`t apply in the model space although i save all the changes. There is also another dynamic block and this time everything is working properly  - all the saved changes appear in the model space. The only difference between the two blocks is that the first one has attributes. I think attributes should not be the reason for not applying changes, but i just don't know.

View 1 Replies View Related

AutoCad :: Dynamic Block Editor In Drawing

Jul 7, 2011

There doesn't seem to be an issue with this block when I open it with the block editor in the drawing where it was created. However, if I insert it into another drawing, it comes in as a block but when I select it, only the insertion point grip is visible. What happened to the parameters and actions? Oh they're still there but I have to open the block editor again for that block and then they display a great distance away from the block itself. This is all in model space with no change to the scale of the block upon insertion.

If I erase the parameters and actions and recreate them, the block behaves correctly in that second drawing but there is still the problem with the original block in my library.The attachment is supposed to be for a portion of metal deck that can be arrayed to whatever length is requied.

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







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