Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SuperFlatten

16 REPLIES 16
Reply
Message 1 of 17
Anonymous
25259 Views, 16 Replies

SuperFlatten

I posted this routine at theswamp recently. I'm cross-posting it here because this NG
is where I feel like I live.

I hope those who might need it find it useful. Essentially it attempts to replace the
ExpressTools flatten command with something which actually works.

Comments and example files are welcome.

Joe Burke
16 REPLIES 16
Message 2 of 17
BillZ
in reply to: Anonymous

Hey thanks joe.

Although quite different than the express flatten command it appears to work very fast and accurately.

Quite a peice of programming.


Bill
Message 3 of 17
Anonymous
in reply to: Anonymous

Hi Bill,

I found an example file posted by you named something like this: ABPDN120,dwg.
Apparently you were looking for some way to flatten the objects contained in that
drawing.

What I'm trying to convey here is two ideas. Your example file was very helpful in
terms of the code. And I'd like to know if the code flattens your example file as you
would expect.

Regards
Joe



wrote in message news:5692152@discussion.autodesk.com...
Hey thanks joe.

Although quite different than the express flatten command it appears to work very
fast and accurately.

Quite a peice of programming.


Bill
Message 4 of 17
BillZ
in reply to: Anonymous

Hi Joe,

I use the flatten command mostly to convert 3d models into
2d representations (illustrations?).
I've attached a .png to help explain.
The image at the top was a 3d console model that flattened with your program. Everything was flattened to the WCS even though I was in a View UCS.
The bottom image I used the flatten express tool.
Note how it still looks like the model that I was looking at in 3D,
only it's now a 2D flat image.
Message 5 of 17
Anonymous
in reply to: Anonymous

Hi Bill,

Thanks for the example. Check the header comments. It's intended to flatten to WCS
regardless of the current view. Which suits my needs, but maybe I should think about
another option.

Joe


wrote in message news:5692205@discussion.autodesk.com...
Hi Joe,

I use the flatten command mostly to convert 3d models into
2d representations (illustrations?).
I've attached a .png to help explain.
The image at the top was a 3d console model that flattened with your program.
Everything was flattened to the WCS even though I was in a View UCS.
The bottom image I used the flatten express tool.
Note how it still looks like the model that I was looking at in 3D,
only it's now a 2D flat image.
Message 6 of 17
BillZ
in reply to: Anonymous

>>>but maybe I should think about
another option.
<<<

That would be nice.
An accurate flatten in the view UCS would be a big
improvement over the express flatten, which leaves a lot to be desired esp. in the area of circles, ellipses and splines that are viewed at a twist.

Bill
Message 7 of 17
Anonymous
in reply to: Anonymous

Bill,

Could you use the rotate3d command with a drawing like that and then flatten to WCS?

Attached is your example file I used for testing.

Thanks
Joe


wrote in message news:5692842@discussion.autodesk.com...
>>>but maybe I should think about
another option.
<<<

That would be nice.
An accurate flatten in the view UCS would be a big
improvement over the express flatten, which leaves a lot to be desired esp. in the
area of circles, ellipses and splines that are viewed at a twist.

Bill
Message 8 of 17
BillZ
in reply to: Anonymous

>>>Could you use the rotate3d command with a drawing like that and then flatten to WCS?

Actually, to a certain extent, we do that now.
But you have to give the user the ability to "see" the end result and then convert that to the 2d facsimile.
So,
What our program does is inserts the solid model into the drawing, then allows the user to set the "psuedo isometric" view to whatever the need is for direction in that particular drawing.
I added a 3d rotate only for a "fine tuning" of the way the model looks to the viewer.
Generally the models orientation stays the same as it is when was inserted, only the way you look at it changes.

To me, it makes more sense (and be more user friendly) to be able to flatten to the way you are looking at it (View UCS) than it would be to do a rotate3d then follow that with a view.

See attached

Bill
Message 9 of 17
Anonymous
in reply to: Anonymous

Bill,

Agreed regarding flatten to View UCS would be more user friendly. But I have to
balance that against the code revisions needed to allow it. Also the bugs such
changes might introduce. If you've even glanced at the code, you've seen it's already
a beast.

