AutoCAD .NET :: Nested Blocks From Selected Subentity

Sep 27, 2013

I'm attempting to have the user select mText from a nested block within a block and then copy the nested block to model space out of the block. I'm able to change the mText successfully, but when I attempt to get the nested block it is not in the list of GetContainers() it only contains the block in model space and the model space block. The nested block is missing in the list. I'm using AutoCAD Civil 3D 2013. 

Here is the code to select the mText object which works correctly.
 
Sub GetNestedMtext() ' Have the user select an object. Using the prompt provided. Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor Dim entopts As New PromptNestedEntityOptions(Environment.NewLine & "Select a mText in block to replace: ") entopts.Message = Environment.NewLine & "Select a mText in block to replace: " Dim ent As PromptNestedEntityResult = Nothing Try ent = ed.GetNestedEntity(entopts) Catch ed.WriteMessage("You did not select a valid entity") End Try If ent.Status = PromptStatus.OK Then CreateDuplicateBlockInModelSpace(ent) End If End Sub
 
Here is the code that attempts to get the nested block which is missing the nested block.
 
Private Shared Sub CreateDuplicateBlockInModelSpace(ByVal ent As PromptNestedEntityResult) Try Dim containerObjIds As ObjectId() = ent.GetContainers() Dim blkToExtract As BlockReference = DirectCast(containerObjIds(1).GetObject(OpenMode.ForRead), BlockReference) Dim blkToPlace As BlockReference = blkToExtract.Clone() Dim doc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument Dim db As Database = doc.Database Using tr As Transaction = db.TransactionManager.StartTransaction Dim acBlkTbl As BlockTable acBlkTbl = tr.GetObject(db.BlockTableId, OpenMode.ForRead) Dim acBlkTblRec As BlockTableRecord acBlkTblRec = tr.GetObject(acBlkTbl(BlockTableRecord.ModelSpace), OpenMode.ForWrite) acBlkTblRec.AppendEntity(blkToPlace) tr.AddNewlyCreatedDBObject(blkToPlace, True) tr.Commit() End Using Catch ex As System.Exception End Try End Sub

 Is there another way I can get the parent block object for the nested object? 

View 5 Replies


ADVERTISEMENT

AutoCAD .NET :: How To Get All MLeaders Even In Blocks Nested Ones

Aug 13, 2013

I need to EnableFrameText to all MLeaders in a drawing, I also want to get the MLeaders who are nested in Blocks automatically...

I started this way but It just works fine with the Mleaders in Modelspace or if I open the Blockeditor to edit Mleaders nested in a Block...

I know I'm not going to "deep", maybe I need an other Transaction, or thirst open each Block to edit... not right sure...

my example:

//Ändert leider nur die MLeader die nicht in einem Block sind....
[CommandMethod("MLeaderIterator")]
public static void MLeaderIterator_Method()

[Code]....

View 2 Replies View Related

AutoCAD 2010 :: Know If DWG Contains Nested Blocks?

Apr 13, 2012

Is there a quick/easy way to know if a DWG contains nested blocks?

View 6 Replies View Related

AutoCad :: Data Extraction Nested Blocks?

Dec 13, 2011

Here is the problem with the process put simply:

Start with a new drawing Drawn a rectangle. Place a block which has an attribute with a number at each corner. ie. 1-4. Convert all objects into one single block. (the attributes become nested). If you use data extraction and retrieve the attribute number, position X and position Y, and output to a table the information displayed is correct. HOWEVER, if you rotate the block and update the link the coordinates become incorrect? This seems to be an issue with nested blocks?

View 4 Replies View Related

AutoCAD 2010 :: Turning Off Lines In Nested Blocks?

May 30, 2013

 Autocad 2011

wondering if its possible to turn off lines inside of nested blocks.

When we tried to do this inside a heavily layered and blocked drawing, it seemed to make the file unresopnsive, unloadable, and general "autocad freezing" issues. We Reconsitituted the entire file from the ground up and found that by NOT turning off these lines inside of nested blocks (ceteris parabis) the file works fine.

