Author Topic: Layer 0 attack  (Read 17379 times)

0 Members and 1 Guest are viewing this topic.

Notsober

  • Guest
Re: Layer 0 attack
« Reply #30 on: November 18, 2008, 02:30:17 PM »
i must be grossly misunderstanding something.

You reposted posted my original that you fixed. Where I'm going wrong is that I cannot reproduce what you're doing with all the code you're posting.

Now, not trying to sound overly whiny, but unless you come to my office and show me exactly what you're doing, I otherwise have no idea.

I understand that I can't just throw a whole bunch of code into a notepad, call it whatever I want, and expect it to work properly. Please post a step by step instruction manual on how to decipher the code you're posting  :lol:

i know how to follow directions. Provided the directions aren't taking me to Jerusalem, when I really want to go to Moscow  :police:

Notsober

  • Guest
Re: Layer 0 attack
« Reply #31 on: November 18, 2008, 02:42:14 PM »
Just explode everything a dozen times and THEN see if you can find it.  When / if you do, undo and go change it.

Quick Select found nothing on these layers. Although Layer Manager insists there are objects on those layers... great.


M-dub

  • Guest
Re: Layer 0 attack
« Reply #32 on: November 18, 2008, 02:45:15 PM »
Just explode everything a dozen times and THEN see if you can find it.  When / if you do, undo and go change it.

Quick Select found nothing on these layers. Although Layer Manager insists there are objects on those layers... great.



Did you try quick select before or after a dozen Explode commands?

Notsober

  • Guest
Re: Layer 0 attack
« Reply #33 on: November 18, 2008, 02:47:20 PM »
Just explode everything a dozen times and THEN see if you can find it.  When / if you do, undo and go change it.

Quick Select found nothing on these layers. Although Layer Manager insists there are objects on those layers... great.



Did you try quick select before or after a dozen Explode commands?

before AND after.

besides, it only lets me explode ONCE, after that says: 3917 objects were not able to be exploded.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Layer 0 attack
« Reply #34 on: November 18, 2008, 02:48:35 PM »
I have the borders now, that some reason there are some leftover layers that won't purge! i cannot find where they are hiding! grrrr....
Try the code here for that.

