jpcadconsulting Posted November 28, 2017 Posted November 28, 2017 Hiya gang, I've been messing around with this routine, trying to get it to place a point at the insertion poiutn of ALL selected blocks. I've got this far, but it's only placing one point on one of the selected blocks... (defun c:inspoint (/ ss) (if (and (setq ss (ssget '((0 . "INSERT"))))) (command "point" (cdr (assoc 10 (entget (ssname ss 0))))) ) (princ)) Any help is as always, much appreciated. Quote
ronjonp Posted November 28, 2017 Posted November 28, 2017 You're only getting the first item in the selection set (ssname ss 0) ? You have to iterate the selection and place a point at each instance. IMO it would be better to use entmake for the point too. Quick example: (defun c:inspoint (/ ss) ;; RJP - 11.29.2017 ;; Get selection (if (setq ss (ssget '((0 . "INSERT")))) ;; Convert to a list of enames (vl-remove-if 'listp .. then iterate list (foreach b .. (foreach b (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))) ;; Entmake a point on layer 'point' at insertion of block (entmakex (list '(0 . "point") '(8 . "point") (assoc 10 (entget b)))) ) ) ;; Shhhhh (princ) ) Quote
jpcadconsulting Posted November 28, 2017 Posted November 28, 2017 Brilliant! I knew that was the issue, just not sure how to do anything about it. ;-) Thanks! 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.