How can I create in IronPython a Variant holding an array of doubles to be passed to AutoCad?

36 Views Asked by At

I am using IronPython to modify an Autocad file using COM/ActiveX. Reading information from the file is going well but now I want to move a line in the cad file.

The Move command is looking for two points and each point is to be a Variant holding an array of doubles. A simple array of doubles will not work.

How can I convert a Python list or tuple into the required data type?

Sincerely; Michelle

1

There are 1 best solutions below

0
danielm103 On BEST ANSWER

Maybe Array.CreateInstance?

https://learn.microsoft.com/en-us/dotnet/api/system.array.createinstance?view=netframework-4.8.1

Array.CreateInstance(typeof (double), 3);