DP thank you. Unexpectedly I manage to get something working. I am not sure how it works but it works. I am only using the command line wrapper to create polylines. This code works on AutoCAD 2012 vanilla, perhaps it did not work before because I was running the code in AutoCAD 2012 Mechanical. I am having an issue with the DIMSCALE for dimensions in AutoCAD 2012 Mechanical, so may be the problem with selectionsets is just in AC Mech.