[ http://www.theswamp.org/index.php?topic=13052.0 ]
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Notsober

  • Guest
Re: Layer 0 attack
« Reply #35 on: November 18, 2008, 02:53:07 PM »
I have the borders now, that some reason there are some leftover layers that won't purge! i cannot find where they are hiding! grrrr....
Try the code here for that.

[ http://www.theswamp.org/index.php?topic=13052.0 ]

THANKS... but...

Quote
Command: chaselayer


+++ Layers that were not found anywhere:
   0
   0
   33
   6
   EQUIPMENT INSUL
   TEXT3 (EQUIPMENT)
Command:

now what? If they weren't found anywhere, how come they won't freaking purge??

Spike Wilbury

  • Guest
Re: Layer 0 attack
« Reply #36 on: November 18, 2008, 03:03:36 PM »
Try my SuperBurst command:

http://www.theswamp.org/index.php?topic=18383.msg224660#msg224660

Run it and then - call the autocad purge command as needed.

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: Layer 0 attack
« Reply #37 on: November 18, 2008, 03:04:42 PM »
Hi all... I know some of you won't like this, but I need a huge favor. My company is not listening to me, they don't want to spend the money, they don't want to bill the client 40 hours per dwg to simplify these P&ID's (process migration).

Maybe I've missed something but... what's the point of simplifying the drawings?  Why go through the trouble of setting everything to layer 0?
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

Notsober

  • Guest
Re: Layer 0 attack
« Reply #38 on: November 18, 2008, 03:06:48 PM »
Hi all... I know some of you won't like this, but I need a huge favor. My company is not listening to me, they don't want to spend the money, they don't want to bill the client 40 hours per dwg to simplify these P&ID's (process migration).

Maybe I've missed something but... what's the point of simplifying the drawings?  Why go through the trouble of setting everything to layer 0?

Look here.

Notsober

  • Guest
Re: Layer 0 attack
« Reply #39 on: November 18, 2008, 03:09:17 PM »
Try my SuperBurst command:

http://www.theswamp.org/index.php?topic=18383.msg224660#msg224660

Run it and then - call the autocad purge command as needed.

Greek. Like Chinese, I don't understand it.

If you spoke German, I can understand that  :-D

Spike Wilbury

  • Guest
Re: Layer 0 attack
« Reply #40 on: November 18, 2008, 03:14:08 PM »
Try my SuperBurst command:

http://www.theswamp.org/index.php?topic=18383.msg224660#msg224660

Run it and then - call the autocad purge command as needed.

Greek. Like Chinese, I don't understand it.

If you spoke German, I can understand that  :-D

Download the arx.... SuperBurst17.arx (if you are running a latest autocad version 2007 and greater - I left the source code open, any swamper can play with the code if they want) - load it in autocad, call the command: SUPERBURST, select ALL and at the end purge your drawing and maybe use the old command -change to change all to layer 0....

see if helps.

(and nope I do not speak German, is in my To-Do list - one of these days)

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Layer 0 attack
« Reply #41 on: November 18, 2008, 03:29:11 PM »
Give this a whirl...be warned that it deletes audited items (which in this case seemed to be empty blocks).

Code: [Select]
(defun c:allzero (/ doc makesmecry rjp-progress n ss)
  (vl-load-com)
  (setq doc (vla-get-ActiveDocument (vlax-get-Acad-Object)))
  (vla-auditinfo doc :vlax-true)
  (vla-purgeall doc)
  (vlax-for i (vla-get-Layers doc)
    (vla-put-lock i :vlax-false)
  )
  (vl-catch-all-apply 'setvar (list 'clayer "0"))

  (defun makesmecry (obj / p)
    (foreach p '(Color Linetype Lineweight)
      (if (vl-position (vlax-get-property obj p) '(256 -1 "ByLayer"))
(vl-catch-all-apply
  'vlax-put-property
  (list obj
p
(vlax-get-property
  (vlax-ename->vla-object
    (tblobjname "layer" (vla-get-layer obj))
  )
  p
)
  )
)
      )
    )
    (vl-catch-all-apply
      'vlax-put-property
      (list obj 'Layer "0")
    )
    (princ)
  )

  (vlax-for blk (vla-get-blocks doc)
    (vlax-for i blk
      (makesmecry i)
      (if (= (vla-get-ObjectName i) "AcDbBlockReference")
(foreach j (append (vlax-invoke i 'GetAttributes)
   (vlax-invoke i 'GetConstantAttributes)
   )
  (makesmecry j)
)
      )
    )
  )
  ;;deletes audited crap so be forewarned
  (if (setq ss (ssget "x" '((2 . "AUDIT*"))))
    (foreach x (mapcar 'cadr (ssnamex ss))
      (entdel x)
    )
  )
  (repeat 3 (vla-purgeall doc))
)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Layer 0 attack
« Reply #42 on: November 18, 2008, 03:34:44 PM »
That worked for me in my limited test DWG.


Also Michael's routine worked fine.

Note that I didn't have a lot of junk in the DWG.
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.

Notsober

  • Guest
Re: Layer 0 attack
« Reply #43 on: November 18, 2008, 06:50:02 PM »
Give this a whirl...be warned that it deletes audited items (which in this case seemed to be empty blocks).

are empty blocks the same thing as anonymous blocks or blocks with only a grip and empty space?

and what's specific to know about "audited" items? (so that I know what I'm getting into  8-))

whdjr

  • Guest
Re: Layer 0 attack
« Reply #44 on: November 19, 2008, 08:37:58 AM »
Change this
(defun ChangeAllItemsToLayer0 (vla-get-ActiveDocument (vlax-get-Acad-Object)))
to this
(defun ChangeAllItemsToLayer0 (doc)

but id didn't work for me

I may be late to the party and this may have already been resolved but if your using Odbx can you issue a call to an "Active Document"?  It has been a while since I used Odbx so I may be missing the mark.