brandalf_the_semiGray Posted February 3, 2020 Posted February 3, 2020 Trying to extract a name I generate and add to a list for use in the ssget function. I keep getting bad point pair errors. Below is the offending line (setq blks (ssget "x" (cons 2 (nth i nm)))) This is what's in the nth item. Below is the code i use to append an item into the list i'm trying to access in the ssget function (setq names (append names (list (read (strcat partNum "_" (nth (atoi (nth (setq index (1+ index)) dimension)) (cadr (nth 1 data)))))))) Ideas? I've tried everything from strcat, to using (assoc "names" (nth i nm)) in my ssget call. Pretty stuck here. Quote
brandalf_the_semiGray Posted February 3, 2020 Author Posted February 3, 2020 (edited) So i realized it was a symbol, so i've used vl-symbol-name to retrieve the string name, but i'm still unable to send the (cons 2 (vl-symbol-name (nth i nm))) argument to the ssget function. I still get a bad point argument error. Please help. Edited February 3, 2020 by brandalf_the_semiGray Quote
dlanorh Posted February 3, 2020 Posted February 3, 2020 (edited) 1 hour ago, brandalf_the_semiGray said: Trying to extract a name I generate and add to a list for use in the ssget function. I keep getting bad point pair errors. Below is the offending line (setq blks (ssget "x" (cons 2 (nth i nm)))) This is what's in the nth item. Below is the code i use to append an item into the list i'm trying to access in the ssget function (setq names (append names (list (read (strcat partNum "_" (nth (atoi (nth (setq index (1+ index)) dimension)) (cadr (nth 1 data)))))))) Ideas? I've tried everything from strcat, to using (assoc "names" (nth i nm)) in my ssget call. Pretty stuck here. Only blocks have names. If you want to ssget all blocks with a certain name the filter needs to be in the format : (ssget "x" (list '(0 . "INSERT") (cons 2 blkname))) Where blkname is a string of block names separated with comma(s). What type of entity is SYM ? Edited February 3, 2020 by dlanorh Quote
ronjonp Posted February 3, 2020 Posted February 3, 2020 1 hour ago, brandalf_the_semiGray said: Trying to extract a name I generate and add to a list for use in the ssget function. I keep getting bad point pair errors. Below is the offending line (setq blks (ssget "x" (cons 2 (nth i nm)))) ... Quick glance: ;; This (setq blks (ssget "_X" (cons 2 (nth i nm)))) ;; Should be this (setq blks (ssget "_X" (list (cons 2 (nth i nm))))) Quote
brandalf_the_semiGray Posted February 3, 2020 Author Posted February 3, 2020 oh man. that did it. thanks guys. I was reading the documentation for ssget and didn't catch that it needed to recieve a list for some reason Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.