Porting CAD DLL Code to CAD.NET

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
TomOle
Posts: 4
Joined: 23 Mar 2018, 12:39

Porting CAD DLL Code to CAD.NET

Post by TomOle » 23 Mar 2018, 12:54

I'm currently trying to port existing and working C++ Code based on CADDLL to C# using CAD.NET now. Doing so I'm experiencing a hard time...
I already figured out, how to access layer info and layout entities. Simple line entities should work, but I have problems with some CADCurvePolygon entities which are supplying me with a CAD2DBoundaryList consisting of CAD2DPolyline(s). And I found out that CAD2DPolyline is using start and end points with bulge(s).
From CADDLL I'm used to get a list of points (polypoints) through CADDATA structures. Can I get it in that form with CAD.NET, too? Of course there is surely a way to convert bulges to arcs, but... really? I fully understand, that drawing curves is more accurate, even faster maybe, but I was completely fine with the polypoint array CADDLL gave me.

Can you point me in the right direction?

Best regards,
Tom

support
Posts: 3271
Joined: 30 Mar 2005, 11:36
Contact:

Re: Porting CAD DLL Code to CAD.NET

Post by support » 23 Mar 2018, 15:52

Hello Tom,

In CAD .NET you can get a list of polypoints through CAD2DPolyline.Points, CADPolyLine.PolyPoints or CADLWPolyLine.PolyPoints property, depending on the polyline type.


Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

TomOle
Posts: 4
Joined: 23 Mar 2018, 12:39

Re: Porting CAD DLL Code to CAD.NET

Post by TomOle » 23 Mar 2018, 17:18

Thanks for your quick response, Mikhail!

I've checked back that immediately but my Points collection is empty (CAD2DPolyline.Points). Only Bulges and Vertexes collections are filled.
Because I have a quite dated but licenced version 8.0 of your library I just downloaded a trial version of 12.0 which behaves the same though.

What I'm doing wrong?

Best regards,
Tom

support
Posts: 3271
Joined: 30 Mar 2005, 11:36
Contact:

Re: Porting CAD DLL Code to CAD.NET

Post by support » 26 Mar 2018, 21:31

Hello Tom,

To read polypoints (CAD2DPoint instances) from CADCurvePolygon entities, you should use a CADCurvePolygon.Boundaries property.


Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

TomOle
Posts: 4
Joined: 23 Mar 2018, 12:39

Re: Porting CAD DLL Code to CAD.NET

Post by TomOle » 27 Mar 2018, 11:13

Hello Mikhail,

thanks for sharing this info! In Boundaries I see a collection of collections of CAD2DPoint(s). That's what I was trying to find!
Actually I almost didn't trust my eyes after reading your reply and I asked myself: "why the heck I didn't find this earlier?". Now I know, BoundaryData shows up in Visual Studio's QuickWatch but Boundaries not, using Intellisense both are there...

Again, thanks and best regards,
Tom

Post Reply