.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How would I fill a hatch after selecting a point

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
321 Views, 3 Replies

How would I fill a hatch after selecting a point

I fill the hatch after seleting the object using vb.net
but I m unable to fill the hatch after selecting the point.
I feel very thankfull If anyone can help me regarding to this problem
Thanks
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

It can not be possible to fiil the hatch by selecting a point
using vb.net
Message 3 of 4
Anonymous
in reply to: Anonymous

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
Message 4 of 4
Anonymous
in reply to: Anonymous

>> 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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost