Hi, Tom.
I'm really needing help on this because i don´t know how to make the MSflexgrid work.
Yes, i´m using VB6.
the error displayed by inventor is:
Run-time error '5':
Invalid Procedure call or argument
The code is the following:
**********************Class module**************
Option Explicit
Implements ApplicationAddInServer
Private WithEvents MyAppEv As ApplicationEvents
Dim oApp As Inventor.Application
Private Sub ApplicationAddInServer_Activate(ByVal AddInSiteObject As Inventor.ApplicationAddInSite, ByVal FirstTime As Boolean)
' Save a reference to the Application object.
Set oApp = AddInSiteObject.Application
Set MyAppEv = oApp.ApplicationEvents
End Sub
Private Property Get ApplicationAddInServer_Automation() As Object
Set ApplicationAddInServer_Automation = Nothing
End Property
Private Sub ApplicationAddInServer_Deactivate()
Set oApp = Nothing
End Sub
Private Sub ApplicationAddInServer_ExecuteCommand(ByVal CommandID As Long)
End Sub
Private Sub MyAppEv_OnDocumentChange(ByVal DocumentObject As Document, _
ByVal BeforeOrAfter As EventTimingEnum, _
ByVal ReasonsForChange As CommandTypesEnum, _
ByVal Context As NameValueMap, _
HandlingCode As HandlingCodeEnum)
If BeforeOrAfter = kBefore Then
If DocumentObject.DocumentType = kPartDocumentObject Then
With Form1
Set .objPartDocument = DocumentObject
.Show vbModeless
End With
End If
End If
End Sub
****************************Form load**************
Option Explicit
'Private oApp As Inventor.Application
Private selrow As Long
Private selcol As Long
Public objPartDocument As Inventor.PartDocument
Public Sub form_load()
Dim MaxFldValLen As Long 'Stores the Maximum Field Value Length, Used for Automatic Resizing
Dim i As Integer
Dim nome_f, nome As String
Dim oPropSet As PropertySet
Dim oprop As Property
Dim func_ex As Integer
Set oPropSet = objPartDocument.PropertySets("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")
For i = 0 To oPropSet.Count
MsgBox "Form load"
MSFlexGrid1.FocusRect = flexFocusHeavy
MSFlexGrid1.SelectionMode = flexSelectionFree
MSFlexGrid1.Clear
MSFlexGrid1.FormatString = "Propriedade |valor |Função "
MSFlexGrid1.Rows = i + 1
MSFlexGrid1.Col = 1
MSFlexGrid1.TextStyle = flexTextInsetLight
MSFlexGrid1.TextMatrix(i, 1) = oPropSet.Item(i).Name
MSFlexGrid1.TextMatrix(i, 2) = oPropSet.Item(i).Value
MSFlexGrid1.AllowUserResizing = flexResizeBoth
Next i
end sub