Hello,
Please help me for the simple radio box and check box configuration.
I have a rule which rewrite some information from drawing to first view part.
I would like to control this with tue/false value. When I pick the check box, and then activated the drop-down menu and I change this, the value is changed immediately.
I would like to wait, when I pick to rule button.
Predefined Buttons = None
On Click Action = Close and then Run Rule
The Boolen variables are in the FX - user parameters
The rule:
'Alkatrészek, összeállítások típusának és a Pót/kopó besorolásoknak a megváltoztatása
'A program egy adott rajzlapon az először lehelyezett modell paramétereit kiolvassa, majd változtatja
'Változók megadása
Dim oView As DrawingView
Dim DWGViewName As String
Dim oActPart As Document
Dim oDrawing As DrawingDocument
oDrawing = ThisApplication.ActiveDocument
Dim DWGType As String
Dim SparePart As String
Dim oSheet As Sheet
oSheet = oDrawing.ActiveSheet
If oSheet.TitleBlock Is Nothing Or oSheet.DrawingViews.Count = 0 Then
MessageBox.Show("Üres rajzfájl, vagy nincs nézet!", "Általános üzenet", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
If Rajz_A_H_Ö_K = "A - alkatrész" Then
DWGType = "a"
ElseIf Rajz_A_H_Ö_K = "H - hegesztett alkatrész" Then
DWGType = "h"
ElseIf Rajz_A_H_Ö_K = "Ö - összeállítás" Then
DWGType = "ö"
ElseIf Rajz_A_H_Ö_K = "K - kerelem" Then
DWGType = "k"
End If
If Pót_Kopó_alkatrész_P_K = "P - pót alkatrész" Then
SparePart = "p"
ElseIf Pót_Kopó_alkatrész_P_K = "K - kopó alkatrész" Then
SparePart = "k"
End If
oView = oDrawing.ActiveSheet.DrawingViews.Item(1)
'DWGViewName = oView.Name
'MessageBox.Show(DWGViewName, "Első nézet neve")
oActPart = oView.ReferencedDocumentDescriptor.ReferencedDocument
'MessageBox.Show(oActPart.DisplayName, "Fájlnév")
Dim invUserDefProp As PropertySet
Dim invProperty As Inventor.Property
'Változó elérése és ha nincs beírása
invUserDefProp = oActPart.PropertySets.Item("User Defined Properties")
Try
invProperty = invUserDefProp.Item("06. Pót alkatrész / Kopó alkatrész (P/K)")
invProperty.Value = SparePart
Catch
invProperty =invUserDefProp.Add(SparePart,"06. Pót alkatrész / Kopó alkatrész (P/K)")
End Try
Try
invProperty = invUserDefProp.Item("09. Rajz A/H/Ö/K")
invProperty.Value = DWGType
Catch
invProperty =invUserDefProp.Add(DWGType,"09. Rajz A/H/Ö/K")
End Try
oActPart.Save
oActPart.Close
End If
InventorVb.DocumentUpdate()
ThisDoc.Save