AutoCAD .NET :: How To Add Hatch To Closed Curve In Drawable Overrule
Apr 11, 2013
My goal is to write a Drawable Overrule, which would change the entities color to dark gray, except when they are on a specific layer. For closed-only curves in this layer, I want to add a semi-transparent hatch.
All works great, until user moves the mouse over this hatch : AutoCAD throws a fatal error and closes. I've no exception in debugger...
When I remove the code concerning the hatch, I've no error at all.
Public Class ClosedCurveDrawableOverrule Inherits DrawableOverrule Public Const HighlightColorIndex As Short = 1 'Color Red Public Const BaseColor As Short = 251 ' Color DarkGray Public Const SpecificLayer As String = "Layer1" ' Set our transparency to 50% (=127) ' Alpha value is Truncate(255 * (100-n)/100) Public [code].......
I've just made the dramatic leap from AutoCAD LT 2005 to AutoCAD LT 2013. By far and away the environment in 'Classic" mode is very familiar and there are some new features. However, one item really getting under my skin is the hatch feature. In LT 2005 one could pick the points to hatch, if the item is closed or not, by individual mouse click points similar to how you can still check an area now. Is this hatch feature still available and I just don't have the new program configured properly or will I be forced to draw each item I want to hatch as a 'closed' element?
I am trying to find a command that will hatch the inner edge of a complex closed poly line, rather than hatch the entire area inside the poly line.
When I have simple shapes such as a rectangle I create a smaller rectangle inside the first that is 1' (or whatever I want my hatched area to be) smaller on all sides than the first rectangle. I hatch by selecting the two rectangles; I change the "Associative" hatch property to "No" and then delete the inner rectangle.
My problem now is that I have a complex closed poly line that I would like to hatch the inner perimeter with a set thickness, say 1 foot. Is there an easy way to hatch a inner boundary of a closed poly line or to recreate a scaled down copy of the poly line that is a set distance smaller all around. I hope I have conveyed the question clearly enough.
Basicaly I have a plan of a part of a city and I want to fill the houses with a solid hatch, I was wondering if I could do them all at once instead of picking an internal point one by one (there are a lot of them!).
I have a line drawing from a draftsman. It was imported from some other program, but I'm not sure which. However, this has cropped up many times over the years on my drawings as well as others. It just is typically quickly remedied with a workaround.
The hatch spacing too dense issue requiring me to break up the area: this problem will occur on equally sized areas at the same zoom factor at which I just hatched an adjacent area. I have changed the "MaxHatch" variable environment from stock at 10k, to 100k, then to 1,000k; yet the problem persists. I don't have a particularly fast machine so by that point I decided there was no need to max the variable at 10,000k. There are no z variables in the drawing though it appears, almost randomly, to have plines or lines along the same length of wall.
The second issue is the closed boundary. This occurs on lines that are connected at all corners, even when I stretch and reconnect a line, though that is a very time consuming method. When I increase the hgaptol variable it will hatch bizzarre areas that have no relation to what I am attempting to hatch. This is also occuring even inside a REC that I created just prior to hatching due to error on the original layout. I have to hatch an object rather than select an internal point. It has become so obnoxious in this drawing that I decided to post with these questions.
Is there a way to graph a curve using an equation over a closed interval in Inventor 2012? I know I can draw a spline through points that are solutions of my equation, but this does not guarantee that the curve is the graph of my equation.
I have a custom AcGiDrawable entity that I want to wrap in .Net. All this is done and compiles fine but when I try to instance the object I get the message "Cannot create an instance of the abstract class or interface '....'.
I have several custom entities (derived from AcDbEntity and AcDbObject) that aren't a problem, but for this one, problems arise.
I'm new here, as well as to script-fu, although I've looked into Scheme and Lisp and know how to program. I'm using Gimp 2.6.12 (the latest version on Linux - Ubuntu 12.04.2)
So, an overview of what I'm trying to do: create a simple clock face (black) with 12 solid white rectangles at the hour marks.
I have a single layer, (black background, white foreground colours), I select a circle, invert the selection and bucket fill.
Then I select a rectangle, fill it, rotate the layer (which cuts out the rectangle, creates a floating selection with it, and rotates that) anchor the flt-sel (and then repeat 12 times).
> (gimp-rect-select image 570 396 25 8 2 0 0) ; select rectangle (#t) > (gimp-bucket-fill layer 0 0 100 0 0 0 0) ; fills the selection (stays selected) (#t) > (gimp-drawable-transform-rotate layer (/ PI 2) 0 400 400 0 2 0 3 0) ; creates a flt-sel, but returns layer instead of the flt-sel(!?) ... (4) ; (also deactivates selection) > (set! fs (car (gimp-image-get-floating-sel image))) ; ... so have to get the flt-sel explicitly 26 > (gimp-floating-sel-anchor fs) (#t)
This kinda works, but doesn't feel like the optimal way to do it . What I was expecting to do is something like copying the selection, 12 x (rotate and add), bucket-fill.
I have used PEDIT to join multiple polylines, which now appear as polylines. But when I use QSELECT to show all open (non-closed) section, one polyline still shows up as open.
I've attached the file I'm working on. The polyline in question is the green outline on the object on the right.
Simple example, when overrule Line entity to draw three entities Line, Text, Circle when selecting overruled Line is it possible to identify what object have been selected (in this example it could be Line, Text, Circle).
I need to use the Handle of the cloned object during a DeepClone override but AutoCAD shuts down when I try to use it.
This is the best I can think of but it still boots me out when I try.
Public Overrides Function DeepClone(ByVal dbObject As DBObject, ByVal ownerObject As DBObject, ByVal idMap As IdMapping, ByVal isPrimary As Boolean) As DBObject Try Return MyBase.DeepClone(dbObject, ownerObject, idMap, isPrimary) Catch Finally CompileCloneObjects(dbObject.Handle.ToString, MyBase.DeepClone(dbObject, ownerObject, idMap, isPrimary).Handle.ToString) End Try End Function
If I add a DeepClone overrule on Initializeing a drawing it stops my block Jigs from showing correcly. I get a line drawn instead of the block. Other overrules I have used don't cause any problem.
By excluding the overrule from the initialize event it works fine.
I can remove then add the DeepClone overrule before and after the jig and it works ok but I really need it active on drawing startup.
Hit the brick wall again.
Ideally I don't use an overrule. All I need to do is understand what objects are being cloned before, during or after a clone operation but can't figure out the idmapping thing.
I am about to write the function using Overrule API to temporary override object’s colour to ByLayer for all entities in the drawing.
At this moment I just have simple class for testing (just to check if it is possible) and so far I can see problem with complex entities.
Entities such as Line, Polyline even BlockReferences work fine but complex objects like HATCH, MTEXT and LEADER do not change colour as set in SetAttribute method.
Below is simple class I was testing.
public class ByLayerColorOverrule : DrawableOverrule { public override bool WorldDraw(Autodesk.AutoCAD.GraphicsInterface.Drawable drawable, Autodesk.AutoCAD.GraphicsInterface.WorldDraw wd) { base.WorldDraw(drawable, wd); return true; }
Planning to overrule some of sub entities in a block. Let's make it simple . All lines and attributes in block should be circles and original block should not be seen. I came up with below code.
The code reacts differently if I remove
MyBase.WorldDraw(drawable, Wd)
and my goal is not to show the real block. Just showing whatever is overruled.
Public Class toverrule Inherits Autodesk.AutoCAD.GraphicsInterface.DrawableOverrule Public Overrides Function WorldDraw(ByVal drawable As Autodesk.AutoCAD.GraphicsInterface.Drawable, ByVal Wd As Autodesk.AutoCAD.GraphicsInterface.WorldDraw) As Boolean Dim myBlock As BlockReference = CType(drawable, BlockReference) If Not myBlock.Database Is Nothing Then [code].......
I have ran an analysis and SSA gave me Error 607 on the report. It says "Inlet A9 gutter capture curve is not a valid curve."
A couple things I did different from the video lectures...
I selected user define for the Tc to figure out Q. i computed those manually.
For the Inlets I have selected Maximum Capture Cutoff.
There are some inlets in this model I created that do not capture 100% of the flow so i created conveyance links to account for the bypass flow.Not sure why is not recognizing the Curve?
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?
Why in LR4 is the Tone Curve default set to Custom with a contrast lowering curve? I would like the default to be linear, but I can't remember how I set that up in LR3.