Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have an array of blocks overtop of a complicated (but not self-crossing) LWPolyline, I need to select all the blocks that are contained in or crossing the boundary. The polyline has already been selected and assigned to a global variable in an earlier step of the program. I've gotten as far as extracting the points from the polyline and putting them in a list, but no matter how I order the list, I still get a Bad Point List Argument error. For troubleshooting I have the polyline selected again in the function, seemed to help some.
The function is here, largely taken from a similar forum post:
(defun FilterGrid ( / KpSt DltSet ZmPt1 ZmPt2 Crdn_Lst Pnt_Lst PLEnt PLVLA CrdntNm Pnt TmpBndry)
(setq ZmPt1 (list (car ExtrmWst) (cadr ExtrmNrth)))
(setq ZmPt2 (list (car ExtrmEst) (cadr ExtrmSth)))
(SelectBoundary)
(setq PLVLA (vlax-ename->vla-object (car Bndry)))
(setq Crdn_Lst (vlax-get PLVLA 'Coordinates))
(setq CrdntNm 2)
(setq Pnt_Lst (list (car Crdn_Lst) (cadr Crdn_Lst)))
(setq Crdn_Lst (cdr Crdn_Lst))
(setq Crdn_Lst (cdr Crdn_Lst))
(repeat (/ (length Crdn_Lst) CrdntNm)
(setq Pnt (list (car Crdn_Lst)(cadr Crdn_Lst)))
(setq Crdn_Lst (cdr Crdn_Lst))
(setq Crdn_Lst (cdr Crdn_Lst))
(setq Pnt_Lst (cons Pnt Pnt_Lst ))
)
(setq Pnt_Lst (reverse Pnt_Lst))
(command-s "zoom" "W" ZmPt1 ZmPt2)
(setq KpSt (ssget "CP" Pnt_Lst))
(sssetfirst KpSt)
(command-s "chprop" "LA" "Defpoints" "")
(if (setq DltSet (ssget _X '((0 . "INSERT") (8 . "VP-Hold"))))
(command-s "erase")
(princ)
)
(sssetfirst nil KpSt)
(command-s "chprop" "LA" "VP-Hold")
)
Any help would be appreciated
Gorra
Solved! Go to Solution.