TheSwamp

CAD Forums => CAD General => The Third Dimension => Topic started by: CADmonkey on March 15, 2005, 11:41:21 AM

Title: flatten 3d objects
Post by: CADmonkey on March 15, 2005, 11:41:21 AM
Hi there,
Anybody know of any methods of flattening all 3d objects in a drawing without laboriously selecting each individual entity and modifying its thickness? We have lots of drawings which have un-nescessary 3d objects in them which cause selection and regen delays, and as at work we only need to see the 2d store layout, getting rid of all this junk would improve things no end.
I already have 2 'FLATTEN' lisp commands, but neither of these seem to do the job correctly or easily (indeed, most of the time CAD will experience a fatal error  :evil: )
Basically, I need something to change all of the drawings' 'Z' axis values to zero, or alternatively select all entities with a Z axis value and change the thickness of those entities to zero.
Hopefully I explained that right and maybe someone out there has encountered this task before.
Ta. :)
Title: flatten 3d objects
Post by: MP on March 15, 2005, 11:54:03 AM
I've written many form of flatten proggys. Some of them are rather large apps. Plotting each layer to dxb in each viewport and reverse engineering the binary dxb file was one of my favs.

A quick and dirty way it to literally throw everything high enough up in the air so that when it comes down it splats itself flat. It may be one of the proggys you already have --

Code: [Select]
(defun c:splat ( / ss vars vals)
    ;;  to the best of my knowledge the underlying technique
    ;;  was made public first by Mr. Randy Richardson
    (cond
        (  (setq ss (ssget))
            (setq vals
                (mapcar 'getvar
                    (setq vars '("cmdecho" "highlight"))
                )
            )
            (mapcar 'setvar vars '(0 0))
            (command
                "_.move"   ss "" "_non" '(0 0 +1e99) ""
                "_.move" "_p" "" "_non" '(0 0 -1e99) ""
            )
            (mapcar 'setvar vars vals)
        )
    )
    (princ)
)
Title: Re: flatten 3d objects
Post by: CADaver on March 15, 2005, 12:25:09 PM
Quote from: CADmonkey
We have lots of drawings which have un-nescessary 3d objects in them which cause selection and regen delays,
...
getting rid of all this junk would improve things no end.
I think you're going to be disappointed if you're expecting some noticable improvement in performance.
Title: flatten 3d objects
Post by: CADmonkey on March 16, 2005, 04:39:00 AM
After manually sorting out all of the 3d stuff yesterday as a test, the selection box no-longer hangs for 2-3 seconds when you are picking objects, so there is obviously something going on :) these are the only drawings with 3d entities in them and the only ones that suffer from this hanging problem, go figure...
I'll give that code a go, see what happens. It doesn't look like any of the 'flatten' routines I've already got, so fingers crossed :wink:
Cheers.
Title: Re: flatten 3d objects
Post by: sinc on March 22, 2005, 11:12:47 PM
Quote from: CADmonkey

Basically, I need something to change all of the drawings' 'Z' axis values to zero, or alternatively select all entities with a Z axis value and change the thickness of those entities to zero.
Hopefully I explained that right and maybe someone out there has encountered this task before.

Land Desktop has a very handy "Flatten Z Values" command.  I suppose that doesn't do you any good, though, eh?   :wink:
Title: flatten 3d objects
Post by: CADaver on March 23, 2005, 09:32:15 AM
Quote from: CADmonkey
After manually sorting out all of the 3d stuff yesterday as a test, the selection box no-longer hangs for 2-3 seconds when you are picking objects, so there is obviously something going on :) these are the only drawings with 3d entities in them and the only ones that suffer from this hanging problem, go figure...
No doubt you have a "hang-time" problem, but we do 3D exclusively and have never experienced such a selection problem, so the fault is probably not 3D.  It's probably related more to proxy objects that are killed when flattened.
Title: flatten 3d objects
Post by: SPDCad on March 23, 2005, 01:32:25 PM
If your have the express tools installed, there is a FLATTEN.lsp that comes with it.
FLATTEN.lsp is one of the those command line only lisps. Check out the Express tools help file for more command line only lisps.

