TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: V-Man on July 09, 2009, 08:28:39 AM

Title: non-graphical non-native objects
Post by: V-Man on July 09, 2009, 08:28:39 AM

Ok, I did a search but could not find much about this topic. I have several drawings with non-graphical non-native objects that of course are invisible and non selectable and I cannot seem to get rid of them. I have tried Wblock'ing the drawing with no success, and of course purging does not do it. I have even tried to explode everything in the drawing and then purge and it does not do it either. I take it these are dictionaries?


These are the problem childs I think.

Quote
-- Name: ACAD_MLEADERSTYLE
("AcDbMLeaderStyle" . 1)

-- Name: ACAD_MLINESTYLE
("AcDbMlineStyle" . 1)

-- Name: ACAD_PLOTSTYLENAME
("AcDbPlaceHolder" . 1)

-- Name: ACAD_SCALELIST
("AcDbScale" . 33)

-- Name: ACAD_TABLESTYLE
("AcDbTableStyle" . 2)

-- Name: ACAD_VISUALSTYLE
("AcDbVisualStyle" . 16)


How can I get "RID" of them?

Thanks,

Don
Title: Re: non-graphical non-native objects
Post by: CAB on July 09, 2009, 08:43:05 AM
Looks like Native ACAD database objects to me. :?
Title: Re: non-graphical non-native objects
Post by: T.Willey on July 09, 2009, 10:52:31 AM
Looks like Native ACAD database objects to me. :?
x2

Plus there isn't really that many records in those dictionaries, so I wouldn't think they would be a problem, or slow down a drawing.
Title: Re: non-graphical non-native objects
Post by: V-Man on July 09, 2009, 11:08:07 AM

Quote
Plus there isn't really that many records in those dictionaries, so I wouldn't think they would be a problem, or slow down a drawing.

I agree, but unfortunately I have to get them out somehow. Our client standards are very picky and I have no idea how they originally got there but I need them gone. I have tried everything I can think of to get rid of them with no success.
Title: Re: non-graphical non-native objects
Post by: Chuck Gabriel on July 09, 2009, 11:14:08 AM
You could try converting the drawing to R12 format, but that would most likely hose some other things that would upset your client.
Title: Re: non-graphical non-native objects
Post by: CAB on July 09, 2009, 11:57:01 AM
You have tried vla-delete?
Title: Re: non-graphical non-native objects
Post by: T.Willey on July 09, 2009, 11:58:53 AM
The scale list is because of the annotation option within drawings now.  I guess you could slim that down, not sure about getting rid of it altogether.

I'm not sure about the visual styles one.  It may have something to do with a vertical.

The table style, just erase the one that isn't standard, and you should be good to go.


Or do you have to erase the dictionaries?  If so, you might loose some data that uses that information.
Title: Re: non-graphical non-native objects
Post by: V-Man on July 09, 2009, 12:06:09 PM

Quote
You have tried vla-delete?

No I have not.


Quote
Or do you have to erase the dictionaries?

Yes, I need/want to just erase all of the dictionaries regardless of the contents.
Title: Re: non-graphical non-native objects
Post by: CAB on July 09, 2009, 01:31:14 PM
I would think that you could save bac to 2000 or 2002 and remove all but these:
-- Name: ACAD_MLINESTYLE
("AcDbMlineStyle" . 1)

-- Name: ACAD_PLOTSTYLENAME
("AcDbPlaceHolder" . 1)

Then you may be able to delete those.
Title: Re: non-graphical non-native objects
Post by: Chuck Gabriel on July 09, 2009, 01:41:52 PM
I would think that you could save bac to 2000 or 2002 and remove all but these:
-- Name: ACAD_MLINESTYLE
("AcDbMlineStyle" . 1)

-- Name: ACAD_PLOTSTYLENAME
("AcDbPlaceHolder" . 1)

Then you may be able to delete those.

I thought all versions after R12 would round-trip data even if they didn't know what to do with it.
Title: Re: non-graphical non-native objects
Post by: CAB on July 09, 2009, 01:48:23 PM
My thought was that you could then delete these once in an eailer version of ACAD.

