Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom iProperty CUTDETAIL in Frames is not accesible from VBA or iLogic

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
richter
649 Views, 2 Replies

Custom iProperty CUTDETAIL in Frames is not accesible from VBA or iLogic

I need to read the value of Custom iProperty CUTDETAIL, which is created by Mitter function in Frame Generator. When I try to read the property in iLogic, or VBA, error message says that such property doesn't exist. It looks like the property CUTDETAIL is not a standard Inventor iProperty. Is the any way how to read the value?

 

Following is the VBA code I used. 

Thank you!! 

 

Public Sub MitterRead()

' Get the active part document.
Dim invPartDoc As PartDocument
Set invPartDoc = ThisApplication.ActiveDocument

'Get the custom property set.
Dim invCustomPropertySet As PropertySet
Set invCustomPropertySet = _
invPartDoc.PropertySets.Item("Inventor User Defined Properties")

' Attempt to get "CUTDETAIL1".
On Error Resume Next
Dim invVolumeProperty As Property
Set invVolumeProperty = invCustomPropertySet.Item("CUTDETAIL1")
MsgBox (invVolumeProperty.Value)
If Err.Number <> 0 Then
MsgBox ("Error")

Else

End If

End Sub 

 

2 REPLIES 2
Message 2 of 3
Mike.Wohletz
in reply to: richter

Never expect anything normal when working with frame generator files, while you were asking for the display name the actual name is not the same. I don't know if some consistency exists in how things are done, but if so I sure wish it was published. The code below will get what you want in iLogic.

 

        ' Get the active part document.
        Dim invPartDoc As PartDocument = ThisApplication.ActiveDocument
        'Get the custom property set.
        Dim invCustomPropertySet As PropertySet = invPartDoc.PropertySets.Item("Inventor User Defined Properties")

        ' Attempt to get "CUTDETAIL1".
        Try
            For Each p As Inventor.Property In invCustomPropertySet
                If p.DisplayName = "CUTDETAIL1" Then
                    MsgBox(p.Value)
                End If
                'MsgBox(p.DisplayName & vbLf & p.Value & vbLf & p.Name)
            Next
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

 

Message 3 of 3
Anonymous
in reply to: Mike.Wohletz

Just to add some precision to Mike's post :

you cannot retrieve "CUTDETAILx" custom property via a call like invCustomPropertySet.Item("CUTDETAIL1"), because when you do so, the accessor looks the value in the Name property of the custom property.

Yet for a reason I ignore, you will be able to find "CUTDETAILx" name into the property DisplayName, as Mike's post suggests, while the Name property contains a GUID.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report