Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

hatch lines as CAD line and their coordinates

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
Anonymous
1387 Views, 5 Replies

hatch lines as CAD line and their coordinates

Dear Advanced Autocad users,

My application requires me to find the start and finish coordinates of hatch patterns on a 2d drawing. For instance, I start drawing a certain enlcosed shape (a circle), fill it with horizontal hatch patterns. Then I remove the outer shell (the circle) and I am left with hatch patterns. 

 

Now, all left is hatch patterns. I somehow want to access the start and finish coordinates of such each hatch pattern. I thought of processing the dxf file using scripting but it seems like there are no cooordinates in it. Rather it has some group codes, angle etc. 

 

How do I export the hatch lines are CAD lines and access to their coordinates? I dont have to have dxf file. If another file type has these coordinates, I am ok with that. I can process any text based file. 

 

many thanks

5 REPLIES 5
Message 2 of 6
Alfred.NESWADBA
in reply to: Anonymous

Hi,

 

>> How do I export the hatch lines

you might run command _EXPLODE and select the hatch. That results in lines instead of the hatch (something like destry hatch).

If you do some development then it depends on the API, there might exist an explode-function that creates the lines from the hatch without erasing the hatch and without adding the lines to it's modelspace (or wherever the hatch is placed), the lines are then available just as memory-objects.

 

HTH, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 6
Anonymous
in reply to: Alfred.NESWADBA

Hi Alfred, explode command works great. Now hatch lines act like memory objects and regular lines. 

 

Now I need to access each of their coordinates in a dxf file. I dont have experience dealing with such files, where are the coordinate information stored?

 

thanks,

Mehmet

Message 4 of 6
hwalker
in reply to: Anonymous

I've never had a look inside a dxf, but here's what I would do

 

Draw a few lines with specific start and end points. Then export to a dxf and look in the dxf for those specific points.

 

That should give you a starting point (sorry) of what type of information you need to look for.

Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Left Handed and Proud

Message 5 of 6
Anonymous
in reply to: hwalker

ok, thanks for your suggestion but that is kind of hard to find, especially when you have 1000s of points.  

What I am working on is the DataExtraction tool of Autocad. That seems to give me all the coordinates in a table. 

But I am still of open to parsing the dxf file for more control over the dxf file. 

 

 

Message 6 of 6
Alfred.NESWADBA
in reply to: Anonymous

Hi,

 

when you handle the EXPLODE within your code you might give the resulting lines a new layer, so you can find them in the DXF.

 

HTH, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)

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

Post to forums  

Autodesk Design & Make Report

”Boost