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
ADVERTISEMENT
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
May 1, 2012
My primary goal in this exercise is to select a nested polyline within a block and have access to its grips. I'm still not even sure if it's possible.
However, before I'm even getting to that stage I'm hitting some problems. I have some custom objects which all in some way or another inherit from BlockReference:
BlockReference
-Derived Abstract Class with common attributes
-Derived Concrete Class1
-Derived Concrete Class2
-Derived Concrete Class3
I insert instances of my derived concrete classes using jigs( Class2 for example is created using a polyline jig). However, when I select the block generated from it using a PromptSelectionResult, it returns a BlockReference, not the derived concrete class, not the derived abstract class.
When I try and cast that as the correct class type I get an error telling me I can't cast from the Base class to any of the derived classes.
So, firstly, why is it returning a BlockReference when the object I'm clicking on is an instance of a type that indirectly inherits BlockReference? And is it even possible to gain access to a nested entity's grips? I followed post here: [URL] .... but it doesn't give me what I need.
I've tried ed.GetNestedEntity and the AllowSubSelections property of PromptSelectionOptions and had little joy.
View 3 Replies
View Related
Oct 4, 2013
How do I select entities by extent. Let's suppose I have Lowerx ,lowery , upperx , uppery [174.76789855957,28.3978977203369 , 507.941253662109 ,112.090751647949 ]. How do I find entities who have these extents.
View 1 Replies
View Related
Oct 8, 2012
How to select all entites of a layer?
I want to migrate my VB code to VB.NET code, migrate the below code?
Private Function GetEntities(oLayerCollection As Collection, sSelectionSetName As String, _ Optional pointsList As Variant = Empty, _ Optional mode As AcSelect = acSelectionSetCrossingPolygon) As AcadSelectionSet Dim oSS As AcadSelectionSet
[Code].....
View 2 Replies
View Related
Oct 10, 2012
I need a function similar to Qselect.
In this case I would like to select all entities on a series of layers. (i.e.: a-site-* or a-fill*). I know I can do this with qselect by doing each layer one at a time and append the existing selection set.
Instead, I've been locking all layers except the series I'm looking for, but it seems like there should be a quicker way.
View 9 Replies
View Related
Jun 11, 2013
I have a command which proccess entities in the drawing and creates a SelectionSet. But, on the drawing i do not see the selected objects . I need to show grips on selected objects . It is a looks like a Quick Select command. What can i do? What method showing the grips?
View 2 Replies
View Related
Jul 25, 2013
I coded a utility to work with entities rotation. This is a part of a bigger project so i just cutt and pasted together the part of code that have this problem.
Basically i get the selection, i clone it (because this is a copy and rotate) and through a draw jig class i rotate all the entities. This works well but just sometimes when the command ends it happened this weird thing, the entities appears in the draw but they can't be selected. And all get back to the normally after saving, closing and reopening the draw.
This is the utility.
public void Run(object param) { Document doc = Application.DocumentManager.MdiActiveDocument; Editor ed = doc.Editor; Database db = doc.Database; List<Entity> toRotate = new List<Entity>(); PromptSelectionOptions pso = new PromptSelectionOptions(); pso.MessageForAdding = "
Select objects"; pso.AllowDuplicates = false; pso.AllowSubSelections = false; PromptSelectionResult psr =
[code]........
This is the link
[URL]........
View 2 Replies
View Related
Jun 23, 2011
When trying to select entities with a window or crossing polygon (and hitting enter) there are no grips showing to indicate that the selection has been completed even though the entities seem to be highlighted. Syntax: select, enter, wp, enter (draw polygon), enter.
I am a part time user of this wonderful program and only recently moved to 2010 and yet I cannot figure out what I am doing wrong. I have Googled and looked in my texts and still am having difficulty (also attempted to search FAQ on this site but the link malfunctioned).
View 9 Replies
View Related
Sep 27, 2012
When I select more than 100 entities all of the grip points disappear. With ACAD 2002 there seemed to be no limit to the number of entities you could select without losing the grips, but with ACAD 2007 they started dissapearing though with '07 clicking "View" "Regen" would bring them back into view (unless you accidentally click on another entity). With ACAD 2013 if I go over 100 that's it. This is mostly a problem for me as I use the spacebar shortcuts extensively in creating and manipulating my drawings. I have found other ways to to acomplish my needs such as using the move command but I have much successful history using my old methods and would like to continue with them.
View 3 Replies
View Related
Jul 25, 2011
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.
View 2 Replies
View Related
Mar 19, 2012
We have this need to have all of the solids in a drawing to be placed in the "solid" layer.
Sometimes folks are drafting lines to develop these solids, and keeping the lines on the "solid" layer, rather than moving them to another layer, or deleting them altogether.
I could get folks to run this command before leaving the drawing.
I'm thinking something along the lines of:
Select all entities that are on the solids layer that are not solids.
If nil, great, do nothing.
If entities are selected, let me do something with them.
I'm hoping the following can be modified ever so slightly.
(setq non_solid (ssget "X" (list (cons 0 "3DSOLID")(cons 8 "solid"))))
View 4 Replies
View Related
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
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
Sep 18, 2013
sample code for creating nested blocks.
View 4 Replies
View Related
Apr 13, 2012
Is there a quick/easy way to know if a DWG contains nested blocks?
View 6 Replies
View Related
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
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
View Related
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
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
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
Sep 23, 2011
looking for a way to read in the DXF data for a surface entity in AutoCAD2012. There's plenty on reading in simple objects (e.g. 3DFace, Points, etc.) but nothing on surfaces. The data itself is also not as intuitive as I would have hoped. The DXF reference PDF from AutoDesk shows 7 possible unique entries and the data I need is most likely stored in the proprietary data. So, in short I know where it is but how can I read it?
View 7 Replies
View Related
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
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
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
Nov 27, 2013
I need to pick a nested block in drawing, I prepared this code to get name of selected blocks:
(defun c:test ( / e obj blkName)(while T (while (Not (setq e (entsel "
Select a BLOCK to edit: ")))) (setq obj (vlax-ename->vla-object (car e))) (if (= (vlax-get-property obj 'ObjectName) "AcDbBlockReference") (setq blkName (vlax-get-property obj (if (vlax-property-available-p obj 'effectivename)'effectivename 'name)) );setq );if (princ (strcat "
Block Name is: " BlkName)));while);defun
But, how to select a nested block?
View 4 Replies
View Related
Apr 15, 2012
how I can export the nested data of Cogo Points. I need to get them into a spreadsheet.
I have tried exporting a .shp file and opening the .dbf file in excel, however, it only seems to export the data field of the table and not the value.
View 9 Replies
View Related
May 2, 2012
How can I update the file path to an XREF which is NESTED? I point the file to the appropriate xref and even though I save the file it won't point back to the file upon opening?
View 7 Replies
View Related
May 22, 2012
How could I get the ObjectIdCollection of all entities (points, polyline) in a certain layer?
I am using the following code at this moment.
private ObjectIdCollection GetEntitiesOnLayer(string layerName)
{
Editor ed = doc.Editor;
TypedValue[] tvs = new TypedValue[1] { new TypedValue((int)DxfCode.LayerName, layerName) };
SelectionFilter sf = new SelectionFilter(tvs);
PromptSelectionResult psr = ed.SelectAll(sf);
[code]....
But it seems the function fetches more ObjectId than I expected.For example, if I draw 3 points and 2 polylines in "A" layer.
ObjectIdCollection obc = GetEntitiesOnLayer("A");
int i = obc.Count;
I was expecting i to be 5 (3 points and 2 polylines), but i seems to be more than 5.
View 2 Replies
View Related
Sep 8, 2013
I have the dialog window with the settings for entities graphical appearance used in my plugin.
My goal is to create the same preview as AutoCAD dimension style manager dialog has, the dynamic thumbnail of the entities while user changes the settings in dialog.
Probably one option is to create temporary block (created based on data from settings dialog) and then use BlockTableRecord.PreviewIcon, but I am not sure if there is some other way.
View 2 Replies
View Related
Nov 6, 2013
I have a requirement to find all connected entities on a given line of a plant P&ID. In other words given a certain line or reference point the requirement is to 'walk the line' and list off all entities (with certain attributes and in order) that are connected on a line.
Now not having any experience with underlying object models and API's, whether A) this is possible B) which object model to use - I'm a bit confused as to which one to use.
View 1 Replies
View Related