5/11/2021 0 Comments Patch Autocad 2009
The post was inspired by an email I received a number of weeks ago from Danijel Ivankovic.The transient graphics API introduced in AutoCAD 2009 is perfect for this, and works very well with the entity transparency introduced in AutoCAD 2011.Aside from the post linked to earlier, this implementation also borrowed heavily from this recent post.Vertex v in bl.Vertices ) pts.Add(v.Point); res true; catch ( BrException ) res false; return res; private Hatch CreateFromVertices( Transaction tr, BlockTableRecord btr, Point3dCollection verts ) if (verts.Count 2) Create our first plane based on the first three points in our list (hopefully are not co-linear.
To clear the graphics completely you may need to use the SHADECLEAR command, also implemented above. I will say that this implementation has its quirks: the face picking may not work exactly as you expect it (as you need to pick an edge of the solids but the actual face detection uses the current view direction), and it wont work for all solid types (including ones with circular face even if theyre flat such as cylinders), but the point is really to show the basic technique for this blogs readership to tailor to their specific needs. As usual.:-) Im also not fully happy with creating a persistent polyline to define my hatch boundary. I tried using the AppendLoop() method with a HatchLoop created from a collection of transient geometry (such as LineSegment2d objects), but I wasnt able to get it working. I ended up adding a polyline boundary temporarily to the drawing and then erasing it once the hatch has been generated properly. If anyone has had better luck than I on this issue, please post a comment.
0 Comments
Leave a Reply. |