[Tutor] How to create array of variants?

Alan Gauld alan.gauld at btinternet.com
Sat Sep 13 01:22:47 CEST 2008


"Krasyn" <mndrk at mail.ru> wrote in message 
news:19450606.post at talk.nabble.com...
> # -*- coding:UTF-8 -*-
> from comtypes.client import *
> from array import array

Any reason why you are using array here?
Why not just a Python list?

> acad = GetActiveObject("AutoCAD.Application")
> dwg = acad.ActiveDocument
> mspace = dwg.ModelSpace
> circle = mspace.AddCircle(array("d",[0,0,0]),100)
> circle.Color = 3
> acad.ZoomExtents()
> dtype = array("h",[1001,1070]) # [1001,1070] doesnt' work (comtypes 
> 0.5.1)
> dvalue = ['Test_Application', 600] #OK VARIANT is not needed

If a imple list works here will it not work for the two numbers?

Just a thought,

Alan G 




More information about the Tutor mailing list