We like to turn these lines off becuase different teams are working on different parts of the drawing and we like to focus on one section by turning the other off. Is this possible? Is there a better way to do this?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Select All Blocks Like Selected Blocks With Window?

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

AutoCAD 2010 :: Changing Font Style In Nested Blocks

Mar 28, 2012

Is there a way to change text font style (Text, and Mtext) in nested blocks automatically? I need to do this for multiple nested blocks at once.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Nested Blocks In XREFS

Apr 21, 2008

I have an XREF that contain block inserts sometimes nested 2 or 3 levels deep. Given the block names, is it possible to find and translate the insertion point of the nested inserts to the current World UCS?

Ideally I would give a routine the block name and it would scan the current drawing and return a list of the translated insertionpoints>

View 5 Replies View Related

AutoCad :: Edit Text Attributes Nested In Multiple Blocks?

Jun 22, 2010

I have a .dwg file which contains numerous blocks (70 or so) and they all have unique names.All these blocks have nested text.

I want to edit the attributes of all the text, in all these blocks, such that they assume the same text style, text layer and colour.

Obviously, with so many blocks, I want to avoid clicking on the text and editing the attributes individually.

I tried a lisp file called ATcolour.lisp, but even this is very time consuming.

View 4 Replies View Related

AutoCAD 2013 :: Sharing Parameters In Nested Dynamic Blocks Using 2014

Nov 20, 2013

I am drawing a block that containes a number of other blocks which I want to control parametrically.  For example. In one block, I have set the diameters of a circle restricted to 10 and 12-mm.  I have a second block that also contains the circles which have similar restrictions. I now want to control the diameters of the circles from a single source - similar to shared parameters in Revit.  Am I able to share a global parameter between blocks?

Eventually, I want to control a 2D drawing from a table only.  Should I be using .Net or AutoLisp for this.

View 4 Replies View Related

AutoCad :: Edit Line Weight In Nested Blocks Of All XREF Drawings

May 13, 2012

The 2D drawings I am working with were exported from 3D REVIT files to 2D AutoCAD files. There are several XREFed drawings that are both mechanical and architectural from the original REVIT files that for whatever reason, the block's line weights came over with line weights of 70 in those blocks.

When I plot, the objects are a blur with the line weight so high. I tried using the command "setbylayer" but that didn't work since nested blocks still had lineweights of 70. Is there a VBA or LISP routine to run through all the blocks (including nested) that can change the line weights to a given number?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Remove All Attributes Including In Nested Blocks?

Jan 8, 2013

There is a quick way to remove all attributes, including in nested blocks. Looking some lisp in the forum, I can't find one code for remove this elements completely.

View 9 Replies View Related

Revit :: Exploding Families (nested) Similar To Blocks

Apr 10, 2012

Basically the question is if it is possible to explode families similar to blocks in AutoCAD.
 
Here is an example: A Family made for placement in the model has 2 nested families. Once placement is done is it possible to eliminate the initial family so only the nested families remain? All the parametric values can go away that’s fine and the nested families are also shared if that matters.
 
Since I come from AutoCAD and started with Revit v2012 it is basically like a block within a block which you could just explode so much until only lines are left.

View 2 Replies View Related

AutoCad :: Replace Only Selected Blocks With A Different One?

Feb 11, 2011

I have 20 blocks named "george" in my dwg. Now, I would like to replace only 7 of them with the block "george2". Is there a simple way to do it just by selecting these 7 and replacing their definition without changing the other 13 "george" blocks?

View 9 Replies View Related

AutoCad :: How To Copy Selected Blocks With New Name

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

AutoCAD Map 3D :: Quick Selected Blocks Don't Display But Their Properties Do

Oct 30, 2012

