skipsophrenic Posted March 25, 2009 Posted March 25, 2009 I've been using the lisp from THIS thread since i got it. Up untill now have not had any problems, howevey when i used it today, looking at everythin from the side, it has l eft entities on 3 distinct elevations, Any clue's on why this is happening now? F.Y.I. this is a BIG drawing Quote
Lee Mac Posted March 25, 2009 Posted March 25, 2009 I may be way off the mark here, but have you tried the LISP with all your OSNAPs off? from quickly glancing at the LISP on the hyperlinked threads, I notice that it doesn't turn OSNAPs off before moving the entities... Quote
Lee Mac Posted March 25, 2009 Posted March 25, 2009 Also, check that the entities are not on locked layers, as this will also cause a problem. Quote
Lee Mac Posted March 25, 2009 Posted March 25, 2009 This should cope with R14, and also with objects on locked layers: (defun c:flat (/ ss ssObj i j) (vl-load-com) (if (setq ss (ssget "X" (list (if (getvar "CTAB") (cons 410 (getvar "CTAB")) (cons 67 (- 1 (getvar "TILEMODE"))))))) (progn (setq ssObj (mapcar 'vlax-ename->vla-object (mapcar 'cadr (ssnamex ss))) i 0 j 0) (foreach Obj ssObj (foreach n '(1e99 -1e99) (if (vl-catch-all-error-p (vl-catch-all-apply '(lambda (x) (vla-move x (vlax-3d-point (list 0 0 0)) (vlax-3d-point (list 0 0 n)))) (list Obj))) (setq i (1+ i)) (setq j (1+ j))))) (princ (strcat "\n" (rtos (/ j 2.0)) " Objects Flattened" (if (zerop i) "." (strcat ", " (rtos (/ i 2.0)) " were on a Locked Layer!"))))) (princ "\n<!> No Objects Found <!>")) (princ)) Quote
skipsophrenic Posted March 25, 2009 Author Posted March 25, 2009 Thanks 4 the tips - i'll try them tomorraz when I get to work Quote
skipsophrenic Posted March 25, 2009 Author Posted March 25, 2009 Will do - won't be untill afternoon tho - am at limb centre in mornin gettin me new leg (Hopefully) Quote
Lee Mac Posted March 25, 2009 Posted March 25, 2009 Will do - won't be untill afternoon tho - am at limb centre in mornin gettin me new leg (Hopefully) Its not everyday you get to say that now is it... Quote
Lee Mac Posted March 25, 2009 Posted March 25, 2009 Alternatively, this will unlock all layers before performing the flatten: (defun c:flat (/ laylst ss ssObj j) (vl-load-com) (vlax-for lay (vla-get-layers (vla-get-ActiveDocument (vlax-get-acad-object))) (setq laylst (cons lay laylst))) (mapcar '(lambda (l) (vla-put-lock l :vlax-false)) laylst) (if (setq ss (ssget "X" (list (if (getvar "CTAB") (cons 410 (getvar "CTAB")) (cons 67 (- 1 (getvar "TILEMODE"))))))) (progn (setq ssObj (mapcar 'vlax-ename->vla-object (mapcar 'cadr (ssnamex ss))) j 0) (foreach Obj ssObj (foreach n '(1e99 -1e99) (if (vl-catch-all-error-p (vl-catch-all-apply '(lambda (x) (vla-move x (vlax-3d-point (list 0 0 0)) (vlax-3d-point (list 0 0 n)))) (list Obj))) nil (setq j (1+ j))))) (princ (strcat "\n" (rtos (/ j 2.0)) " Objects Flattened."))) (princ "\n<!> No Objects Found <!>")) (princ)) Quote
skipsophrenic Posted March 25, 2009 Author Posted March 25, 2009 Cool - I'm deffinately gonna test these tommorraz - u don't realise how much these'll help m8. Al I can say is thanks Quote
chelsea1307 Posted March 27, 2009 Posted March 27, 2009 if Lees suggestion doesnt work try -exporttoautocad press enter for your first selection then give a new name for the second. It will create a new dwg file with the same info but flattened. Every once in a while we get drawings that just dont want to flatten, or flat or zero(change all z values to 0) but this seems to work even when nothing else will. hope it helps 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.