
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi there,
I'm trying to access some User definied iProperties of a selected part/assembly within a drawing view. I just get part as a kGenericObject therefore I can't access the properties.
Anyone there who can help me??
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Test
If _invApp.Documents.Count = 0 Then
MsgBox("Need to open an Assembly document")
Return
End If
If _invApp.ActiveDocument.DocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then
MsgBox("Es muss eine Z-Ableitung aktiv sein.")
Return
End If
Dim drawDoc As DrawingDocument
drawDoc = _invApp.ActiveDocument
If drawDoc.SelectSet.Count = 0 Then
MsgBox("Wähle eine Linie, Baugruppe oder Bauteil")
Return
End If
Dim selSet As SelectSet
selSet = drawDoc.SelectSet
Dim oSelectName As String
If TypeOf selSet.Item(1) Is ComponentOccurrence Then
MsgBox("Test")
Dim oOcc As ComponentOccurrence
oOcc = selSet.Item(1)
Dim oDoc As Document
oDoc = oOcc.Definition.Document
Dim oProp As [Property]
oProp = oDoc.PropertySets.Item("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}").Item("BENENNUNG2")
MsgBox(oProp.Value)
End If
MsgBox("Test2")
End Sub
Solved! Go to Solution.