AutoCAD .NET :: Selecting Blocks / Entities
Jul 12, 2013
I have some blocks which are placed with some routines in VB.net and are linked by a unique code to a external data file (XML-file). I want to try to created a kind of propertybox (in a toolpalette) which indicate some of this external data values. If one of these values are changed (by changing the values in the propertybox), some routines need to be executed.
Is it possible when a object is selected (not during a command), to run a piece of code (VB.NET). I have found some basic principles about "overruling" but I'm not sure this is the correct/possible way to solve the problem and I'm not there yet.
View 4 Replies
ADVERTISEMENT
Jan 15, 2013
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?
View 1 Replies
View Related
Nov 21, 2012
I am missing entities when I try to pick on them.Not window, not crossing. Just trying to pick an entity. I usually select entities first before my command.
Is there a variable that might have changed? I played with PICKBOX & APERTURE but this doesn't change anything when I try to select something. I can have the entity in the box right next to the intersection of the crosshairs and instead of selecting the entity it starts to window.
I have a logitech m705 mouse w/ setpoint software ver 6.32.7 & driver ver 5.33.14 installed.
View 6 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
Jun 12, 2013
I realize that i don't understand how to use constraints (specifically how to "fully constrain" entities) in my dynamic block.
attached is a sample of what i've got. (note the small circle at the insertion point that has 4 lines in it - i used these to base my angle constraints on)
upon inserting the first instance, everything behaves as i'd like. but once i stretch out the bubble, it seems to go back and automatically update the definition so that the next instance i insert is using the first instances dimension as the starting point.
View 2 Replies
View Related
Nov 27, 2012
I want to code this lisp. The problem which I face is, In some drawings which come from the client, there are a lot of blocks.
I want to detect the blocks which has no sub-entities (but attribute) and add a rectangle inside this block, If it is an attribute add a line from 0,0, to insertpoint of attribute.
View 5 Replies
View Related
Jul 27, 2012
I am running AutoCAD 2012 Electrical. The source wiring diagrams I am working with have attributed blocks all over the drawing. For my purposes, I dont need to export the data, but I do need to change the drawing. When I use "Burst" or "Explode Attributes to Text" in the Express Tools menu, it does change the attributes to text. However, it throws all the data that is in in the attribute all over the face of the drawing. This is extremely time consuming to delete them as some are micro small text.
I need a command that will explode the attributes to text, turning the blocks into entities, as if there are no blocks at all.
View 2 Replies
View Related
Dec 17, 2012
I took the time to search and was unable to find anything that seemed relevant. I have also had trouble figuring out the documentation.
Is there a way to select a specific grip within a dynamic block and then update its position?
View 6 Replies
View Related
May 24, 2011
I have a multiple blocks in my drawing and I would like to select certain obejects within these block from model space, i.e all lines = White, and then return their their combined length.
At the moment I have to explode all of the blocks, use qselect, run length.lsp to get the combined length of the selection and then undo the actions previous to the block explosion.
View 3 Replies
View Related
Sep 26, 2012
Is it possible to select visibilty states of a dynamic block in a drawing, for ex. to count how many of each visiblity are in a drawing?
Ex.:
I have a drawing of a big pile plan with al lot of various piles in there. I made one dynamic block of the pile in which i can select what kind of pile i want to have visible. Now i want to count how many of each pile is in the pile plan.
If all different piles would be different blocks i could easily count with 'Block Reference' in 'Quick Select', but i dont know how to do the same with a dynamic block (which has one block name only) and its different visibilities.
View 1 Replies
View Related
Jul 30, 2013
I used to have a lisp routine that would allow me to pick one dynamic block and it would select all instances including the blocks that have become anonymous.
View 5 Replies
View Related
Mar 28, 2011
I have the attached file as a dynamic block.
Last week I opened the drawing and added some visibilty states etc. to the block.
Now when I open the block or insert it into another drawing for whatever reason the cursor or crosshairs stop at the edge of the block. And if you move towards the middle of the block where there isn't any lines etc. the cursor will move to that point until you hit another line then it will stop moving again.
I've been reading some other posts for different dynamic block topics/issues and read that everyone has problems when you get to higher numbers of visibility states, but when I edited last week I only added 7 states. Is that enough to make this happen? It sounds like everyone else that is having problems has far fewer visibility states than on the attached drawing.
View 1 Replies
View Related
Sep 25, 2008
I am having a problem with a delay in selecting an object and selecting a command.
When I select an object the pointer has at least a 3 second delay before it starts moving around normally again. It is the same with selecting a command. This has started to get tedious. It has worked fine in the past so I don't think it is a RAM/graphics card problem.
View 5 Replies
View Related
May 15, 2012
OK, today, or actually just this afternoon I've noticed it has become much harder to select items with the mouse.
Points, nodes, etc...anything where you'd typically hover the mouse over the item and it highlights for you to select it.
For example, lets say you want to project a point from another sketch, or select the center node of a line, etc.
Never really had an issue until this afternoon where now it seems I have to be right on top of the item and I cannot budge one bit or it won't select it. It is now taking me numerous attempts to select things like points (zooming in does not work, points scale accordingly).
Is there a setting somewhere? I can't seem to find such under Tools>Application Options and the like.
View 8 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 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
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
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
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
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
Feb 6, 2012
I received a drawing from an outside contractor that uses something with proxy entities. I can see them just fine on the screen but when I try to plot the drawing they disappear. It also came from a newer version so I had to use the DWG True View to convert it if that may have caused my issue.
View 5 Replies
View Related
Feb 6, 2013
I'd like to automatically hatch all visible polygons of a drawing. My vision of how to solve this is basically:
- for each visible drawing do
- pick internal point
- hatch
- end for
I'm having trouble by automatically picking an internal point inside the polygon.
I've found these two methods : Crossing numbers and winding numbers [URL]....... but they don't seem to work if there are some polylines inside an polygon.
Is there another solution to my problem for automatically picking an internal point inside a polygon ? Can I automatically hatch an polygon without picking it's internal point ?
View 5 Replies
View Related
Nov 27, 2013
My code takes the selected entities and reads out all the text of the attributes.
If no blocks are selected, the code prompts for a selection.
Unfortunately, by ending the transaction, the entitis are deselected.
So how to keep the selection, because it will be handled in a follow-up step.
Below a shortened code for the procedure:
private void Get_Text(){ Autodesk.AutoCAD.Internal.Utils.SetFocusToDwgView(); PromptSelectionResult sel = edt.SelectImplied(); if (sel.Status == PromptStatus.Error) { TypedValue[] auswahl_typ = new TypedValue[] { new TypedValue((int)DxfCode.Start, "INSERT") };
[Code] ......
View 1 Replies
View Related
Nov 26, 2012
I try to get all current entities for my own custom palette.
I tried it with ed.SelectionAdded and ed.SelectionRemoved but it doesn't work if I for example pressing ESC.
I want to get the Object Ids saved in a ObjectIdCollection and I don't want to run an autocad command every time.
View 1 Replies
View Related
Nov 24, 2011
I wrote a program that trys to move all the entities in a dwg file by calculating a grid transformation for each point in each entity. For example to move a pline
Case Is = "AcDb2dPolyline"
Set o2DP = oEnt
retCoord = o2DP.Coordinates
For j% = 0 To UBound(retCoord) Step 3
yaa# = retCoord(j%)
[Code]...
My problem is moving hatch entities. I haven't succeeded in finding equivalent code to move the hatch entities. I did find another post here, but I still don't get it.
View 6 Replies
View Related
Aug 23, 2008
Just a follow up to the inquiry on the Flatten command. Is there a way to use set all entities in a drawing to elevation 0? like moving them all to Z=0 like the flatten command but all entities in one command including blocks, hatches, etc.
View 9 Replies
View Related
Jan 16, 2012
I'm trying to make a curved wall with different heights, but i can't manage to do the loft of the object. I keep getting "The selected entities are not valid."
I tried remaking all the little polylines but nothing seems to work..
View 9 Replies
View Related
Jan 4, 2012
How can I trim entities in an array? I can make the array just fine, but I don't know why it won't let me trim them. I suppose it's trying to keep references to the array and the original entity that the array is based off of, but at this point I don't wish to keep that information.
View 5 Replies
View Related
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
Aug 22, 2013
We have a new title block which now contains various fields to automatically populate the drawing number, number of sheets, issue etc. The problem we have is when we go to zoom all or extents on a layout tab it moves the layout to the right each time. If we only have one layout or we use a plain title block i.e. with no fields, the zoom works fine (layout stays put in the center). This is also true if we directly insert a field onto the layout - again no problems.
The cause of the problem only happens when a block containing a field is inserted onto the paper space of a layout and,there are multiple layouts containing blocks with fields.
View 6 Replies
View Related