Skip to content

Casting LWPolylines to DxfPolylines in IxMilia #21

@westwinnd

Description

@westwinnd

Now, it will be complicated, i'm not used to write issues, so please be patient, I will elaborate it.
Issue is coneccted to feel88 DeepNestPort and 9swampy DeepNestPort repositories, they all have same problem with export.

NOW
I am aware that in DeepNestSharp (current one, this repository) exception is handled, that is why I mention both upper ones, but with context, I was able to dig into problem deeper.

  1. Runtime Exception text: (from author feel-88 and 9swampy DeepNestPort)

(Bold text in block of this text translated by me, unnecessary paths removed)

System.InvalidCastException: **You can't cast object of type** 'IxMilia.Dxf.Entities.DxfLwPolyline' **to type** 'IxMilia.Dxf.Entities.DxfPolyline'.
   w DeepNestLib.DxfParser.OffsetToNest(IList`1 dxfEntities, DxfPoint pivot, DxfPoint offset, Double rotationAngle) in [...]\DeepNestPort-master\Framework\DeepNestLib\DxfParser.cs:line 362
   w DeepNestLib.DxfParser.Export(String path, IEnumerable`1 polygons, IEnumerable`1 sheets) w [...]\DeepNestPort-master\Framework\DeepNestLib\DxfParser.cs:line 217
   w DeepNestPort.Form1.toolStripButton2_Click_1(Object sender, EventArgs e) in [...]\DeepNestPort-master\Framework\DeepNestPort\Form1.cs:line 1360

Now, in this repo there is added DxfExporter.cs, in DeepNestLib.Core, probably to solve problem, to substract and differ input and output.
I tested it myself and found a reason, in a moment function OffsetToNest( receives LwPolyline object it cannot cast it to DxfPolyline, so maybe it should get this type at export.

I "solved" it temporaly by removing case LwPolyline in OffsetToNest function, cause this needs to be resolved by writing external module outside IxMillia lib,, which perform the cast (you cannot offset LWPolyline vertices), or by externing IxMilia by yourself.

Or I am blind, and don't see some easy solution, hah.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions