AutoCAD .NET :: Jig Multiple Entities Such As Insert Block And Add Line?
Mar 26, 2013How to Jig multiple entities such as insert a block and add a line.
View 3 RepliesHow to Jig multiple entities such as insert a block and add a line.
View 3 RepliesI am trying to put something together that will allow a user to select objects in AutoCAD and then place a block at all the selected points.
Below I have pasted the code that I have so far, but have not been able to test this to see what happens because the Dim ofd part is giving me an error that I have not been able to figure out.
The error that I am getting says that :
Argument not specified for parameter "flags" of "Public Sub New(title As String, defaultName As String, extension As String, dialogName As String, flags As Autodesk.AutoCAD.Windows.OpenFileDialog.OpenFileDialogFlags)
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.Geometry
[code]......
I have a drawing with all my block definitions and the blocks inserted and annotated. Seems that in a previous version of Autocad, I could insert the drawing and cancel the insertion at some point of the insertion command sequence, such that the drawing was not inserted, but all the block definitions remained. I could then use the insert command and all of these blocks were available. Yes, sometimes this made my drawing memory size rather large and I would have to purge the unused blocks later to reduce the memory size of my drawing.
View 1 Replies View RelatedSo i have a simple block of basically a point. i also have alot of points to input. I know i can attribute the block with promts such as levels or dates etc.. but is there a way to make the block do this by itself when level is already entered? also is there a way to insert multiple block (like the points) using excel concatenate function? or can i input the points and have date and level shown in a text form?
View 2 Replies View RelatedI have a lisp routine that I would like to add to. Right now when running the macro the user is not prompted to "Pick Point On Line" in this example
(command "insert" blk "s" var1 pause pause))
I have added the line
(setq pt1 (entsel "Pick Point On Line "))
(command "insert" blk pt1 "s" var1 pause pause))
but the command doesn't seem to like my PT1 value
BLK and VAR1 are set in another lisp routine.
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]........
My application inserts 4 DBText lines and 2 PolyLines into a drawing from another drawing(or Source Database). I created a special layer ("warning") into which these entities are inserted. Then I combined these entities into a group so the user can move it out of the way while they are working.
When the title block data is refreshed, I want to redraw my 4 lines of text and 2 lines at the location last set by the user. I have successfully implemented redrawing the object at the X and Y coordinates last placed by the user by using ent.TransformBy(Matrix3d.Displacement(acVec3d) on each entity at the source and then doing a DBSource.WblockCloneOjbects to put them in the destination drawing at the correct position.
However, if the user rotates the group, I need to make the rotation also. This is where I'm having problems. What is the best way to grab the rotation value(s?) from the existing, user placed group, and then redraw onto the drawing at that rotated value? Is there an easier implementation that the way I am doing it?
I have a block with 10 rectangles in each with 3 lines of text. Each 3 lines of text is attributed to a tag
so the first line is IN-0 DESC1,
second line is IN-0 DESC2
third line is IN-0 DESC3
I have deleted the data from
IN-3 DESC1
IN-3 DESC2
IN-3 DESC3
and i want to move the data from
IN-4 DESC1
IN-4 DESC2
IN-4 DESC3 etc
up to the position of
IN-3 DESC1
IN-3 DESC2
IN-3 DESC3
can this be done?
other wise i will have to click on
IN-4 DESC1 cut the data then open up IN-3 DESC1 and paste it then repeat for
IN-4 DESC2 cut the data then open up IN-3 DESC2 and paste it then repeat for etc
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?
Let's say I am inserting a square block into a dwg and want to get it parallel to an existing angled line. Do I have to read the angle of the line and insert the block to that angle or is there a quicker way?
View 6 Replies View RelatedIf it is possible to assign multiple attributes to a single line text within a block, and be prompted for them upon insertion.
View 3 Replies View RelatedI 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.
Is it possible to select entities of multiple layers?
I've looked at... [URL] .....
...and tried the following code.
string[] layerNames = {"1", "2", "3"};TypedValue[] tdv = new TypedValue[(layerNames.Length * 3) + 2];int i = 0;tdv[i++] = new TypedValue((int)DxfCode.Operator, "<or");foreach (string ln in layerNames){ tdv[i] = new TypedValue((int)DxfCode.Operator, "<and"); tdv[i + 1] = new TypedValue((int)DxfCode.LayerName, ln); tdv[i + 2] = new TypedValue((int)DxfCode.Operator, "and>"); i += 3;}tdv[i - 2] = new TypedValue((int)DxfCode.Operator, "or>");SelectionFilter sf = new SelectionFilter(tdv);PromptSelectionResult psr = ed.SelectAll(sf);
This code gives me an error in the PromptSelectionResult.
What would cause the erro?
There are blocks in the drawing, each containing several nested entities. Need a command which would find all the nested entities which got into the selection area provided by user (not necessary to select entities, just get the ids). GetNestedEntity() does what I need but for a single entity only.
Selection of 'Trim' command does exactly what I need. How could I achieve the same behaviour?
I was wondering if there is a way to change multiple entities of Mtext. I tried CHT but the options are limited. Is there a way of say changing the color?
View 6 Replies View RelatedI have created multiple sketch entities like line, arc, circle etc. using the Inventor API's. Now I want to add the coincident constraint between start point of line, start point of arc and center point of circle.
I have added coincident constraint through UI(Please see attached snap). The same I want to add using Inventor API's. which API I should use to add the coincident constraint for such multiple entities.
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
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 )
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] .......
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))
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
I've written a method that creates a block definition and inserts one instance the newly created block definition. The block is comprised exclusively of lines and text entities. When the method is completed, all entities appear correctly on my machine.
However, when other users try to run the routine on their machines, the lines appear correctly but the text entities all appear positioned at the block insertion's origen. And the other users must manually regen the drawing after the command is run to trigger the text entities to move (or appear to move) into their proper location.
Though it wasn't necessary on my machine, I tried adding the following line as the last instruction in my command-method:
_drawing.Editor.Regen();
But even that last line's programmatically-triggered regen didn't solve the text location issue for my users. They still have to manually regen.
I also ensured that all (or most) of a test user's system variables were set to the same values that I use (via Express Tools export & import). But that didn't work either.
I have a lisp that draws variety of entities such as lines, arcs, hatches, points, blocks, text etc. How can I make one single block containing all of them, i.e. one block that has all items drawn since the lisp was invoked.
View 8 Replies View RelatedI 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!
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).
I am modifying stuff in a dynamic block insert entity. There is no "endblk" entity at the end of these definitions and I need to cycle through every entity within the block definition. When it gets to the last entity, I get an error because you cannot entnext passed the last entity. There are 2 things:
1. How to retrieve the # of entities in a block without cycling through it.
Or
2. A quick lesson in the *error* function, I cannot figure out how to implement this. I basically want to to say:
(if (entnext myent)) returns a error, don't abort & continue on.
The 'application' I am trying to make currently adds entites to a drawing. Each entity has data associated with it but also part of a tree of infomation so I store xrecord data along with the objectID in a dictionary tree within the drawing.
I want to be able to select multiple entities and have any matching data shown in a palette. The same way the properties palette behaves.
I have it working but I can see AutoCAD crunching the data. It cycles through the selection set and the dictionary tree extracting entity data until it finds an ID match in the xrecord.
How the properties palette works so quickly or how I could improve the speed.
I am trying to save road centerlines with labels to an AutoCAD drawing. On the Output Tab I click Save Current Map to AutoCAD. When I open the AutoCAD drawing I created each letter in the label is a seperate text entity. Like Main St is not one entity, it is 6 different text entities.
View 3 Replies View Relatedtrying 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?
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 RelatedSay I have a block which contains just a line inside. I overruled that block to show a circle. I have this overruled explode class, so whenever user at command pormpt explode that entity it would be exploded as a circle.
My problem is when I explode the block within code ( Myblockref.Eplode(dbobjects) ) . it will bring the line.