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 ?
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.
I'm working through a tutorial on [URL] drawing and attempting to hatch the second Extra Practice assignment at the bottom of that page: [URL] I've drawn it from a closed polyline with a circle overlapping it but I'm not sure how to assign different hatches to each of the six sections as shown in the second link above. I've tried opening the hatch dialog, selecting the polyline and choosing points, but I can't get there. I exploded the polyline into lines and tried selecting points again, but no good. I tried selecting the entire (unexploded) polyline, but I can't assign individual different hatches to each section - I just get the usual all/in-out, etc. behavior. I assume I could manually construct entities to match each section, but that gives me the same bad vibes as using goto when programming. Just doesn't seem right.
Our engineering department users are facing this problem that the hatch patterns are not visible. Everytime they have to use the FILL command when they open any drawing. They are facing this problem with some dwgs, when anybody else opens the same drawing this happens again. After that they are unable to see the hatch patterns in any drawing. After using FILL it becomes visible but restrting the AutoCAD reverts the setting back so they unable to see the hatch pattern again. After opening that dwg in all files they are unable to hatch.
I have a hatch (ANSI31) enclosed by a closed polyline. Whenever I change the hatch from ANSI31 to GRAVEL some of the hatch shows up outside the boundary. The Polyline consists of both arcs and line segments, and the hatching errors are occurring within the radius of the arc segments. Changing it from Associative to Non Associative makes no change.
I am in need of a lisp routine which will automatically pick up all hatch and solid hatch patterns within a drawing and change the colour to colour 254.
Just downloaded Autocad 2013 and am missing quite a few of the standard hatches (siding, soldier, board and batten, etc.) What should I do to get them back. When I open old drawings with these hatches in them, they load just fine...but I am unable to hatch any new areas with these hatches (because they are not listed in the hatch library)
I want to be able to add a Block Reference to a hatch. I'm adding the block reference to an ObjectIdCollection and the hatch is not taking it when using AddLoop().
So I thought maybe I needed to add the location of the polyline (curve-like) object that is member of the blockreference to the hatch, but I don't know how to get its ObjectId.
Also, I'm trying to delete certain HatchLoop that is associated to a polyline but I don't know how to do it. I'm going through the loops in the hatch but I don't know what to do there. I wanna do this so I create a new and different hatch on top.
I think one could also copy all the loops except the one one wants to delete, but I'm not sure how to tell which one is the one I want to delete that is the one associated to a polyline or that is in certain region.
I've migrated from 2005 to 2014 LT and wondered if they have added to the hatch commands. I've looked and haven't found anything. Is there a command that you can pick a hatch pattern already shown on the drawing and make that pattern the existing one to use? I sometimes have multiple hatch patterns and scales, and wanted a quick way to go from one to another without lisp help.
Why is my hatch off set from what I want to hatch? I pic the points of the area in 3d i want to hatch but it ends up hatching out of the points i select?
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?
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.
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.
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.
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.
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
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.
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.
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.
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..
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.
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.
What i want to do is popluate a Listbox with with the area of previously selected Objects.This is what i have at the moment:
i = 0ListBox1.ColumnCount = 2For Each ssetOBJ In sset objarea = ssetOBJ.Area i = i + 1 With ListBox1 .AddItem .List(.ListCount - i, 0) = "Fläche" .List(.ListCount - i, 1) = objarea End With Next.
But the code only writes the area of the last Object in the first Row of the Listbox.I think in the FOR EACH Expression the variable "i" pass always "1" for the Row Number.
I'm try to set a classification for a list of objects with .net. I'va found some discussions regarding changing and iterating classification trees, but none setting the classification for entites, similar to selecting a classification in ui.
We're having a problem with Ordinate dimensions. When we dimension to a radius corner, we dim to the "implied intersection" of the two lines, rather than to the center of the radius. We make a sketch with the two "tick marks", then dim to the intersection of the tick marks.
Ordinate dimensions are not allowing us to pick the intersection: it wants to put two (or three) dimensions, one to each end of one or the other tick marks (see attached). We use Ordinate dims about once a year, but I'm sure I remember being able to ordinate dimension to the tick marks.
I'm trying to rewrite some old VBA code into VB.net (which I'm not even Novice level yet), and I'm stumped on what would be a fairly simple principle (in VBA)..
For Each BlockDef in ThisDrawing.blocks If Left(BlockDef.name, 12) = "*Paper_Space" then Select Case True Case BlockDef.Layout.Name Like "*Test*" blah blah End Select End IfNext Essentially conditional manipulation of paperspace elements depending on the layout name.
The following fragment allows me to recurse through entities in paperspace, but I've no idea which layout tab..
Dim BlkPaperSpc As BlockTableRecord = ScanTrans.GetObject(BlkTab _(BlockTableRecord.PaperSpace), OpenMode.ForWrite)For Each AcObjId As ObjectId In BlkPaperSpc Dim PspaceObj As String = AcObjId.ObjectClass.NameNext
What I need to do is to be able to identify a type of object (a table), confirm it's location, delete it and replace it with another one, depending on which layout tab it's on.
ACad, MEP, 3DS Max Windows 7x64 X5482 @3.2Ghz 8Gb Ram Quadro FX1700