lamensterms Posted March 25, 2013 Posted March 25, 2013 Hey guys, I have a need to explode all ORDINATE dimensions (X and Y) in a DWG. I thought this would be simple enough but I cannot get the selection set filter list to work. My code is: (defun c:eo () (setq ss (ssget "X" '((70 . 6)))) (command "explode" ss) (princ) ) Just wondering if any of you guys could please take a look and let me know where I am going wrong? Thanks a lot. Quote
pBe Posted March 25, 2013 Posted March 25, 2013 (edited) (ssget "_x" '((0 . "DIMENSION") (-4 . "<OR") (70 . 38) (70 . 102) (70 . 166) (-4 . "OR>")) ) Oops.. mis-read the title (if (setq ss (ssget "_x" '((0 . "DIMENSION"))) ) (repeat (setq i (sslength ss)) (if (Eq (vla-get-ObjectName (vlax-ename->vla-object (setq e (ssname ss (setq i (1- i)))))) "AcDbOrdinateDimension" ) (command "_explode" e ) ) ) ) Edited March 25, 2013 by pBe Quote
lamensterms Posted March 25, 2013 Author Posted March 25, 2013 (edited) Thanks a lot for the reply pBe. The AutoLISP code you provided does work, but only on one item at a time. I cannot see any glaring reason as to why this may be… I’m afraid I don’t understand the Selection Set Filter List you have provided. My partially working code is: (defun c:eo () (setq ss (ssget "_x" '((0 . "DIMENSION") (-4 . "<OR") (70 . 38) (70 . 102) (70 . 166) (-4 . "OR>")))) (command "EXPLODE" ss) (princ) ) Can you see a reason which would be causing the routine to only operate on single items? Thanks for your help mate. Edited March 25, 2013 by lamensterms Quote
pBe Posted March 25, 2013 Posted March 25, 2013 (defun c:eo () [b] (setvar 'qaflags 1)[/b] (if (Setq ss (ssget "_x" '((0 . "DIMENSION") (-4 . "<OR") (70 . 38) (70 . 102) (70 . 166) (-4 . "OR>")))) (command "_explode" ss "")) [b] (setvar 'qaflags 0)[/b] (princ) ) Quote
Tharwat Posted March 25, 2013 Posted March 25, 2013 I hope that none of the selected dimensions would be on a locked layer . Quote
lamensterms Posted March 25, 2013 Author Posted March 25, 2013 Awesome, thanks a lot for that pBe. Tharwat - Most of the time this routine will be used immediately after adding the ordinate dimensions, so hopefully they will never be on locked layers. Thanks guys. 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.