how to import Spline type
Moderators: SDS, support, admin
how to import Spline type
Hello,
I am trying to import AutoCAD drawings using CADImport.NET, i found your product is very good in many ways. But also i found that some elements are quite difficult to be imported without some proper examples. For example, do you have an example to show how to import a spline shape? Also, sometimes the curve is plotted as polyline in AutoCAD drawing, how can i get this element in correctly? (i am using VB2005)
Thanks.
I am trying to import AutoCAD drawings using CADImport.NET, i found your product is very good in many ways. But also i found that some elements are quite difficult to be imported without some proper examples. For example, do you have an example to show how to import a spline shape? Also, sometimes the curve is plotted as polyline in AutoCAD drawing, how can i get this element in correctly? (i am using VB2005)
Thanks.
Hello!
Here goes example of adding Spline entity. It is based on <b>Viewer</b> demo:
Sergey.
Please post questions to the forum or write to support@cadsofttools.com
Here goes example of adding Spline entity. It is based on <b>Viewer</b> demo:
Code: Select all
<font color="blue">Private Sub</font id="blue"> btnAddSpline_Click(<font color="blue">ByVal</font id="blue"> sender <font color="blue">As</font id="blue"> System.Object, <font color="blue">ByVal</font id="blue"> e <font color="blue">As</font id="blue"> System.EventArgs) <font color="blue">Handles</font id="blue"> btnAddSpline.Click
<font color="blue">Dim</font id="blue"> sp <font color="blue">As</font id="blue"> CADSpline
sp = <font color="blue">New</font id="blue"> CADSpline
sp.Knots.Add(0.0F)
sp.Knots.Add(0.0F)
sp.Knots.Add(0.0F)
sp.Knots.Add(0.0F)
sp.Knots.Add(0.0625F)
sp.Knots.Add(0.0625F)
sp.Knots.Add(0.0625F)
sp.Knots.Add(0.0625F)
sp.Knots.Add(0.0125F)
sp.Knots.Add(0.0125F)
sp.Knots.Add(0.0125F)
sp.Knots.Add(0.0125F)
sp.Knots.Add(0.01875F)
sp.Controls.Add(<font color="blue">New</font id="blue"> DPoint(46.507569157342459, 69.999999924097665, 0))
sp.Controls.Add(<font color="blue">New</font id="blue"> DPoint(66.507569157342459, 49.999999924097658, 0))
sp.Controls.Add(<font color="blue">New</font id="blue"> DPoint(86.507569157342459, 29.999999924097661, 0))
sp.Controls.Add(<font color="blue">New</font id="blue"> DPoint(46.507569157342459, -0.0000000759023351, 0))
sp.Controls.Add(<font color="blue">New</font id="blue"> DPoint(46.507569157342459, -0.0000000759023351, 0))
sp.Controls.Add(<font color="blue">New</font id="blue"> DPoint(6.5075691573424592, 9.9999999240976631, 0))
sp.Controls.Add(<font color="blue">New</font id="blue"> DPoint(56.507569157342459, 29.999999924097661, 0))
sp.Controls.Add(<font color="blue">New</font id="blue"> DPoint(21.507569157342459, 74.999999924097665, 0))
sp.Controls.Add(<font color="blue">New</font id="blue"> DPoint(21.507569157342459, 74.999999924097665, 0))
sp.Controls.Add(<font color="blue">New</font id="blue"> DPoint(-3.49243084265754, 59.999999924097658, 0))
sp.Controls.Add(<font color="blue">New</font id="blue"> DPoint(-28.492430842657541, 44.999999924097658, 0))
sp.Controls.Add(<font color="blue">New</font id="blue"> DPoint(81.507569157342459, 44.999999924097658, 0))
sp.Controls.Add(<font color="blue">New</font id="blue"> DPoint(81.507569157342459, 44.999999924097658, 0))
sp.Color = Color.Blue
sp.LineWeight = 0.1
sp.Loaded(<font color="blue">Me</font id="blue">.FCADImage.Converter)
<font color="blue">Me</font id="blue">.FCADImage.CurrentLayout.Entities.Add(sp)
<font color="blue">Me</font id="blue">.FCADImage.Converter.OnCreate(sp)
<font color="blue">Me</font id="blue">.cadPictBox.Invalidate()
<font color="blue">End Sub</font id="blue">
Please post questions to the forum or write to support@cadsofttools.com