Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

API: Setting Stock From Curve

Anonymous

API: Setting Stock From Curve

Anonymous
No aplicable

The FMStock member SetDimmensions() has an optional parameter of StockCurve with type string. My goal is obviously to generate the stock from an existing curve. If this member function is the correct way to go about the issue great, what is this parameter expecting? Ive tried passing it the name of the curve, and implicitly casting string to the Curve variable. If not what is the best way to do this?

 

Thanks

0 Me gusta
Responder
Soluciones aceptadas (1)
539 Vistas
2 Respuestas
Respuestas (2)

spencer.hardcastle
Autodesk
Autodesk
Solución aceptada

Hi @Anonymous

 

Thanks for posting!

 

You are correct. Using the method "SetDimensions" is the right way of setting a stock curve. There is a little quirk when setting a stock curve. This is that you need to set the width, length and thickness, even though they aren't used with a stock curve.

 

The code you can use to set a stock curve is as follows;


    Dim doc As FMDocument
    Set doc = Application.ActiveDocument

    Dim stock As FMStock
    Set stock = doc.Stock

    Dim curve As String

    stock.SetDimensions(,2000,2000,30,,,,,"curve2")

 

I hope this helps! If this answers your query, please accept this reply as a solution. If not, please reply to this post.

 


Spencer Hardcastle
Manager of Customer Advocacy - Autodesk Fusion

Anonymous
No aplicable

Ahhh yet another quirk withing the FC API! Your solution pointed me in the right direction. I assume your proposed solution was directed at milling setups, as I found that when creating a turning document, the Length, OD, and ID parameters need to be filled in for the stock curve to work. Thank you!