Porting CAD DLL Code to CAD.NET
Moderators: SDS, support, admin
Porting CAD DLL Code to CAD.NET
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
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
Re: Porting CAD DLL Code to CAD.NET
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
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
Chat support on Skype: cadsofttools.support
Re: Porting CAD DLL Code to CAD.NET
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
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
Re: Porting CAD DLL Code to CAD.NET
Hello Tom,
To read polypoints (CAD2DPoint instances) from CADCurvePolygon entities, you should use a CADCurvePolygon.Boundaries property.
Mikhail
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
Chat support on Skype: cadsofttools.support
Re: Porting CAD DLL Code to CAD.NET
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
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