Jump to content
Dinochrome

delete all of the ATTDEFs that are blank and left over on paperspace, but not visible

Recommended Posts

Dinochrome

I have a drawing that has a large quantity of exploded blocks – AutoCADE. I’d like to delete all of the ATTDEFs that are blank and left over on paperspace, but not visible.

 

The drawings I’m editing are in one file, multi-tab. When I select a piece of text to edit, most of them are actually ATTDEFs and I get the dialoge box with: Tag, Prompt, and Default. I could work that way, but I want to leave the file clean when I’m done.

 

I found a routine that converts all of the ATTDEFs to text, but when I select “ALL”, it even grabs the ones that are blank and not visible.

I’d like to find a way to just delete the blanks before I run the routine. I mean, why leave them in the drawing? It’s clumsy.

 

Is there a way to use filters for blank ATTDEFs?

 

Here is the LISP location: http://lazydrafter.blogspot.com/2012/11/convert-exploded-attributes-to-text.html

Share this post


Link to post
Share on other sites
RobDraw

If purge does not delete them when the purge empty objects selection is checked, you could select all with Ctrl+A and deselect with Shift+crossing window and erase what left over. WBlock works with this also.

 

What else have you tried?

Share this post


Link to post
Share on other sites
Dinochrome

...hmmmn, will that affect elements on the other tabs? I'll give it a try.

Share this post


Link to post
Share on other sites
Dinochrome

I'm having a tough time. I keep getting logged out of the forum every couple minutes before I can reply.

 

I've don -purge > reg, zero-length, and empty text.

 

When I select "ALL" to copy the contents of a layout, it doesn't bring it to a new drawing.

Share this post


Link to post
Share on other sites
Dinochrome

I was trying to make a test file that I could upload.

Share this post


Link to post
Share on other sites
nukecad
I keep getting logged out of the forum every couple minutes before I can reply.

 

Tick the 'Remember Me' box when you log in.

 

Don't forget to then log out when you have finished your visit.

Share this post


Link to post
Share on other sites
RobDraw

So where is that file?

Share this post


Link to post
Share on other sites
Dinochrome

I'm trying to delete all but one tab. When I delete all of the other tabs, it appears that the attribute definitions on the tab I'm examining and planning on uploading are miraculously gone.

 

I've done a recover on it, but there seems to be something fishy.

 

It seems to clear up all of the tabs when I delete the second tab.

Share this post


Link to post
Share on other sites
Dinochrome

OK, I have it pared down to two tabs with the

test.dwg

Share this post


Link to post
Share on other sites
Dinochrome

...first tab is I think where the actual problem lies.

 

I have it uploaded with the second tab active and ready for A2T lisp.

Share this post


Link to post
Share on other sites
Dinochrome

I tried running -purge again - nuclear option...

 

Command: -PUrge

 

Enter type of unused objects to purge [blocks/DEtailviewstyles/Dimstyles/Groups/LAyers/LTypes/MAterials/MUltileaderstyles/Plotstyles/SHapes/textSTyles/Mlinestyles/SEctionviewstyles/Tablestyles/Visualstyles/Regapps/Zero-length geometry/Empty text objects/All]: a

Enter name(s) to purge :

Verify each name to be purged? [Yes/No] : n

 

No unreferenced blocks found.

 

No unreferenced layers found.

 

No unreferenced linetypes found.

 

No unreferenced text styles found.

 

No unreferenced shape files found.

 

No unreferenced dimension styles found.

 

No unreferenced mlinestyles found.

 

No unreferenced plotstyles found.

 

No unreferenced table styles found.

 

No unreferenced materials found.

 

No unreferenced visual styles found.

 

No unreferenced multileader styles found.

 

No unreferenced groups found.

 

No unreferenced Detail view styles found.

 

No unreferenced Section view styles found.

 

Command: *Cancel*

 

Command: A2t

 

Select objects: all

93 found

 

They're still there.

Share this post


Link to post
Share on other sites
RobDraw

It appears that file has 93 attributes and all have a value assigned.

Share this post


Link to post
Share on other sites
Dinochrome

;;;
;;; Convert Attribute definitions to text
;;;

(defun c:A2T (/ eset1 blkcnt en enlist vl space)
 (setq eset1  (ssget (list (cons 0 "ATTDEF")))
blkcnt 0
 )

 (if eset1
   (while (<= blkcnt (- (sslength eset1) 1))
     (setq en    (ssname eset1 blkcnt)
    enlist (entget en)
    space  (cdr (assoc 67 enlist))
     )
     (setq vl (list
  (cons 0 "TEXT")
  (cons 100 "AcDbEntity")
  (cons 100 "AcDbText")
  (assoc 7 enlist)
  (assoc 8 enlist)
  (assoc 10 enlist)
  (assoc 40 enlist)
  (cond ((assoc 62 enlist))
        ((cons 62 256))
  )
  (cons 1 (cdr (assoc 2 enlist)))
  (if (= space nil)
    (cons 67 0)
    (cons 67 space)
  )
       )
     )
     (entdel en)
     (entmake vl)
     (setq blkcnt (1+ blkcnt))
   )
 )
)

 

...run this on the second tab and select "ALL" for your selection set. You can erase the visible objects with a window first...)

 

A whole bunch appear out of nowhere.

Edited by SLW210
Code Tags

Share this post


Link to post
Share on other sites
Dinochrome

I'm not a lisp programmer when I pasted it, I lost the extra indents in the routine from the original.

Share this post


Link to post
Share on other sites
Dinochrome

I did a save-as on the original, erased everything "ALL", and went tab-by-tab and copied it all from the original to th copy.

 

Thank you for the consideration, but this is more of a exercise in why/how.

 

I'm finished with my clumsy solution.

Share this post


Link to post
Share on other sites
Dinochrome

I selected visible elements with a window FYI, base-point 0,0 in each model for consistency.

Share this post


Link to post
Share on other sites
RobDraw

Okay, I didn't realize that the file was before you exploded nor that you were the one doing the exploding. I thought you were the victim. I'm glad you had the unmolested version.

 

Are you familiar with the burst command?

 

It's much better for exploding attributed blocks. Among a couple other things, it converts the attributes to text and leaves empty text for the blank ones which can easily be purged. With that layout, after bursting you are left with one empty block which you can easily get rid of using the Ctrl+A selection/cross window deselect method.

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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