AutoCAD .NET :: Ignore Objects In A Selection Set Based On Coordinates?
Apr 4, 2013
I'm working on a command that lets me select polylines on a specific layer, then converts them to 3d solids. I'm having a slight issue where if a polyline has the same start and end coordinates (this happens in some of our drawings), then the command stops and I get an eDegenerateGeometry error. I want to modify my command so that it detects these objects, removes them from the selection set, and then notifies the users of their prescence so they can be removed manually. The last part i think I can handle, however I'm not sure how to modify either my filter or my routine to detect and ignore these objects. I'm assuming that since i'll want to record these objects to later notify the user, that i'd probably want to modify my routine.
using System;using Autodesk.AutoCAD.Runtime;using Autodesk.AutoCAD.ApplicationServices;using Autodesk.AutoCAD.DatabaseServices;using Autodesk.AutoCAD.Geometry;using Autodesk.AutoCAD.EditorInput;using Autodesk.AutoCAD.DataExtraction;using Autodesk.AutoCAD.Colors;using System.Windows.Forms;
[code]...
View 2 Replies
ADVERTISEMENT
Jan 17, 2012
how to create a selection set based on a specific Multileader style? I can currently creating a typedvalue array to define the filter criteria, but cannot find the DXFCODE for the Multileader style.
Ex.
TypedValue[] acTypeValAr = new TypedValue[1];
acTypeValAr.setvalue(new TypedValue(DXFCODE, "Multileader Style"),0);
View 2 Replies
View Related
May 17, 2012
I'm trying to select two specific types of blocks from a drawing so that I can create layouts for each one of the pairs of blocks in my drawing. Basically, one block is the outline of the piece of the drawing and the second contains information about the drawing. I would like to select all of the outline blocks and then create a selection to get the second block which is inside the bounds of the first block.
I'm not sure how to create a set of typed values to do this. Here is my code so far which sets up a filter to get the first block and then for each of the blocks that it finds, it would select the block with all of the information which is where I am having problems. I don't know how to create a filter based upon location of the block.
using (Transaction tr = acCurDb.TransactionManager.StartTransaction()) { filList = new TypedValue[] { new TypedValue((int)DxfCode.Operator,"<and"), new TypedValue((int)DxfCode.Start,"INSERT"), new TypedValue((int)DxfCode.BlockName,"D-1*"), new TypedValue((int)DxfCode.Operator,"and>")}; // Build a filter list so that only block references are selected filter = new SelectionFilter(filList); //Select all res =
[code]........
View 2 Replies
View Related
Dec 20, 2011
I am busy writing a small app to find a best fit circle through a series of points that roughly follow the profile of an arc. This data was scanned in using a Farro arm and imported to AutoCAD.
I would like to use VB.Express and the AutoCAD API. So far I have managed to write some code (loosely based on some examples from the AutoCAD .NET Developer's Guide) to allow the user to select the points to process.
I have three questions around this issue:
a.) How can I set up a selection filter to limited the user's input to 2d points only?
b.) Once I have the selection set of points, how can I extract the "X" and "Y" values of each of the points to be able to process further?
c.) Is there some sort of Object model diagram for the AutoCAD API that I can download, or any (downloadable) literature to get started with the API and VB.Express. I have looked online for some books and Amazon list them, but a. they are in hardcopy format and b.) the most recommended one (i.e. VB.NET Programming for AutoCAD Customization - Level 1 Jeremy Winters) is out of print. I am specifically looking for downloadable books because of the delivery times and shipping costs to get a hard copy.
View 6 Replies
View Related
Nov 12, 2013
Is it possible to constrain the location of one object based on the intersection of two other objects (for example, force the midpoint of one line to be at the intersection of two other lines?)
The reason I want to do this is specific to Civil 3D.
View 9 Replies
View Related
Mar 27, 2013
I have some blocks that are associated with regions in my drawings. I want to select regions based on attributes in the associated blocks. Is that possible?
Is it possible to link my blocks to an external database and select the regions based on a field in the linked database?
View 1 Replies
View Related
Dec 15, 2011
can do a routine that zooms into a coordinate, based on input. So for 1A, it would zoom into the coordinate for 1A.
1A = 1,1
1B = 1,2
1C = 1,3
1D = 1,4
I will try to attempt one shortly and will post it within 1 hour.
View 9 Replies
View Related
May 19, 2013
I am still having trouble moving objects to precise coordinates. For instance, the thing I drew may be in the correct position in the x-y plane but I want to move it in the positive z direction a precise number of units. Or move it along the y axis by specifying where I want it to be not how far I want it to move.
I see...just use the tab key.
View 9 Replies
View Related
Sep 22, 2013
We are looking for a solution to manage the inventory of a very extensive network with mainly linear assets. Instead of a standard database/inventory solution, we would like to manage the inventory from a plan, from autocad DWG. Meaning that all the objects and relations between objects are defined in the DWG, then uploaded to a relational database and used by various maintenance and operational utilities.
how we would define the relations between objects. For example, how would we say that one object is attached to another object? Can you make a reference from one object to another in the attributes of a block? (but it has to be a strong reference, to an ID).
View 3 Replies
View Related
Jul 27, 2009
If I have a layer that is smaller than the canvas, and I want a selection that matches the contents of the layer, how do I do that? Looked at the keyboard shortcuts and faq but didn't see it.orry, I'm a programmer trying to find his way in photoshop.
View 5 Replies
View Related
May 23, 2012
I created the following user parameters:
-Thickness
-Width
-Length
-Dia
I then created a Custom iProperty which consisted of the following "formula": Finished Material Size = <Thickness> x <Width> x <Length> Lg.
eg. of Finished Material Result : Finished Material Size = 6 x 25 x 300 Lg.
The problem comes up when dealing with diametrical components as the above formula will only populate for square or rectangular parts. Which would work if I could use iLogic code to populate the Finished Material Size iProperty. I have tried but failed.
First I created another user parameter called "Geometry Type" which has a drop down selection of either "DIA" or "SQUARE, RECTANGULAR".I then created the following iLogic code to set 0 as the value for the "unused" size parameters
If PART_GEOMETRY = "DIA" Then WIDTH = "0"If PART_GEOMETRY = "DIA" Then THICKNESS = "0"If PART_GEOMETRY = "SQUARE, RECTANGULAR" Then DIA = "0"
The part I just can't get to work is as follows.
I need some iLogic code which will populate the "FINISHED MATERIAL SIZE" custom iproperty with one of the following based on my "GEOMETRY TYPE" selection. "DIA" would return the following to "FINISHED MATERIAL SIZE": = Ø <Dia> x <Length> Lg.
While "SQUARE, RECTANGULAR" would return the following to "FINISHED MATERIAL SIZE": = <THICKNESS> x <WIDTH> x <LENGTH> Lg.I tried the following code but it does not work:
If PART_GEOMETRY = "DIA" Then iProperties.Value("Custom", "FINISHED MATERIAL SIZE")= "Ø"DIA "x" LENGTH "Lg."If PART_GEOMETRY = "SQUARE, RECTANGULAR" Then iProperties.Value("Custom", "FINISHED MATERIAL SIZE")= THICKNESS "x" WIDTH "x" LENGTH "Lg."
View 2 Replies
View Related
Mar 29, 2012
Is there a way to make a New file based on the current selection?
View 2 Replies
View Related
Jun 7, 2011
I am using Maya 2012. I am doing a tutorial for Maya 2011. It is directing me to do some selecting and transformation to my mesh using camera based selection. The tutorial says:
1. double click the selection tool icon in the toolbox. the tool settings editor appears.
2. In the common selection options selection underneath marquee, turn on camera based selection.
3. Right mouse click the mesh and select vertex from the marking menu. The vertices appear on the mesh.
4. While looking at the front of the mesh, select the vertices that need to me moved by holding the left mouse button at one corner dragging a marquee selection over them. the vertices should be selected.
I selected the “turn on camera based selection” in the selection icon toolbox settings editor. But I can’t select the veritces using a left mouse click bounding box or by selecting the vertices individually. The vertices just won’t highlight or select. If I want to select I have to turn off the camera based selection.
View 1 Replies
View Related
Jun 13, 2013
I am looking for a way to extract (filter) all polylines, and loop a lisp based on the number that are found within a "W" selection window.I am frustrated getting "malformed list" or errors, even after defining "n" for repeat.The code I have so far looks like this:
(defun cWW (/ p1 p2 sspw myObj ss)
(setq p1 (getpoint "
Pick first corner: "))
(setq p2 (getcorner p1 "
Specify opposite corner: "))
(if
(setq sspw (ssget "W" p1 p2 '((0 . "*POLYLINE")))
[code].....
Without the (repeat () portion, it was working ok with selection window, however it only would run the commands for a single polyline. What needs to be done without overhauling the code? The lisp has worked on a drawing-wide basis, however needs to run on only on user-windowed polylines since there are other polylines within the drawing which are attached to layouts via viewports.
View 9 Replies
View Related
Mar 12, 2012
I saw a macro that does this a while ago, but I could very well be wrong. If it doesn't already exist, I am not even sure if it is possible, so I thought I'd ask the Macro Masters here!
Lets say I have a page fill of objects/shapes/text with all sorts of different colors.
I select the black color (or whatever color) but would actually like to select ALL colors other than the black color that I have selected.
So, if I have a page with Black, Red, Green & Blue shapes, I select an object colored black, the macro would then select ALL objects/text on the page that are NOT black.
View 11 Replies
View Related
May 24, 2013
I am just starting learning lisp, And I am looking for a fast way to select multiple objects (usually circle) and export their coordinates and ID into a excel sheet through lisp programming.
As you might see in the attached drawing, the red circles are objects wanted. I have been trying to export their coordinates as well as their IDs in grids, e.g D28, Easting: Northing: . I still haven't found a good way to export ID for each circle.
As my code doesn't work, I wonder what's the most effective way to detect errors in lisp
View 5 Replies
View Related
Jul 20, 2012
Is there a plugin in existance, that I can make a selection in Photoshop and then copy the coordinates of that selection to the clipboard?
I am a texture artist and frequently lay a number of graphics out in one file, before typing out the coordinates for each element. Currently this is slow manual task, but could be made so much faster if I didn't have to type everything out.
View 8 Replies
View Related
Jun 29, 2012
I'm relatively new to 3ds max and for a project I need to be able to get a list of all objects along with their respective coordinates. I've found ways to get the object list, but none of them display the coordinates?
View 2 Replies
View Related
Jan 17, 2014
I did some work with ai and want to export the coordinates of my objects to csv or excel. Is this possible and if yes how?
View 2 Replies
View Related
Jun 20, 2012
Say I have 2 items, one is on layer "M-Duct" and the other on "M-Pipe" (they are in the same drawing). Any lisp routine that would create the layers "M-Duct-New" and "M-Pipe-New" (based on the same color and LT as the original layers) and then move those objects to the newly created layers?
View 9 Replies
View Related
Aug 25, 2012
Is there any way to enter exact position coordinates ( x, y) and dimensions for objects in P'shop? For example, putting a photo in an exact position and sizing it by other than dragging handles with the mouse?
View 3 Replies
View Related
Jan 17, 2014
I was hoping to create a JS script to move objects away from common center based upon their current position. I was thinking to use a single selected path item as the center based on its position x/y and width/height. Using this reference point the script would then move away all other path items from this center point based on a desired amount and with uniform increments given their current location from this center. I was thinking cos and sin would be my friend in this case, however they seem to have become my foe instead. ;-)
Does this sound doable? What am I missing, doing wrong, misinterpreting? Below is a non-working attempt, I can't seem to sort things out, perhaps I was close and missed it or maybe I am super way off and its more complex than I thought. However at this point I am confused across my various failed attempts this only being one of them.
// Example failed code, nonworking concept
var docID = app.activeDocument;
var s0 = docID.selection[0];
pID = docID.pathItems;
var xn, yn;
var stepNum = 20;
[Code]....
View 13 Replies
View Related
Jul 19, 2012
I have been using autocad for a while and have always been able to use "R" to remove objects from a selection set. All of a sudden now when I want to use that command it activates the "Redraw" command instead of letting me remove objects from my set.
How to get it back to the way I had it before?
View 9 Replies
View Related
Dec 22, 2011
After a few hours of everything working perfectly, AutoCAD will suddenly decide to select objects slowly (for move, copy, trim, erase etc. commands). There will be a short time lag between picking a point on the screen and creating the selection box.
The problem is only rectified by switching off the pc and rebooting.
View 9 Replies
View Related
Jun 18, 2012
i am trying to translate a Point coordinates from Paperspce to world coordinates in model space.The code i used in Land2006 worked OK but now in Civil3d 2012 it doesn't!
Private Sub GetPlais_Click()
Dim tmpnt1 As Variant, tmpnt2 As Variant, tmpPnt1 As Variant
Dim lole(0 To 2) As Double, upri(0 To 2) As Double
Dim returnobj As AcadObject
FrmGrid3.Hide
On Error GoTo Eline
ThisDrawing.Utility.GetEntity returnobj, tmpPnt1, "ÅðÝëåîå ôï ViewPort ðïõ èá äçìéïõñãçèåß ï êÜíáâïò!"
If TypeOf returnobj Is IAcadPViewport Then
[code]........
View 1 Replies
View Related
Jul 1, 2012
I add an entity to the PICKFIRST selection set as follows.
Editor.SetImpliedSelection(new ObjectId[] { oiTarget });entTarget.Highlight(); // Entity.
After this, I can type the CAD command "erase", and the selected entity is erased. However, if I press the DELETE key the entity is not erased (nothing happens). Why is that?
If I select something on screen with my cursor, the DELETE will erase it.
View 5 Replies
View Related
Dec 6, 2012
I have an array of all the same block with a few attributes. All attributes need just slightly different data (like incrementing numbers). It is extremely tedious to select the block, enter the data, cancel the selection and then select the next block. Is there an easy way to select all the blocks up front and then modify them one at a time by "cycling through the selection"? I'm specifically looking for a key-command that will de-select the current block and select the next one so I can stay in my properties window.
It's also worth mentioning that I'm on LT and there aren't enough blocks to make ATTOUT/IN worth it (or possible).
View 2 Replies
View Related
May 16, 2013
I am having trouble with my selection box. Ordinarily, when I am trying to select multiple object, I can just create multiple selection boxes and it keeps adding more and more objects to my selection. However, it recently started acting funny--it stopped selecting things after the first box was drawn. No matter how many boxes I drag, it won't add any more objects to my selection.
View 3 Replies
View Related
Aug 8, 2012
How can I change the settings, so that only one object will be selected at a time --> selected objects will be deleted from the selection, picking another object without pressing the 'shift' button?
View 7 Replies
View Related
Aug 21, 2013
I'm a GIS analyst trying to learn Cad. I'd like to place a single point in autocad model space at a specific Northing/Easting position. After reading several forum threads I don't think CAD allows me to change the coordinate system of model space from map coords to northing easting coords, as we can in GIS.
View 5 Replies
View Related
May 11, 2012
My question is, if there any tool /command, utility in autocad to select all objects of one type at one time : for example all text objects or all dimention objects if these objects on different layers and have different properties. in my work I have to insert many blocks(not annotative) or parts of drawings which were created by other people and have different from mine settings and properties of text and dimention objects. the insertions add so many layers and objects that I spend lots of time to correct them and to figure it out.
is there any way( command, utility) to select and manage all of these objects at one time?
P.S.i think it is very unconvenient that the plain autocad does not have dimentions and text as families or some sort of groups that s easy to manage.
View 1 Replies
View Related