Ronan Paixão schrieb:
> Also, I'm had some problems with type coercion. In the VB examples, the
> variable types are declared before using, which coerce return types. The
> comtypes documentation is terrible and I didn't find anything to do
> similar. The problem is that ms.Item(number), where ms is the
> ModelSpace, returns an IAcadEntity object, but sometimes I need methods
> from the main class (or pointer), like IACadBlockReference. Since I
> didn't find how to do it, I dug deep and found a way to do it like this:
> item=comtypes.POINTER(comtypes.gen.AutoCAD.IAcadBlockReference).from_param(ms.Item(number))
> That seems a bit long, just to use the Explode() function, which is
> available for IACadBlockReference objects but not IACadEntity ones.
> Is there a more direct way to do it?

See my other post in this thread:  Use a QueryInterface() call.

> By the way, I wonder why we must enter array.array('d', coords) when a
> function requires an array of doubles, but when something should output
> an array of doubles, comtypes gives a tuple.

IIRC, this is because autocad's type library isn't precise in what acad accepts.
I have no idea how VB does it.

Thomas 

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to