Code so far :
_ctypes.COMError: (-2147352567, 'Exception occurred.', ('Invalid argument FilterType in Select', 'AutoCAD', 'C:\Program Files\Autodesk\AutoCAD 2018\HELP\OLE_ERR.CHM', -2145320939, None))
Also, quick note. there is in pyautocad some arrays with types in the link you gave above, but there are no "variant" array, and integer of 32 bit is burried in library, for me as newb, a bit hard to "extract" into simple function.
This is the array given in pyautocad of integers
import pyautocad import os import comtypes import time from pyautocad import * ACAD = Autocad(create_if_not_exists=True) try: ACAD.ActiveDocument.SelectionSets.Item("SS2").Delete() except: pass SS2obj = ACAD.ActiveDocument.SelectionSets.Add("SS2") FilterType = "0" #it should be array of integers FilterData = "Line" # this should be array of variants(strings) SS2obj.Select("5","","", FilterType, FilterData) #[url=https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-ActiveX/files/GUID-A809CD71-4655-44E2-B674-1FE200B9FE30-htm.html]Here[/url]link whats needed in autocad, cant link directly, go to selectionSet, Select(under Methods) #Also, noticed i cannot make empty commas. ",,," so i guess ,"","", should work ? SS2obj.Highlight("1")This how it looks in autohotkey wihtout comments:
SS2obj := ACAD.ActiveDocument.SelectionSets.Add("SS2") FilterType := VarArrayCreate(2, "0", "8") FilterData := VarArrayCreate(0xC, "Line", "LayerName") SS2obj.Select("5",,, FilterType, FilterData) VarArrayCreate(Type=0xC, Values*) { arr := ComObjArray(Type, Values.MaxIndex()) for i, v in Values{ arr[i-1] := v ; MsgBox % v "," i } return arr }This is the error Visual Studio shows, if this helps :
_ctypes.COMError: (-2147352567, 'Exception occurred.', ('Invalid argument FilterType in Select', 'AutoCAD', 'C:\Program Files\Autodesk\AutoCAD 2018\HELP\OLE_ERR.CHM', -2145320939, None))
Also, quick note. there is in pyautocad some arrays with types in the link you gave above, but there are no "variant" array, and integer of 32 bit is burried in library, for me as newb, a bit hard to "extract" into simple function.
This is the array given in pyautocad of integers
pyautocad.types.aInt(*seq)Returns array.array of ints (ālā code) for passing to AutoCAD