Selection Set ERROR: Invalid argument pSelSet in AddItems

Selection Set ERROR: Invalid argument pSelSet in AddItems

tanmayms3009
Participant Participant
730 Views
2 Replies
Message 1 of 3

Selection Set ERROR: Invalid argument pSelSet in AddItems

tanmayms3009
Participant
Participant

Hi, 

 

I was trying to create selection set for some selected objects present in my AutoCAD drawing using Python, when the below mentioned error was thrown:

 

"self.__com_Invoke(memid, riid_null, lcid, invkind,
_ctypes.COMError: (-2147352567, 'Exception occurred.', ('Invalid argument pSelSet in AddItems', 'AutoCAD', 'C:\\Program Files\\Autodesk\\AutoCAD 2018\\HELP\\OLE_ERR.CHM', -2145320939, None))"

 

To control the type of items present in the array of objects I filtered out my model with only circles, but still, the error was there.

 

Here is my code :

"

from pyautocad import Autocad

acad = Autocad(create_if_not_exists=True)

ss = acad.doc.SelectionSets.Add("ss1")

arr_object = []
for i in acad.iter_objects_fast(object_name_or_list="AcDbCircle")
    arr_object.append(i)

ss.AddItems(arr_object)

"

 

Can anyone please guide me on how to deal with this error ?

 

Thanks in advance.

 

 

0 Likes
731 Views
2 Replies
Replies (2)
Message 2 of 3

devitg
Advisor
Advisor

@tanmayms3009 it seem to be not a LISP , please post it a VBA forum

 

https://forums.autodesk.com/t5/vba/bd-p/33

 

or net

 

https://forums.autodesk.com/t5/net/bd-p/152

0 Likes
Message 3 of 3

tanmayms3009
Participant
Participant

Thanks for your prompt response @devitg ,

 

I am sorry that I did not mention "Python". I want the solution in Python itself.

 

Kind regards.

0 Likes