Some background. The main reason I wrote it was to flatten a civil site plan for use
as an xref in architectural drawings. I could not trust the ET flatten command to do
that. In fact, it would fail more often than not. I'll post an example file to CF if
anyone is interested in what the ET command does compared to SuperFlatten with such a
file.

Support for solid objects was sort of an afterthought.

If you haven't already, check the header comments. That may shed some light on my
view of the program and what it's designed to do.

Regards
Joe

wrote in message news:5692922@discussion.autodesk.com...
>>>Could you use the rotate3d command with a drawing like that and then flatten to
>>>WCS?

Actually, to a certain extent, we do that now.
But you have to give the user the ability to "see" the end result and then convert
that to the 2d facsimile.
So,
What our program does is inserts the solid model into the drawing, then allows the
user to set the "psuedo isometric" view to whatever the need is for direction in that
particular drawing.
I added a 3d rotate only for a "fine tuning" of the wa
y the model looks to the viewer.
Generally the models orientation stays the same as it is when was inserted, only the
way you look at it changes.

To me, it makes more sense (and be more user friendly) to be able to flatten to the
way you are looking at it (View UCS) than it would be to do a rotate3d then follow
that with a view.

See attached

Bill
Message 10 of 17
BillZ
in reply to: Anonymous

Not a problem Joe.
I only mentioned what I did because I figured you were in the mood to cut some more code. 🙂

It's the same way here, We're not "developers" and
I have to balance what I do, with what my job is.

I would think that a points transformation to the view UCS would be all that's needed but like you say, you developed your program for a specific reason while we here are doing a form of illustration to provide information to an assembly line.

We find ourselves fixing/erasing a few things using the et flatten but until we have somethng better, it beats doing everything manually.

One thing nice about not being a programmer as a primary job is, if I'm asked to do more than what I think is fesible, i can always say "who am I, Bill Kramer? 🙂

Thanks agian.

Bill
Message 11 of 17
Anonymous
in reply to: Anonymous

Attached is a revised version named SuperFlatten 1.1a. It handles text and mtext
objects with odd normals much better than the previous version.

Joe Burke
Message 12 of 17
production1PEKZ9
in reply to: Anonymous

This is great! I was trying to flatten a file for two days and there were some lines that just disappeared with every attempt to flatten them with several lisps, commands, etc..

 

This was the solution, all lines and blocks were perfectly set to 0. Saved me, and I'm commenting to hopefully revive the thread as it was pretty difficult to find it at least for me.

Message 13 of 17
pendean
in reply to: production1PEKZ9


@production1PEKZ9 wrote:

This is great! I was trying to flatten a file for two days and there were some lines that just disappeared with every attempt to flatten them with several lisps, commands, etc..

 

This was the solution, all lines and blocks were perfectly set to 0. Saved me, and I'm commenting to hopefully revive the thread as it was pretty difficult to find it at least for me.


The latest version 2.0c is here if anyone needs it https://www.theswamp.org/index.php?topic=18153.0 

Message 14 of 17
steveBVBZ5
in reply to: Anonymous

Hi Joe,
Love the Superflatten tool!
I'm try to contact you directly but get a bounce back on your @hawaii.rr.com email address.
Is there any other way of direct messaging you?
Thanks,
Steve

Message 15 of 17
john.uhden
in reply to: pendean

@pendean ,

Somewhere in this "Library of AutoCAD" is my contribution of SQUASH.lsp.  I'd love it if someone gave it a try and compared it to the ET and other offerings.

John F. Uhden

Message 16 of 17
pendean
in reply to: john.uhden


@john.uhden wrote:

@pendean ,

Somewhere in this "Library of AutoCAD" is my contribution of SQUASH.lsp.  I'd love it if someone gave it a try and compared it to the ET and other offerings.


https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fix-bug-in-flatten-lisp-when-deal-wi... 

Message 17 of 17
john.uhden
in reply to: pendean

Many thanks, @pendean .

Attached is Squash.lsp

John F. Uhden

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost