Is there any way, using AutoLISP, to simply detect the presence of DGN linetype-related objects in a DWG? (The purpose would be to automatically alert R2013 users when they open a DWG so that they may take corrective action.)
Thanks.
@dmfrazier wrote:
Is there any way, using AutoLISP, to simply detect the presence of DGN linetype-related objects in a DWG? (The purpose would be to automatically alert R2013 users when they open a DWG so that they may take corrective action.)
Perhaps adding something like this in accadoc.lsp
(setq *flag nil) (while (setq TblName (tblnext "LType" (null TblName))) (if (wcmatch (strcase (cdr (assoc 2 TblName))) "DGN*7,DGN*4");; add the correct names in uppercase (setq *flag T) ) ) (if *flag (alert "take corrective action") ) (princ)
Hope that helps
Henrique
Not a bad start (thank you), but the problem with this approach is that I have no way of knowing beforehand what linetype names to check for. For instance, I have a set of DWGs causing me headaches right now that have roughly 1200 unwanted (and unpurgeable) linetypes and none of them include "DGN" in their names (and it doesn't appear that there's anything else in the names that I would be able to always count on).
I wonder if maybe I should look for something other than the linetypes. One thing I've noticed is that when I use the DGNPurge utility on one of these DWGs, it makes purgeable a bunch of blocks whose names start with "*A". I wonder if that would be a reliable clue.
I can't offer much help, I don't deal with DGN's, only have two sample dgn's posted by users trying to purge those linetypes...
Just a thought
instead of testing for DGN linetypes, test for non standard linetypes (your's .lin)...
Henrique
If there is DGN linestyle data in the drawing, then the Named Objects Dictionary will have a dictionary in it named "ACAD_DGNLINESTYLECOMP" which contains most of the data objects (some others are in the extension dictionaries of the LinetTypeTableRecords).
Thank you. That looks promising....
I borrowed some code for something similar, and came up with this:
(dictsearch (namedobjdict) "ACAD_DGNLINESTYLECOMP")
In a new blank DWG based on my template, this returns nil.
In a DWG known to have "issues", this code hangs AutoCAD.
(So, I think I'm getting somewhere... but very slowly!)
Can you think of another strategy?