Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
laszlo.nagy
in reply to: Anonymous

Hello  Try this!

 

Helló próbáld meg ezt : )

 


Dim
DWGType As String Dim SparePart As String 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 Dim oDrawing As DrawingDocument oDrawing = ThisApplication.ActiveDocument Dim oView As DrawingView oView = oDrawing.ActiveSheet.DrawingViews.Item(1) Dim oModelDocument As Document oModelDocument = oView.ReferencedDocumentDescriptor.ReferencedDocument Dim invUserDefProp As PropertySet Dim invProperty As Inventor.Property invUserDefProp = oModelDocument.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 oModelDocument.Save
oModelDocument.Close