Inventor Customization

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

Get Spline Data

254 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 (241 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 (231 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 (224 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
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!