I am trying to get back some of my work that was "lost" when a crash accured. I had 16 blocks (all the same) inserted into my map at the correct locations. I recovered the drawing but noticed that the blocks weren't displaying. I conducted a quick select for the layer which they're on; it stated 16 items were selected (but they are not displaying). While they are still "selected" I checked the properties & it stated all the correct information (quantity, block name, color, layer, scale, etc...). I made sure all layers associated with the block were not frozen. So it's acting as though they're still in the drawing, but aren't displaying...

View 1 Replies View Related

AutoCAD 2010 :: 2012 Hangs When Blocks Or Polylines Are Selected?

Mar 9, 2012

Whenever I select a block or polyline in 2012, the program hangs for about 1 minute.  This never happens when using 2010 on the same system.  Obviously this can't continue. 

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add Attribute To Selected Blocks (XY Coordinates)

Nov 30, 2012

i have found the following lisp in a previous thread: (shows XY coordinates of the selected blocks)

(defun C:MyFunc (/ ss Index Ename Lst)
(while (or (not ss) (= 0 (sslength ss))) (setq ss (ssget '((0 .
"INSERT")))))
(if ss

[Code]....

I want this information to be added to the blocks as hidden attributes so that i can extract them by attout. The work to be done is : attout to excel, autofill an attribute (numbering) then attin.

but my problem is that i cant think of a way to number those blocks IN ORDER (ie top to bottom or left to right) unless by sorting them in excel first by their x or y coordinates

View 9 Replies View Related

AutoCAD 2013 :: Batch Conversion Of All Or Selected Blocks To Mass Objects?

Sep 30, 2013

I need to export many library elements (conveyors) which are saved in individual blocks to mass objects. I need to convert them to IGES after that.

Until now I have to open every single block and convert all of it to a mass element. This simply takes too long.

Is it possible to write a small script or program which converts all blocks or the selected blocks to mass elements?

- 2500K @ 4.2Ghz- 8GB - Radeon7970 -
- Xeon 1230V2 @ stock Ghz- 32GB - Quadro 2000 -

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Find And Replace Group Of Blocks That Are SELECTED

Jul 17, 2013

I having real difficulty finding a lisp that will find and replace blocks.  There are plenty out there and AutoCAD 2013 and lower has a Find and Replace Blocks.  However, the frustrating catch is I can seem to find a routine that will allow me to replace only those blocks that I select with a selection set of my choosing.  The built in function replaces all of them and will not let you exclude some.  We have PID drawings that we want to replace valves on, but not all valves.  We don't want to rename.  We don't need to BEDIT the existing block. 

1) Pick group of blocks

2) specify a new block that will replace all instances of old block

3) replace inserted block with different block.  Leaving others alone.

I'm thinking this should be easy, but my search has failed.  The blocks in question are not dynamic or attributed either.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Place Circle On Selected Blocks Insert Point?

Mar 11, 2013

You have a dwg with multiple sets of different blocks and a circle you want to place on the insert point of each set blocks. 

You select the circle then select one of the blocks in the set and the circle is placed on the insert point of each of the blocks in that set. It would save time from doing it manually and save on mistakes.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Automatically Export Attributes From Selected Blocks To Defined Txt File

Oct 3, 2012

How to create a lisp to automatically export attributes from selected blocks to defined txt file without having to everytime confirm the file name, location and if the file shall be replaced?

Meaning is that I often export attributes to txt file for further use. It is always the same file (I just overwrite it always).

The way I do it now is selecting blocks, using ATTOUT command, then going to the desktop, selecting ATT.txt file and confirming that it is to be replaced.

Is there a way to make lisp or script that will just do all it in at once?

I found on forum such a lisp as below, but it exports all ablocks on drawing and it exports to txt file which is located in same  place as drawing and with same name as drawing. Tried to modify it but without success:

