Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, i'm having a issue with some code, i'm trying to transform a sheetmetal part to his template and create the flatpattern. But when i test the subtype and try to convert it, it gives me an error on the next command. I've found a solution but i not like it, i made a pop-up timeout windows form, to "update" the code and it can gets the definition on line 12. Could someone tell me what is going on?
Here is the example code:
#If Win64 Then
Private Declare PtrSafe Function WinMsgBox Lib "user32" Alias "MessageBoxTimeoutA" (ByVal hWnd As LongPtr, ByVal xDescricao As String, _
ByVal xTitulo As String, ByVal xBotoes_Avisos As VbMsgBoxStyle, ByVal xLanguage As Long, ByVal xTimeOutMilliseconds As Long) As Long
#End If
Sub Testes()
Dim oDoc As PartDocument: Set oDoc = ThisApplication.ActiveDocument
If Not oDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
ThisApplication.CommandManager.ControlDefinitions.Item("PartConvertToSheetMetalCmd").Execute2 True 'Se não estiver no template de chapa, converte
WinMsgBox 0, "", "", vbOKOnly, 0, 1
End If
Dim oSMDef As SheetMetalComponentDefinition: Set oSMDef = oDoc.ComponentDefinition
End Sub
Solved! Go to Solution.