>> rb.Add(New TypedValue(
>> 5005, (pt.X.ToString + ("," + pt.Y.ToString))))
Once again, please look at past posts here regarding
the use of acedCmd().
You do not (and should not) convert supported types
to strings. You can add doubles, integers, Point3d's
and strings to a result buffer using the appropriate
type code, and they're accepted by acedCmd().
For example, you can pass a Point3d directly by just
adding it to the resultbuffer using the appropriate
type code, rather than converting it to a string as you
do below.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
wrote in message news:5723321@discussion.autodesk.com...
You may want to take a look at the boundary command within Autocad. See below
Private Declare Function acedCmd Lib "acad.exe" Alias "acedCmd" (ByVal vlist As System.IntPtr) As Integer
Public Sub HatchBoundary(ByVal pt As Point2d)
SetLayer("BoundaryTemp")
Dim rb As ResultBuffer = New ResultBuffer
Try
rb.Add(New TypedValue(5005, "._-BOUNDARY"))
rb.Add(New TypedValue(5005, "_AD"))
rb.Add(New TypedValue(5005, "_IS"))
rb.Add(New TypedValue(5005, "_n"))
rb.Add(New TypedValue(5005, ""))
rb.Add(New TypedValue(5005, "_OB"))
rb.Add(New TypedValue(5005, "PO"))
rb.Add(New TypedValue(5005, ""))
rb.Add(New TypedValue(5005, (pt.X.ToString + ("," + pt.Y.ToString))))
rb.Add(New TypedValue(5005, ""))
acedCmd(rb.UnmanagedObject)
Catch ex As System.Exception
MsgBox("Hatch Boundary Error " & ex.Message)
Finally
SetLayer("0")
rb.Dispose()
End Try
you need to be carefull about your view on the screen, the boundary calculates with what is shown on your monitor.
The you can take the lastentity created and pass to the hatch object.
pat