Enjoy!  :D
Title: flatten 3d objects
Post by: CADmonkey on March 27, 2005, 01:15:39 AM
Quote from: SPDCad
If your have the express tools installed, there is a FLATTEN.lsp that comes with it.
FLATTEN.lsp is one of the those command line only lisps. Check out the Express tools help file for more command line only lisps.

Enjoy!  :D


Sadly, as my boss is a tight git, my 'copy' of autoCAD at work was not entirely above board, if you take my drift (though my boss insists on assuring me he paid for a standalone licence for my version of AutoCAD), thus autoCAD express tools was not included on the disk I was given to install from.
darn cheapskates... no way to run a business, but I guess that's why he gets paid a shed load o' cash and I get minimum wage as a mere caddie :fart:



Quote
It's probably related more to proxy objects that are killed when flattened.

interesting... could be onto something there, loads of the drawings we get with this problem are from the same ppl, who appear to know sod-all about CAD and xrefs and all that stuff. As usual it's left to the drawing office to sort out other peoples rubbishy work; indeed a recent bunch of dwg's we received repeatedly crashed cad and remain un-useable, to the point where it was easier to to just go and survey the store ourselves and not rely on these third party issues. This only seems to happen with drawings for this particular mainstream supermarket client; everybody else manages to get it right. Perhaps (as I read in another thread) it's time to get the bosses here to specify certain requirements for electronic drawings when they are tendering/negotiating new contracts. :roll:
Title: flatten 3d objects
Post by: CAB on March 27, 2005, 08:18:47 AM
Here are some more items that may be slowing your drawing down.

Layer Filters
http://www.theswamp.org/phpBB2/viewtopic.php?t=4265&highlight=delay+filters
http://theswamp.org/phpBB2/viewtopic.php?t=2760&highlight=delete+layer+filter

True Type Fonts
http://www.theswamp.org/phpBB2/viewtopic.php?t=1243&highlight=type+font

Other Items
http://www.theswamp.org/phpBB2/viewtopic.php?p=22083#22083

If you have or can find 'CDG Purge 3.0' it is a very good tool, note that I think
version 4.0 is unstable and none are supported anymore.
Title: flatten 3d objects
Post by: MikePerry on March 27, 2005, 12:22:45 PM
Quote from: CADmonkey
Sadly, as my boss is a....
Hi CADmonkey

Warning, total personal opinion coming next (not intended to offend in any shape or form)....

I would seriously think about revising the first part of your statement, unless you are totally happy to broadcast such information in a public arena.

Cheers, Mike
Title: flatten 3d objects
Post by: TR on March 27, 2005, 12:46:40 PM
I concur.
Title: flatten 3d objects
Post by: CADmonkey on March 28, 2005, 07:09:09 AM
Quote from: MikePerry
Quote from: CADmonkey
Sadly, as my boss is a....
Hi CADmonkey

Warning, total personal opinion coming next (not intended to offend in any shape or form)....

I would seriously think about revising the first part of your statement, unless you are totally happy to broadcast such information in a public arena.

Cheers, Mike


No problem, with the oppinion bit ;)  but out of curiosity which bit do you mean specifically, the bit about the software, or my oppinion of my boss?
For propriety's sake I can confirm that my version of CAD is properly licenced (having pushed for clarification on this point at work today) - yes, I am at work on a bankholiday :(
As for what I think of my boss... well, either way, I'm just a lackey when it comes to having any say (or not) in things around our office - seems to be a fairlt typical response from management who have no experience of using CAD/being part of a functioning drawing office: it's all witchcraft to him  :roll: just so long as he gets what he wants is all that matters  :lol:

Thanks for the linkc CAB, I'll check 'em out  :wink:
Title: flatten 3d objects
Post by: MP on March 28, 2005, 08:09:00 AM
So you are cool if your boss reads this thread? Tread carefully friend, sometimes folks don't have skin as thick as we think.
Title: flatten 3d objects
Post by: MikePerry on March 28, 2005, 08:09:29 AM
Quote from: CADmonkey
No problem, with the oppinion bit ;)  but out of curiosity which bit do you mean specifically, the bit about the software, or my oppinion of my boss?
Hi CADmonkey

Honest answer. both.

But I was really referring to "my 'copy' of autoCAD at work was not entirely above board, if you take my drift".

But if you are happy to broadcast such information with a public arena that's your prerogative (I was only attempting to offer a little bit of friendly advice).

Cheers, Mike