Anuncios

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

JanNavratil
636 Vistas, 7 Respuestas

FeatureCAM Macro - deactivation of the spot drill in existing drilling feture

Hi all,

I'm creating small macro, purpose of this macro is to create copy of the drilling's which are moved at the bottom of the stock, where it will drill other holes to the plate under the stock with thread. 
Problem is, when we have active spot drill at the original holes - these are copied into new holes which should be without spot drill.
I've tried lot of things but I'm not able to disable spot-drill at existing hole by macro.

Any thoughts? :cara_con_una_leve_sonrisa: 

Thanks,
Jan



Anonymous
en respuesta a: JanNavratil

Hi,

 

Can you create a video on the fm-file where you shows what you do?

JanNavratil
en respuesta a: Anonymous

Hi Jacob,

thank you for quick reply. Here is the video - http://autode.sk/2oOr7ke

Thanks,
Jan

AJHanson
en respuesta a: JanNavratil

Have you tried going into your drill attributes and  turning off the spot drill for the drill. What I mean is telling the Feature cam the drill doesn't need a spot drill, of course this would be only temporary you'll need to change it back the next time you use the tool in a different situation.

JanNavratil
en respuesta a: JanNavratil

Hi,
Thank you for the reply, this is not the solution, becase we still need spot drill for the upper set.

Thanks,
Jan
Anonymous
en respuesta a: JanNavratil

Hi @JanNavratil,

 

I think you need to play with the function.

 

Private Sub Application_HoleRecogAfterCreate(Doc As FeatureCAM.FMDocument, Hole As FeatureCAM.FMFeature, ByVal Color As Long)
    If Color = RGB(255,0,128) Then         ' reddish holes
        Hole.SetAttribute ( eAID_DoReam,, True,,False)
    End If
End Sub

Hi @@jnavrat, @Anonymous, @AJHanson,

 

Thanks for posting and contributing to the Autodesk FeatureCAM forum.

 

To add/remove a spot drill operation from a hole in a pattern, you can use something similar to the code below.

 

    Dim doc As FMDocument
    Set doc = Application.ActiveDocument

    Dim hole As FMHole
    Dim pattern As FMRectPattern

    Set pattern = doc.Features.Item("pattern1")
    Set hole = pattern.Object

    hole.SetAttribute(eAID_DoSpotDrill,,False)

 

This code applies to a document that already contains a pattern of holes. Make sure that you use the correct pattern object. In this case, I used a rectangular pattern to define my holes, so I have used this type of pattern in my document.

 

Hope this helps! If you feel it answers your questions, please select Accept as Solution. If not, please reply to this thread and I would be happy to help.

 


Spencer Hardcastle
Manager of Customer Advocacy - Autodesk Fusion

Hi Spencer,

thank you for your reply ! Yea this is working solution, I'm not sure why I missed this...

Thank you for your help,
Jan