Daniel,
I've tested a prerelease version of pywin32 that contains the new
win32com.client.VARIANT class and it works well with AutoCAD. Once
released, you can write something like this:
import win32com.client
import pythoncom
def POINT(x,y,z):
return win32com.client.VARIANT(pythoncom.VT_ARR
VBA is faster because it's running in-process inside AutoCAD (everything is
loaded into acad.exe). Python runs out-of-process (AutoCAD objects need to
be passed back and forth between acad.exe and python.exe).
You can use AutoCAD's ObjectARX API to embed python inside AutoCAD and make
python in-p
On Fri, Oct 12, 2012 at 6:27 AM, Matteo Boscolo wrote:
> sometimes you need a combination of variant type like
> win32com.client.VARIANT(VT_VARIANT | VT_NULL,None)
>
In this case, AutoCAD and Intellicad want:
filterType = VARIANT(pythoncom.VT_ARRAY | pythoncom.VT_I2, [0])
filterData = VARIANT(
> From: wccppp <[EMAIL PROTECTED]>
> Subject: [python-win32] question about COM again: variable type?
>
> [code]
> ms.AddPoint([0.0, 0.0, 0.0]) # this line gives the problem
> [/code]
>
> # Result is of type IAcadPoint
> def AddPoint(self, Point=defaultNamedNotOptArg):
> """Create
ings (at the very least), and I don't know how to
test the Invoke case.
It will likely take me awhile to figure through the rest of this on my
own. In the meantime, this code could be pared down to solve a less
general case than Mark describes above: the Variant() cla
George Flaherty wrote:
> I have been messing around Excel, but when I run the following example I get
> an error?
>
> Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
from win32com.client i
PyObject_GenericGetAttr(obj, valAttr);
if (!obuse)
{
Py_XDECREF(reqdType);
return FALSE;
}
PythonOleArgHelper helper;
helper.m_reqdType = V_VT(var) = rawVT;
helper.MakeObjToVariant(obuse, var);
Py_XDECREF(reqdType);
Py_XDECREF(obuse);
}
// NOTE: PySequence_Check may return true for instance objects,
...
[/code]
Cheers!
-Dan Glassman
___
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32
Dan Glassman wrote:
> I don't want to post such long code, so I'm hosting it. If the links
> don't work for any interested party, please just email me and I'll get
> you a copy. I'm quite enjoying this learning experience and am open to
> al
t all. You can
also use pythoncom.Missing, which is another way to prevent arguments
from being presented to the interface:
[code]
from pythoncom import Missing
usedRange = xlApp.ActiveSheet.UsedRange
usedRange.Find('FXN3', Missing, constants.xlValues,
constants.xlWhole, constants
Dan Glassman wrote:
> Named arguments will work as suggested; this will prevent those
> arguments from being presented to the Excel interface at all. You can
> also use pythoncom.Missing, which is another way to prevent arguments
> from being presented to the interface:
>
David Carter wrote:
>>-Original Message-
>>From: Robert Brewer [mailto:[EMAIL PROTECTED]
>>Sent: Friday, February 17, 2006 4:11 PM
>>To: David Carter; python-win32@python.org
>>Subject: RE: [python-win32] Using win32com Constants
>>
>>
>>David Carter wrote:
>>
>>>Why is it that when I want
Tim Riley wrote:
> Has anyone come up with a way to add AutoCAD points using Python and
> win32? Do I have to use Makepy on the type library? For example adding a
> line to Modelspace requires you to call the AddLine method that accepts
> two arrays of doubles.
>
> Any help/tips would be greatl
12 matches
Mail list logo