your list needs to be in pairs of "label" and actual Value of the parameter.

so it should be something like

MatTypes = ["Mat1", 0, "Mat2", 1, "Mat3", 2]


On Wed, Apr 23, 2014 at 11:51 AM, philipp seis <[email protected]> wrote:

> Dear listers,
> i hope someone has a hint
> for me here, cause me = lost.
> I want to make a layout using siComboBox.
> It gives me an error claiming:
> "python\Lib\site-packages\win32com\client\dynamic.py", line 258, in
> _ApplyTypes-"
> Can i do something about that ?
> And then it says i shoud use a 1D Array, which i guess i have...,so ???
> -----------------
> this is what i'm running:
> -------
> xsi = Application
> lm = xsi.logmessage
> from win32com.client import constants as c
> from win32com.client import Dispatch as d
> oRoot = xsi.ActiveSceneRoot
> oRsCP = oRoot.AddProperty("CustomProperty",False,'RedShiftMaterial')
>
> MatTypes = ["Mat1", "Mat2", "Mat3"]
> RsLayout = oRsCP.PPGLayout
>
> # evil line throwing the error :
> RsLayout.AddEnumControl("ChooseMaterial", MatTypes, "Type",
> c.siControlCombo)
> xsi.InspectObj(oRsCP)
>
>
> --------------------------------------------------------------------------------------
> Log:
> --------
> # ERROR : 2229 - Traceback (most recent call last):
> #   File "<Script Block >", line 18, in <module>
> #     RsLayout.AddEnumControl("ChooseMaterial", MatTypesCombo, "Type",
> c.siControlCombo)
> #   File "<COMObject <unknown>>", line 3, in AddEnumControl
> #   File "C:\Program Files\Autodesk\Softimage 2013
> SP1\Application\python\Lib\site-packages\win32com\client\dynamic.py", line
> 258, in _ApplyTypes_
> #     result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags, retType,
> argTypes) + args)
> # COM Error: Invalid argument.  UI Items should be specified as a 1D array
> of String/Value pairs. - [line 18]
>
> kind regards, philipp
>
>
>

Reply via email to