Anuncios

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

Anonymous
692 Vistas, 6 Respuestas

Create toolpath feature automatic when press OK

Hi,

 

Are there someone there can help me with the code to add a "toolpath feature" when I press OK in my macro?

 

The toolpath feature should in the same press be assigned to lower turret:-)

 

 

Thanks & hopefully,

Jacob

spencer.hardcastle
en respuesta a: Anonymous

hi @Anonymous,

 

Thanks for posting!

 

What type of toolpath feature are you wanting to create? 

The code below shows how to add a generic toolpath feature with no movements or text inside.

 

    Dim doc As FMDocument
    Set doc = Application.ActiveDocument

    Dim tpf As FMToolpathFeature
    Set tpf = doc.Features.AddToolpath(eST_Milling,eTG_All,0,0,0,"error message")

 

 

Hope this helps! If this answers your question, please select "Accept as Solution"

 


Spencer Hardcastle
Manager of Customer Advocacy - Autodesk Fusion
Anonymous
en respuesta a: spencer.hardcastle

Hi Spencer,

 

Thanks for help.

 

If you look in the macro, this I need is add a toolpath feature there are assignet to lower turret.

 

If you press clear data then you delete the number in P90 and close the box

 

Can you help?

 

Thanks,

Jacob

spencer.hardcastle
en respuesta a: Anonymous

Hi @Anonymous,

 

Please find attached a new macro, which sets post word 90 and creates a toolpath feature when you press OK. This toolpath feature doesn't contain any toolpaths or text. This will need to be done as well.

If you press clear data, it clears post word 90, and sets it to nothing.

 

Hope this helps! If this answers your query, please select "Accept as Solution"


Spencer Hardcastle
Manager of Customer Advocacy - Autodesk Fusion
Anonymous
en respuesta a: spencer.hardcastle

Hi Spencer,

 

That's great. Minor things could we do as we press "clear data" then delete the toolpath feature.

 

I think the toolpath feature should be turning so we can assign then to lower turret wtih the add-in

 

Thanks,

Jacob

spencer.hardcastle
en respuesta a: Anonymous

Hi @Anonymous,

 

It becomes a little bit more complicated to delete the toolpath feature because the macro will not know which toolpath feature one to delete, especially if the OK button is pressed more than once. My recommendation would be to have two macro's and two buttons. One to delete the feature and one to create it. This would allow you to pass a variable from one to the other to say whether it had been created.

 

I've done some checking and it looks like we can't access the tool usage tab with the API language. I will check with development and if this functionality isn't currently available, I will create a new feature request and assign your details.

 

Thanks and hope this helps.

 


Spencer Hardcastle
Manager of Customer Advocacy - Autodesk Fusion
Anonymous
en respuesta a: spencer.hardcastle

Hi Spencer,

 

Is it possible to add a NC comment in the macro?

 

Thanks,

Jacob