Author Topic: flatten 3d objects  (Read 6742 times)

0 Members and 1 Guest are viewing this topic.

CADmonkey

  • Guest
flatten 3d objects
« 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. :)

MP

  • Seagull
  • Posts: 17342
flatten 3d objects
« Reply #1 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)
)
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

CADaver

  • Guest
Re: flatten 3d objects
« Reply #2 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.

CADmonkey

  • Guest
flatten 3d objects
« Reply #3 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.

sinc

  • Guest
Re: flatten 3d objects
« Reply #4 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:

CADaver

  • Guest
flatten 3d objects
« Reply #5 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.

SPDCad

  • Bull Frog
  • Posts: 453
flatten 3d objects
« Reply #6 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
AutoCAD 2010, w/ OpenDCL

visit: http://reachme.at/spd_designs

CADmonkey

  • Guest
flatten 3d objects
« Reply #7 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:

CAB

  • Global Moderator
  • Seagull
  • Posts: 10339
flatten 3d objects
« Reply #8 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.
I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MikePerry

  • Guest
flatten 3d objects
« Reply #9 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

TR

  • Guest
flatten 3d objects
« Reply #10 on: March 27, 2005, 12:46:40 PM »
I concur.

CADmonkey

  • Guest
flatten 3d objects
« Reply #11 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:

MP

  • Seagull
  • Posts: 17342
flatten 3d objects
« Reply #12 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.
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

MikePerry

  • Guest
flatten 3d objects
« Reply #13 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