IPictureDisp python

126 Views Asked by At

I try to write com addIn for Inventor in python language. All works fine, except ControlDefinitions.AddButtonDefinition method, It needs an IPictureDisp type image.

How to get an image of such type in python?

this is method signature

Sub AddButtonDefinition(DisplayName As String, InternalName As String, Classification As CommandTypesEnum, ByRef ClientId As [optional] VARIANT, ByRef DescriptionText As [defaultvalue("")] BSTR, ByRef TooltipText As [defaultvalue("")] BSTR, ByRef StandardIcon As [optional] VARIANT, ByRef LargeIcon As [optional] VARIANT, ByRef ButtonDisplay As [defaultvalue(kDisplayTextInLearningMode)] ButtonDisplayEnum, Result As [out, retval] ButtonDefinition*)

this is code example from tutorial

Dim oControlDefinitions As ControlDefinitions
Set oControlDefinitions = oApp.CommandManager.ControlDefinitions

Dim oLargeIcon As IPictureDisp
Dim oSmallIcon As IPictureDisp
Set oLargeIcon = LoadPicture(App.Path & "\Large.ico")
Set oSmallIcon = LoadPicture(App.Path & "\Small.ico")

Set oButtonDefinition = oControlDefinitions.AddButtonDefinition( _
  "Display Name", "invrSampleCommand", _
  kShapeEditCmdType, "CLSID of the AddIn", _
  "Description Text", "Tooltip", _
  oSmallIcon, oLargeIcon, _
  kDisplayTextInLearningMode)
0

There are 0 best solutions below