I was hoping someone could give me some pointers on using comtypes.

I’m creating an object using CreateObject but I’m unable to programmatically 
find keys and values for enumerations.  From looking through the generated 
code, I can see that the enumerations are parsed but dumped into the module’s 
global scope.  Is this correct?  

# values for enumeration 'IlluminationNormalization'
nmSpotsize = 1
nmIntensity = 2
nmCondenser = 3
nmMiniCondenser = 4
nmObjectivePole = 5
nmAll = 6
IlluminationNormalization = c_int # enum


From the comments in the generated code, I can see that comtypes knows which 
enum the constants came from but is this information available from comtypes?  
I’m trying to see if it is discoverable other than looking in the generated 
code.

I’d like something to the effect of:


import comtypes.client as cc

scope = cc.CreateObject(‘TEMScripting.Instrument’)
enums = cc.Enums(scope)
scope.Illumination.Normalization = enums.IlluminationNormalization.nmAll

instead of:

import comtypes.client as cc

scope = cc.CreateObject(‘TEMScripting.Instrument’)
scope.Illumination.Normalization = 6

Thanks,
-Craig

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to