Jump to content

Flatten alternatives


nocturne00

Recommended Posts

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

Link to comment
Share on other sites

  • Replies 28
  • Created
  • Last Reply

Top Posters In This Topic

  • Cad64

    5

  • nocturne00

    5

  • skipsophrenic

    3

  • merdrignac

    3

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) 
)

Link to comment
Share on other sites

wow, so nice, works like a charm :D

this sure beats the flatten command hehe.

 

ever experienced errors or bugs using it?

 

thanks bro

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

"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 :x

anyways, the lisp routine really works. will report any bugs if ever.

 

Thanks again :D

Link to comment
Share on other sites

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 by SLW210
Code Tags
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 4 years later...

Hello the script above works great.. however I am recieving the following error message:

 

; error: Automation Error. Not allowed for this proxy

 

Any ideas ? :D

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...