How to get know whether DxfLine is

1
Vishwas
9/17/2013 11:18 AM

Hi,
I have dxf entity DxfLine and i want to know whether this line is Continuous or Dashed. I am getting LineType as 'ByLayer' with DxfLine.LineType property.I want to get bendline of flange. And i think bendline is reppresented with Dashed Line.So,Can somebody help me please.

I have also DxfBock, DxfModel inwhich that line entity exists.

Thanks.
Vishwas

rammi
9/30/2013 12:55 PM

If the LineType is ByLayer that means that the entity gets its linetype from its layer.
If this is any layer but the zero layer (DxfLayer.IsZeroLayer is not true) things are simple: just use DxfLayer.LineType. In case of the zero layer the effective layer of the entity depends on its insertion hierarchy, i.e. it will inheret its layer from the DxfInsert which inserts the block containing the entity (and this may happen recursively). Only for top level entities the zero layer is indeed taken.

- Rammi

Vishwas
1/9/2014 10:45 AM

Thank you Rammi for reply.
But actually i want to know whether the dxf entity is bendline or not in .dxf file. I have read all blocks. and got DxfLines from that blocks. Now if there are bends present in the sketch then how to find whether there is bend in sketch & which DxfLine is bendline for that bend. I think now you have understood my question well enough. Please reply ASAP.
Again thank you!!!!
-Vishwas:D

rammi
1/9/2014 3:37 PM

Sorry, I'm not sure what you are looking for, and the question whether a line is bend (your second question) or dashed (your first question) has not much in common. What does define a bend in your code?

Guess 1:
Normal DxfLine entities are always straight. There are other entities which can produce bend lines (DxfArc, DxfPolyline, DxfLwPolyline, DxfSpline, ...), but which is used for what depends on your model. If you are just interested in basic geometry (a line is bend vs a line is straight) you could adapt the PolygonWireframeGraphicsFactory I presented here.

Guess 2:
As you said that the DxfLine entities are already present in your model the only way to produce something bendlike would be to connect two DxfLines to create something that I would call a corner. If that is what you are looking for CadLib has no automatism for that, as the exact requirements are quite volatile and depend on a bunch of things. But in your case just sort all lines by their start and end points, and see where they are equal (better allowing for a small deviation as floating point math is not exact), which means that they connect at that point. Then you can construct the contour you are looking for by taking the first line, look for the lines connected to it, add them and so on.

- Rammi

1