In 2000 I could delete the styles but not the dictionary. "ACAD_MLINESTYLE" & "ACAD_PLOTSTYLENAME"
_1$ (vla-delete dic)
; error: Automation Error. Object is referenced by other object(s)
Title: Re: non-graphical non-native objects
Post by: Chuck Gabriel on July 09, 2009, 01:50:15 PM
My thought was that you could then delete these once in an eailer version of ACAD.

In 2000 I could delete the styles but not the dictionary. "ACAD_MLINESTYLE" & "ACAD_PLOTSTYLENAME"
_1$ (vla-delete dic)
; error: Automation Error. Object is referenced by other object(s)

Oh.  Now I see what you mean.
Title: Re: non-graphical non-native objects
Post by: CAB on July 09, 2009, 02:02:17 PM
Tried saving & reopening the DWG. The Dictionary's were empty but still could not delete.
Opening the Layer Manager caused an alert saying "Could not find plot style Default"
My guess is that you can not delete some dictionaries.
Better re think your specifications.  :-o
Title: Re: non-graphical non-native objects
Post by: dgorsman on July 09, 2009, 02:09:03 PM
What, specifically, do the client standards tell you to get rid of?  I haven't seen any that specifically refer to AutoCAD data dictionaries yet, just the usual layers, text styles, that sort of thing.
Title: Re: non-graphical non-native objects
Post by: VovKa on July 09, 2009, 02:18:54 PM
this works for me (acad2005)
Code: [Select]
((lambda (Ent)
   (foreach Dic '("ACAD_MLINESTYLE" "ACAD_PLOTSTYLENAME")
     (setq Ent
    (vl-remove (cons 3 Dic)
       (vl-remove (cadr (member (cons 3 Dic) Ent)) Ent)
    )
     )
   )
   (entmod Ent)
 )
  (entget (namedobjdict))
)
Title: Re: non-graphical non-native objects
Post by: Lee Mac on July 09, 2009, 02:34:44 PM
This client of yours seems a bit stringent... I'd tell him what he can do with his dictionary standards...   :-P
Title: Re: non-graphical non-native objects
Post by: CAB on July 09, 2009, 03:09:46 PM
Something to try, will empty the dictionaries.
Minimal testing.
Code: [Select]
(defun c:DicSTYLEClean ( / dics dic dicName tmpname)
  (vl-load-com)
  (setq dics (vla-get-dictionaries
               (vla-get-activedocument (vlax-get-acad-object))
             )
  )
  (foreach dicname '("ACAD_MLEADERSTYLE"        "ACAD_MLINESTYLE"
                     "ACAD_PLOTSTYLENAME"       "ACAD_TABLESTYLE"
                     "ACAD_SCALELIST"           "ACAD_VISUALSTYLE"
                    )
    (if (or
          (vl-catch-all-error-p
            (setq dic (vl-catch-all-apply 'vla-item (list dics dicname))))
          (null dic))
      (prompt (strcat "\n+++  Dictionary " dicname " does not exist."))
      (progn
        (prompt (strcat "\nProcessing Dictionary " dicname " ."))
        (vlax-for item dic
          (setq TmpName (vla-getname dic item))
          (if (or (member (strcase TmpName) '("DEFAULT" "STANDARD"))
                  (vl-catch-all-error-p (vl-catch-all-apply 'vla-delete (list item)))
              )
            (prompt (strcat "\n  Dictionary entry " TmpName " can not be deleted."))
            (prompt (strcat "\n  ***  Removed " TmpName " from dictionary."))
          )
        )
      )
    )
  )
  (princ)
)
Title: Re: non-graphical non-native objects
Post by: V-Man on July 09, 2009, 03:28:00 PM

Quote
This client of yours seems a bit stringent... I'd tell him what he can do with his dictionary standards

It's kind of hard to tell the GOV what to do.
Title: Re: non-graphical non-native objects
Post by: Daniel J. Ellis on July 09, 2009, 04:56:45 PM
Have you tried copying everything from the origin back to the origin of a new drawing?

dJE
Title: Re: non-graphical non-native objects
Post by: V-Man on July 09, 2009, 05:12:42 PM

Quote
Have you tried copying everything from the origin back to the origin of a new drawing?

Yes, that is the first thing I tried.