nocturne00 Posted August 23, 2008 Posted August 23, 2008 Just a follow up to the inquiry on the Flatten command. Is there a way to use set all entities in a drawing to elevation 0? like moving them all to Z=0 like the flatten command but all entities in one command including blocks, hatches, etc TIA:D Quote
Cad64 Posted August 23, 2008 Posted August 23, 2008 I found this routine somewhere, years ago, and have been using it ever since. It works much better than the Flatten command. (defun c:flat (/ total-nabor) (vl-load-com) (if (setq total-nabor (ssget "x" '((410 . "model")))) (progn (setq total-nabor (mapcar 'vlax-ename->vla-object (mapcar 'cadr (ssnamex total-nabor))) ) (foreach i '(1e99 -1e99) (mapcar (function (lambda (x) (vla-move x (vlax-3d-point (list 0 0 0)) (vlax-3d-point (list 0 0 i))) )) total-nabor ))) ) (princ) ) Quote
nocturne00 Posted August 24, 2008 Author Posted August 24, 2008 wow, so nice, works like a charm this sure beats the flatten command hehe. ever experienced errors or bugs using it? thanks bro Quote
Cad64 Posted August 24, 2008 Posted August 24, 2008 No, I don't think I've ever had any problems with it. I'm not saying it's perfect, but it's pretty good, and it has always worked for me. But I also know there's a first time for everything, so if you experience any problems with it, post back and maybe one of the lisp guys can sort it out. Quote
tzframpton Posted August 24, 2008 Posted August 24, 2008 Good routine. I wonder if this will correct the "entities not coplanar" crap I have to deal with from time to time. That's the only time I use the FLATTEN command but I can't stand using it. It doesn't stay the same distance. Quote
nocturne00 Posted August 25, 2008 Author Posted August 25, 2008 "entities not coplanar" Likewise,in civil 3d its so fraustrating to join or fillet plines end come up with "lines are not coplanar" result. when u check the line elevations you just get a + or -0.0026 line elevation, whats worse is almost half of the entire drawing is set to this elevation... really fraustrating anyways, the lisp routine really works. will report any bugs if ever. Thanks again Quote
skipsophrenic Posted August 27, 2008 Posted August 27, 2008 just so i know (have been redirected here for an answer) once loaded do i just type the word "flat" in command bar? Quote
Cad64 Posted August 27, 2008 Posted August 27, 2008 Yes, just type FLAT, hit Enter and the routine will do the rest. Quote
merdrignac Posted September 1, 2008 Posted September 1, 2008 (edited) Try this button macro: C^C_move;_all;;0,0,0;0,0,1e99;_move;_p;;0,0,0;0,0,-1e99; Quick and simple Edited October 30, 2012 by SLW210 Code Tags Quote
Scott44 Posted September 2, 2008 Posted September 2, 2008 Question on that routine. How do I put it to use? I've never set up commands before. Quote
Scott44 Posted September 2, 2008 Posted September 2, 2008 Makes perfect sense. I followed the directions. Copied and pasted it. put it in the same place where all my lisp routines are. So it's loading....But when I type "Flat" noting happens. Says it's an unknown command. Anyone have any idea what I might have done wrong? Quote
merdrignac Posted September 5, 2008 Posted September 5, 2008 All depends on which version of Autocad you use. Is Building Systems an autocad varient? Quote
nocturne00 Posted September 5, 2008 Author Posted September 5, 2008 Yep its autoacad,,, better known as ABS (AutoCAD Building Systems) It should work since it is basically still autoCAD based. all the basics of it are there... Quote
GE13579 Posted September 5, 2008 Posted September 5, 2008 Makes perfect sense. I followed the directions. Copied and pasted it. put it in the same place where all my lisp routines are. So it's loading....But when I type "Flat" noting happens. Says it's an unknown command. Anyone have any idea what I might have done wrong? Did you save it as flat.lsp? Quote
nocturne00 Posted September 9, 2008 Author Posted September 9, 2008 No, I don't think I've ever had any problems with it. I'm not saying it's perfect, but it's pretty good, and it has always worked for me. But I also know there's a first time for everything, so if you experience any problems with it, post back and maybe one of the lisp guys can sort it out. Hi Cad; stumbled on a small glitch when using flat. i dont know if you already came accross this but it seems when I use the lisp it affects dynamic blocks. the command changes the Properties>Geometry>ScaleZ of the block to 0 and thus making the Dynamic block... non dynamic;(thanks to Ipseifer for figuring this out by the way) all dynamic functions are not usable although in BEDIT the dynamic functions are still present, but not usable anymore unless the ScaleZ factor is changed to 1 . Hope you guys can help me with this coz ive come to use this Lisp quite often now. TIA Quote
merdrignac Posted September 16, 2008 Posted September 16, 2008 The macro I posted was meant to be attached to a button on a button menu. You have to open customise, create a new command, and add the macro and apply. when you click on the button the command to reduce everything to zero in the z plane, is executed with no further imput required. For details on customising refer to Autocad 'Help'. Hope that helps Quote
Morphix Posted October 29, 2012 Posted October 29, 2012 Hello the script above works great.. however I am recieving the following error message: ; error: Automation Error. Not allowed for this proxy Any ideas ? 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.