(defun cut-att ()
(load "attout")
(setq fna (strcat (getvar "dwgprefix")
(acet-filename-path-remove (acet-filename-ext-remove (getvar "dwgname")))
".txt"
))
(setq ss (ssget "X" '((0 . "INSERT") (66 . 1))))
(bns_attout fna ss)
)

Same question for ATTIN - I use attin and always same file name from same location - how to automate it with one command?

View 9 Replies View Related

AutoCAD .NET :: Select Nested Entities

Jan 3, 2013

I select all entities via Editor.SelectAll() method, but the nested entities (inside Blocks) are missing. Do I have to resolve them by iterating through all blocks afterwards or is there a Prompt Selection Option that can be set?

I don't want the user to select the entities, instead I loop through the whole drawing.

View 7 Replies View Related

AutoCAD .NET :: Add Text In Nested Transaction

Oct 9, 2013

Im trying to figure out what I can do differently in my code to have it show the newly placed text immediately after choosing an insertion point. Im guessing it has to do with a nested transaction and my loop, but Im not sure how to fix.

The code below is to label the layer of a selected entity. If in paperspace, label in paperspace and if in modelspace label in modelspace. Ive been testing this on the "blocks_and_tables_-_imperial.dwg"

Imports Autodesk.AutoCAD.RuntimeImports Autodesk.AutoCAD.ApplicationServices.ApplicationImports Autodesk.AutoCAD.DatabaseServicesImports Autodesk.AutoCAD.EditorInputImports Autodesk.AutoCAD.GeometryImports Autodesk.AutoCADImports Autodesk.AutoCAD.ApplicationServicesPublic Class Class2 Public Function myAnnotate(myDbIn As Database, mySpace As String, myTextContents As String, mySTPT As Point3d) As ObjectId
[code]........

View 3 Replies View Related

AutoCAD .NET :: Creating Nested Block

Sep 18, 2013

sample code for creating nested blocks.

View 4 Replies View Related

AutoCAD .NET :: Unable To Create Nested Groups?

Aug 25, 2013

I am able to create groups in autocad 2013 using .net but unable to create nested groups. I am talking about nested groups not nested group layers. 

View 9 Replies View Related

AutoCAD .NET :: Get Position / Location Of Nested Entity

Apr 16, 2012

I am trying to get either location, insertion point, or center of an entity that is inside of a block. I'm getting subentity using the Editor.GetNestedEntity. I create a FullSubEntityPath for highlighting, that works well, and I have looked at using GetSubEntityGeometricExtents using that same subentitypath, but not having any luck, I can't seem to find any documentation on using that method.

I know I can get the location of the owner, then calculate the location of the entity based off of that, but I'm looking for an easy way now, if that don't work out, I can do the lengthy approach.

View 1 Replies View Related

AutoCAD .NET :: Selection Of Multiple Nested Entities?

Jan 11, 2013

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?

View 5 Replies View Related

AutoCad 3D :: Difference Between Circular And Nested Xref

Aug 18, 2011

this question is related to 3D modeling in HVAC detailing, piping and plumbing

What is the difference between a circular and nested xref?

View 4 Replies View Related

AutoCAD 2010 :: Nested Xref Layer Colors

Aug 17, 2012

My question pertains to layer colors from xrefs that have other xrefs nested inside them.

When I get xrefs from the architects, I get a building layout, RCP, space layout, etc.  I tie all these together into a single "architect base" xref so I don't have to attach 4 xrefs to each new file I create.  What I would like to be able to do is set all the layer colors in the misc. architect xrefs in my "architect base" file and have those color settings propagate into my drawings as I create them.  This comes into play especially if I have to create a new drawing late in the project, and I don't want to have to go set hundreds of layer colors individually. ?

Visretain comes to mind, but visretain (if I'm correct) is really for keeping xref color settings in your current file from session to session, not in a new file that you are creating using an xref.

View 5 Replies View Related

AutoCAD Civil 3D :: NCopy Copy Nested Objects

Aug 2, 2012

The NCOPY command used to allow you to copy a nested object onto the current layer in the active drawing. Now, in 2012, it seems to copy the nested object, but it brings the reference layer with it.  Is there a setting that can be changed so I can still do the former?

View 2 Replies View Related







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