Message 1 of 6
ADT/AutoCAD 2000 to R14 Custom Objects Clean-up
Not applicable
07-10-2002
07:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear Customization Newsgroup Readers,
We are writing a routine to convert ADT/AutoCAD 2000 drawing files to
AutoCAD R14 format by eliminating all custom objects to avoid that Proxy
Objects R14's dialog box when our customers open our files.
We do not want to use the AutoCAD Batch Convert Migration Tool because it
did not clean-up those custom objects when it convert a file from AutoCAD
2000 to R14. We want to solve this problem with a Visual LISP / Visual BASIC
routine.
We concept a first code, writen below, and We are almost there. When We run
this code, all the ADT dictionaries and the most part of AutoCAD 2000
dictionaries are cleaned. However, some ACAD dictionaries and applications
are not removed from database. They are:
ACAD_LAYOUT
ACAD_PLOTSETTINGS
ACAD_PLOTSTYLENAME
ACDBHEADERROUNDTRIPXREC
ACDBVARIABLEDICTIONARY
We discoverd which they are when we open an example DWG file in R14 and then
save it for AutoCAD R12.
In that example DWG file, our routine clean-up correctly these dictionaries
from database:
AEC_2D_SECTION_STYLES
AEC_AREA_GROUP_DEFS
AEC_AREA_MODIFIERS
AEC_AREA_PROPOSALNAMES
AEC_AREA_STYLES
AEC_AREAGROUP_STYLES
AEC_CLEANUP_GROUP_DEFS
AEC_CURTAIN_WALL_LAYOUT_STYLES
AEC_CURTAIN_WALL_UNIT_STYLES
AEC_DIM_STYLES
AEC_DISP_REP_CONFIGURATIONS
AEC_DISP_REP_SETS
AEC_DISP_REPS
AEC_DISPLAY_PROPS_DEFAULTS
AEC_DOOR_STYLES
AEC_ENDCAP_STYLES
AEC_MASKBLOCK_DEFS
AEC_MVBLOCK_DEFS
AEC_POLYGON_STYLES
AEC_PROFILE_DEFS
AEC_PROPERTY_FORMAT_DEFS
AEC_PROPERTY_SET_DEFS
AEC_RAILING_STYLES
AEC_ROOFSLAB_STYLES
AEC_ROOFSLABEDGE_STYLES
AEC_SCHEDULE_TABLE_STYLES
AEC_SLAB_STYLES
AEC_SLABEDGE_STYLES
AEC_SPACE_STYLES
AEC_STAIR_STYLES
AEC_STRUCTURALMEMBER_STYLES
AEC_VARS
AEC_WALL_STYLES
AEC_WALLMOD_STYLES
AEC_WINDOW_ASSEMBLY_STYLES
AEC_WINDOW_STYLES
How can we clean-up those 5 ACAD dictionaries from database?
Best regards,
Everton Garcia
Casaflex Ideas and Projects Ltd.
;;; ------------------------------------------------------------------------
-----------------------------------
;;; ROUTINE DEVELOPED BY EVERTON GARCIA - CASAFLEX IDEAS AND PROJECTS LTD.
;;; Copyright © 2002 - All Rights Reserved
(defun c:greca ()
(vl-load-com)
(prompt "\n\eSelecting Object for Conversion\e |...")
(setq kpol (vlax-get-Acad-Object)
)
(setq CfDictAntigoDwg
(vla-get-dictionaries
(vla-get-ActiveDocument
(vlax-get-Acad-Object)
)
)
NMCfDictAntigoDwg
(vla-get-objectname CfDictAntigoDwg)
CfDictAntigoDwgCount
(vla-get-count CfDictAntigoDwg)
AcadCfDictAntigoDwg
(vlax-vla-object->ename CfDictAntigoDwg)
CfFndDict 1
)
;;; ---> Start of External Loop <---
(if (> CfDictAntigoDwgCount 0)
(progn
(vlax-for 1ItemDict CfDictAntigoDwg
(setq Nv1ItemDic 1ItemDict
AcadNv1ItemDic (vlax-vla-object->ename Nv1ItemDic)
NMNv1ItemDic (vla-get-objectname Nv1ItemDic)
1ItemDicCount (vla-get-count Nv1ItemDic)
)
;;; ---> Start of Internal LOOP <---
(if (> 1ItemDicCount 0)
(progn
(vlax-for 2ItemDict Nv1ItemDic
(setq Nv2ItemDict 2ItemDict
AcadNv2ItemDict (vlax-vla-object->ename Nv2ItemDict)
NMNv2ItemDic (vla-get-objectname Nv2ItemDict)
)
(dictremove (namedobjdict) NMNv2ItemDic)
(setq RmvAcadNv2ItemDict (entdel AcadNv2ItemDict))
(if (/= RmvAcadNv2ItemDict nil)
(prompt (strcat "\nEntity " NMNv2ItemDic " Deleted"))
) ;if
);vla-for
)
);if
;;; ---> End of Internal Loop <---
(dictremove (namedobjdict) NMNv1ItemDic)
(entdel AcadNv1ItemDic)
(prompt (strcat "\nEntity " NMNv1ItemDic " Deleted"))
);vla-for
)
);if
(entdel AcadCfDictAntigoDwg)
(prompt (strcat "\nEntity " NMCfDictAntigoDwg " Deleted"))
;;; ---> End of External Loop <---
(prompt "\n\eUpdating Current Aplication Info\e /...")
(princ)
)
;;; ROUTINE DEVELOPED BY EVERTON GARCIA - CASAFLEX IDEAS AND PROJECTS LTD.
;;; Copyright © 2002 - All Rights Reserved
;;; ------------------------------------------------------------------------
-----------------------------------
We are writing a routine to convert ADT/AutoCAD 2000 drawing files to
AutoCAD R14 format by eliminating all custom objects to avoid that Proxy
Objects R14's dialog box when our customers open our files.
We do not want to use the AutoCAD Batch Convert Migration Tool because it
did not clean-up those custom objects when it convert a file from AutoCAD
2000 to R14. We want to solve this problem with a Visual LISP / Visual BASIC
routine.
We concept a first code, writen below, and We are almost there. When We run
this code, all the ADT dictionaries and the most part of AutoCAD 2000
dictionaries are cleaned. However, some ACAD dictionaries and applications
are not removed from database. They are:
ACAD_LAYOUT
ACAD_PLOTSETTINGS
ACAD_PLOTSTYLENAME
ACDBHEADERROUNDTRIPXREC
ACDBVARIABLEDICTIONARY
We discoverd which they are when we open an example DWG file in R14 and then
save it for AutoCAD R12.
In that example DWG file, our routine clean-up correctly these dictionaries
from database:
AEC_2D_SECTION_STYLES
AEC_AREA_GROUP_DEFS
AEC_AREA_MODIFIERS
AEC_AREA_PROPOSALNAMES
AEC_AREA_STYLES
AEC_AREAGROUP_STYLES
AEC_CLEANUP_GROUP_DEFS
AEC_CURTAIN_WALL_LAYOUT_STYLES
AEC_CURTAIN_WALL_UNIT_STYLES
AEC_DIM_STYLES
AEC_DISP_REP_CONFIGURATIONS
AEC_DISP_REP_SETS
AEC_DISP_REPS
AEC_DISPLAY_PROPS_DEFAULTS
AEC_DOOR_STYLES
AEC_ENDCAP_STYLES
AEC_MASKBLOCK_DEFS
AEC_MVBLOCK_DEFS
AEC_POLYGON_STYLES
AEC_PROFILE_DEFS
AEC_PROPERTY_FORMAT_DEFS
AEC_PROPERTY_SET_DEFS
AEC_RAILING_STYLES
AEC_ROOFSLAB_STYLES
AEC_ROOFSLABEDGE_STYLES
AEC_SCHEDULE_TABLE_STYLES
AEC_SLAB_STYLES
AEC_SLABEDGE_STYLES
AEC_SPACE_STYLES
AEC_STAIR_STYLES
AEC_STRUCTURALMEMBER_STYLES
AEC_VARS
AEC_WALL_STYLES
AEC_WALLMOD_STYLES
AEC_WINDOW_ASSEMBLY_STYLES
AEC_WINDOW_STYLES
How can we clean-up those 5 ACAD dictionaries from database?
Best regards,
Everton Garcia
Casaflex Ideas and Projects Ltd.
;;; ------------------------------------------------------------------------
-----------------------------------
;;; ROUTINE DEVELOPED BY EVERTON GARCIA - CASAFLEX IDEAS AND PROJECTS LTD.
;;; Copyright © 2002 - All Rights Reserved
(defun c:greca ()
(vl-load-com)
(prompt "\n\eSelecting Object for Conversion\e |...")
(setq kpol (vlax-get-Acad-Object)
)
(setq CfDictAntigoDwg
(vla-get-dictionaries
(vla-get-ActiveDocument
(vlax-get-Acad-Object)
)
)
NMCfDictAntigoDwg
(vla-get-objectname CfDictAntigoDwg)
CfDictAntigoDwgCount
(vla-get-count CfDictAntigoDwg)
AcadCfDictAntigoDwg
(vlax-vla-object->ename CfDictAntigoDwg)
CfFndDict 1
)
;;; ---> Start of External Loop <---
(if (> CfDictAntigoDwgCount 0)
(progn
(vlax-for 1ItemDict CfDictAntigoDwg
(setq Nv1ItemDic 1ItemDict
AcadNv1ItemDic (vlax-vla-object->ename Nv1ItemDic)
NMNv1ItemDic (vla-get-objectname Nv1ItemDic)
1ItemDicCount (vla-get-count Nv1ItemDic)
)
;;; ---> Start of Internal LOOP <---
(if (> 1ItemDicCount 0)
(progn
(vlax-for 2ItemDict Nv1ItemDic
(setq Nv2ItemDict 2ItemDict
AcadNv2ItemDict (vlax-vla-object->ename Nv2ItemDict)
NMNv2ItemDic (vla-get-objectname Nv2ItemDict)
)
(dictremove (namedobjdict) NMNv2ItemDic)
(setq RmvAcadNv2ItemDict (entdel AcadNv2ItemDict))
(if (/= RmvAcadNv2ItemDict nil)
(prompt (strcat "\nEntity " NMNv2ItemDic " Deleted"))
) ;if
);vla-for
)
);if
;;; ---> End of Internal Loop <---
(dictremove (namedobjdict) NMNv1ItemDic)
(entdel AcadNv1ItemDic)
(prompt (strcat "\nEntity " NMNv1ItemDic " Deleted"))
);vla-for
)
);if
(entdel AcadCfDictAntigoDwg)
(prompt (strcat "\nEntity " NMCfDictAntigoDwg " Deleted"))
;;; ---> End of External Loop <---
(prompt "\n\eUpdating Current Aplication Info\e /...")
(princ)
)
;;; ROUTINE DEVELOPED BY EVERTON GARCIA - CASAFLEX IDEAS AND PROJECTS LTD.
;;; Copyright © 2002 - All Rights Reserved
;;; ------------------------------------------------------------------------
-----------------------------------