Inventor Customization

Reply
Active Member
kyra
Posts: 6
Registered: ‎04-09-2011
Message 1 of 4 (252 Views)

Get Spline Data

252 Views, 3 Replies
04-25-2011 04:31 AM

I am a newbie to vba editor, 

 

how can i apply the BSplineCurve.GetBSplineData Method, to get the poles and knots of a spline in my sketch.

 

thanks

Employee
yuhanzhang
Posts: 477
Registered: ‎01-06-2009
Message 2 of 4 (239 Views)

Re: Get Spline Data

04-25-2011 07:30 PM in reply to: kyra

Try below VBA code:

Sub SplineDataTest()
    
    ' New a part document, add a planar sketch and draw a spline
    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oBSpline As SketchSpline
    Set oBSpline = oDoc.ComponentDefinition.Sketches(1).SketchSplines(1)
    
    Dim dPoles() As Double, dKnots() As Double, dWeights() As Double
    oBSpline.Geometry.GetBSplineData dPoles, dKnots, dWeights
    
End Sub

 



Rocky Zhang
Inventor API
Manufacturing Solutions
Autodesk, Inc.

Active Member
kyra
Posts: 6
Registered: ‎04-09-2011
Message 3 of 4 (229 Views)

Re: Get Spline Data

04-26-2011 05:51 AM in reply to: kyra

I require the data of an already drawn spline in a part document. 

 

Is this code for this function?

Active Member
kyra
Posts: 6
Registered: ‎04-09-2011
Message 4 of 4 (222 Views)

Re: Get Spline Data

04-26-2011 07:25 AM in reply to: kyra

How do I display the data acquired?

 

Thank you for your assistance.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.