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

Help with Hatches

3 REPLIES 3
Reply
Message 1 of 4
leonardlay
462 Views, 3 Replies

Help with Hatches

I am using C# in Visual Studio 2008 with AutoCAD 2009. I am trying to draw a Hatch object and then read the individual lines that make up the Hatch. I'm not sure how to get started.
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: leonardlay


What part of it are you having problems with?

 

Drawing the hatch, or getting the hatch lines?

 

The Hatch class exposes a GetHatchLinesData() method
that

returns the lines. If you're stuck on drawing the hatch
itself,

then I suspect you need to spend a little more time
learning

the API before trying to tackle something like
that.

 

Creating hatching is a bit more complicated than creating

something simpler like a polyline, and involves other
objects

in the definition, so unless someone here wants to
provide

you with a detailed example of it (sorry, I don't have
the

time), your best bet would be to focus on becoming a
more

familiar with the tools you're trying to use, which
might allow

you to arrive at a solution yourself.

 


 

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000
through 2009

href="http://www.acadxtabs.com">http://www.acadxtabs.com

 


 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
I
am using C# in Visual Studio 2008 with AutoCAD 2009. I am trying to draw a
Hatch object and then read the individual lines that make up the Hatch. I'm
not sure how to get started.
Message 3 of 4
leonardlay
in reply to: leonardlay

I was able to create the Hatch object. I am able to get a count of the lines that make up the Hatch and I can access the Line2d objects that are in the Hatch. However, I need to be able to get the endpoints of the segments that make up the Hatch. Line2d objects don't have endpoints that I can access. Is there another way to get the endpoint information from the lines in the Hatch? I also noticed that the Line2d objects that are returned using the GetHatchLineDataAt(index) method have directions that are not the same as the direction of the hatch lines in the drawing and they aren't even parallel to each other.

Edited by: leonardlay on Dec 12, 2008 7:37 PM Edited by: leonardlay on Dec 15, 2008 12:05 PM
Message 4 of 4

Hello leonardlay,
Have you solved this issue?
I'm stuck with it using AutoCAD 2016 .NET. Still a set of Line2d objects instead of LineSegment2d.
On the ObjectARX side the function returns correct endpoints.
Zolee

 

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