Is a flat pattern sheetmetal part open?

Is a flat pattern sheetmetal part open?

DWhiteley
Advisor Advisor
597 Views
5 Replies
Message 1 of 6

Is a flat pattern sheetmetal part open?

DWhiteley
Advisor
Advisor

I'm trying to find out if the current open document is in flat pattern "mode"

 

It's not working, any ideas what I've got wrong?

 

 

If oDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then

'MsgBox("sheet metal")

If OApp.ActiveEditDocument.Type = 50332160 Then

' this is a a flat pattern

End If

End If

 

 

Many thanks in advance.

 

Dave

0 Likes
Accepted solutions (1)
598 Views
5 Replies
Replies (5)
Message 2 of 6

GeorgK
Advisor
Advisor
' Check to see if the flat pattern exists.
    Set oFlatPattern = oPartDoc.ComponentDefinition.FlatPattern
    If oFlatPattern Is Nothing Then
        MsgBox "No flat pattern exists for this part!"
        Exit Sub
    End If
0 Likes
Message 3 of 6

DWhiteley
Advisor
Advisor

Thank you for this, but I need to know if the flat pattern is currently active (I think your code shows if a flat pattern exists).

 

Dave

0 Likes
Message 5 of 6

DWhiteley
Advisor
Advisor

Thank you, but this is still not what I want to achieve.

I just need to know whether the flat pattern is active on the screen. Not whether a flat pattern exists or to switch between flat and folded.

 

Dave

0 Likes
Message 6 of 6

Ktomberlin
Advocate
Advocate
Accepted solution
If TypeOf ThisApplication.ActiveEditObject Is FlatPattern Then
        MessageBox.Show("Flat Pattern Active", "Title")

    End If

I think this does what you want, or if you want it to check the other way

 

 

If Not TypeOf ThisApplication.ActiveEditObject Is FlatPattern Then
        MessageBox.Show("Flat Pattern is NOT Active", "Title")

    End If