Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
CAD Forums
»
CAD General
»
Topic:
File size is upnormal
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: File size is upnormal (Read 3351 times)
0 Members and 1 Guest are viewing this topic.
HasanCAD
Swamp Rat
Posts: 1422
File size is upnormal
«
on:
February 13, 2023, 06:39:38 AM »
Hi All,
This file size is upnormal even when is empty.
Logged
Sorry for my English.
Donate to Theswamp
www.sergiwa.com
Peter2
Swamp Rat
Posts: 654
Re: File size is upnormal
«
Reply #1 on:
February 14, 2023, 05:36:20 AM »
Seem to be some dictionaries, and maybe one is damaged ..
https://www.afralisp.net/autolisp/tutorials/dictionaries-and-xrecords.php
Logged
Peter
AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23
HasanCAD
Swamp Rat
Posts: 1422
Re: File size is upnormal
«
Reply #2 on:
February 15, 2023, 02:17:50 AM »
How to detect damaged dictionaries?
Logged
Sorry for my English.
Donate to Theswamp
www.sergiwa.com
It's Alive!
Retired
Needs a day job
Posts: 8760
AKA Daniel
WWW
Re: File size is upnormal
«
Reply #3 on:
February 15, 2023, 02:52:32 AM »
this one and the one below it have 600-700 entries.
they are customs objects so my utility won't purge them
maybe one of these will
https://apps.autodesk.com/en/Publisher/PublisherHomepage?ID=200809200499705
Logged
https://github.com/CEXT-Dan/PyRx
https://pyarx.blogspot.com/
ronjonp
Needs a day job
Posts: 7531
Re: File size is upnormal
«
Reply #4 on:
February 20, 2023, 11:32:27 AM »
You can use this to analyze drawings too:
http://www.theswamp.org/lilly_pond/mp/lisp/counts.txt
Logged
Windows 11 x64 - AutoCAD /C3D 2023
Custom Build PC
dexus
Bull Frog
Posts: 210
Re: File size is upnormal
«
Reply #5 on:
February 21, 2023, 03:07:34 AM »
I quickly combined
DCL List Tile Dependency (Lee Mac)
with a loop through the dictionaries.
This way you can look through what dictionaries are in the drawing.
No other functionality yet. Repair/delete/find empty etc. would be great.
Code - Auto/Visual Lisp:
[Select]
(
defun
c:dictBrowser
(
/
*error*
dch dcl des lst rtn
)
; Based on http://www.lee-mac.com/listtiledependency.html
(
defun
*error*
(
msg
)
(
if
(
=
'file
(
type
des
)
)
(
close
des
)
)
(
if
(
<
0
dch
)
(
unload_dialog
dch
)
)
(
if
(
and
(
=
'str
(
type
dcl
)
)
(
findfile
dcl
)
)
(
vl-file-delete
dcl
)
)
(
if
(
and
msg
(
not
(
wcmatch
(
strcase
msg t
)
"*break,*cancel*,*exit*"
)
)
)
(
princ
(
strcat
"
\n
Error: "
msg
)
)
)
(
princ
)
)
(
if
(
and
(
setq
lst
(
getDict
(
entget
(
namedobjdict
)
)
)
)
(
setq
dcl
(
vl-filename-mktemp
"tmp.dcl"
)
)
(
setq
des
(
open
dcl
"w"
)
)
(
foreach
str
'
(
"lbx : list_box"
"{"
" alignment = centered;"
" fixed_width = true;"
" fixed_height = true;"
" width = 30;"
" height = 30;"
"}"
"test : dialog"
"{"
" label =
\"
Dictionaries in current drawing:
\"
;"
" spacer;"
" : row"
" {"
" : lbx { key =
\"
lb0
\"
; label =
\"
Dictionary
\"
; }"
" : lbx { key =
\"
lb1
\"
; label =
\"
Items
\"
; }"
" }"
" spacer;"
" ok_cancel;"
"}"
)
(
write-line
str des
)
)
(
not
(
setq
des
(
close
des
)
)
)
(
<
0
(
setq
dch
(
load_dialog
dcl
)
)
)
(
new_dialog
"test"
dch
)
)
(
progn
(
setq
rtn '
(
0
0
)
)
(
LM:dcld:action '
(
"lb0"
"lb1"
)
'lst 'rtn
)
(
if
(
=
1
(
start_dialog
)
)
(
princ
(
strcat
"
\n
The user selected:"
(
substr
(
apply
'
strcat
(
mapcar
'
(
lambda
(
x
)
(
strcat
", "
x
)
)
(
LM:dcld:getitems rtn lst
)
)
)
2
)
)
)
(
princ
"
\n
*Cancel*"
)
)
)
)
(
*error*
nil
)
(
princ
)
)
(
defun
getDict
(
lst
/
itm rtn ed
)
(
while
(
setq
itm
(
assoc
3
lst
)
)
(
setq
ed
(
cdr
(
assoc
350
lst
)
)
)
(
setq
ed
(
cons
(
strcat
"["
(
cdr
(
assoc
5
(
entget
ed
)
)
)
"]"
)
(
mapcar
-
remove
-
nil
(
function
(
lambda
(
e
)
(
if
(
=
(
car
e
)
3
)
(
cdr
e
)
)
)
)
(
entget
ed
)
)
)
)
(
setq
rtn
(
cons
(
cons
(
cdr
itm
)
(
list
ed
)
)
rtn
)
lst
(
cdr
(
member
itm lst
)
)
)
)
(
reverse
rtn
)
)
(
defun
ALE_Fix_Dictionaries
(
EntDct
/
OutLst
)
(
vlax-for
VlaFor EntDct
(
if
(
vlax-property-available-p
VlaFor 'Name
)
(
setq
OutLst
(
cons
(
cons
(
vlax-get
VlaFor 'Name
)
VlaFor
)
OutLst
)
)
)
)
(
reverse
OutLst
)
)
(
defun
ALE_Fix_DelDictionaries
(
DctNms
)
(
foreach
ForElm
(
ALE_Fix_Dictionaries
(
vla-get-dictionaries
(
vla-get-activedocument
(
vlax-get-acad-object
)
)
)
)
(
if
(
wcmatch
(
car
ForElm
)
DctNms
)
(
progn
(
try '
vla-delete
(
list
(
cdr
ForElm
)
)
)
(
p
"Dict Deleted"
(
car
ForElm
)
)
)
)
)
(
princ
)
)
(
defun
mapcar
-
remove
-
nil
(
func lst
/
item rtn
)
;; ---------------------------------------------------------------- ;;
;; mapcar-remove-nil - dexus ;;
;; ---------------------------------------------------------------- ;;
;; A combination of (vl-remove nil (mapcar ... )) in one function. ;;
;; This function will apply the provided function to all elements ;;
;; of a list, if the return of the function is true than the item ;;
;; will be added, otherwise it will be removed. ;;
;; ---------------------------------------------------------------- ;;
;; func: [list] Function to apply to all elements in list, if ;;
;; result is nil the item will be removed ;;
;; lst: [list] List of items to process ;;
;; returns: [list] List of all returns from func that were not nil ;;
;; ---------------------------------------------------------------- ;;
(
while
lst
(
if
(
setq
item
(
apply
func
(
list
(
car
lst
)
)
)
)
(
setq
rtn
(
cons
item rtn
)
)
)
(
setq
lst
(
cdr
lst
)
)
)
(
reverse
rtn
)
)
;; DCL List-Tile Dependency - V2.1 (2019-04-27) - Lee Mac
;; Configures action_tile statements for the list of keys to enabled dependency between the DCL tiles.
;; key - [lst] List of DCL tile keys in order of dependency
;; lst-sym - [sym] Quoted variable containing list data
;; rtn-sym - [sym] Quoted variable containing initial selection indexes
(
defun
LM:dcld:action
(
key lst
-
sym rtn
-
sym
)
(
defun
LM:dcld:addlist
(
key lst
)
(
start_list
key
)
(
foreach
itm lst
(
add_list
itm
)
)
(
end_list
)
)
(
defun
LM:dcld:getlists
(
idx lst
)
(
if
(
cdr
idx
)
(
cons
(
mapcar
'
car
lst
)
(
LM:dcld:getlists
(
cdr
idx
)
(
cdr
(
nth
(
car
idx
)
lst
)
)
)
)
lst
)
)
(
defun
LM:substnth
(
itm idx lst
)
(
if
lst
(
if
(
zerop
idx
)
(
cons
itm
(
mapcar
'
(
lambda
(
x
)
0
)
(
cdr
lst
)
)
)
(
cons
(
car
lst
)
(
LM:substnth itm
(
1-
idx
)
(
cdr
lst
)
)
)
)
)
)
(
defun
LM:dcld:actions
(
key lst
-
sym rtn
-
sym lvl
/
fun
)
(
setq
fun
(
if
(
cdr
key
)
(
list
'
lambda
'
(
val lst
)
(
list
'
setq
rtn
-
sym
(
list
'LM:substnth '
(
atoi
val
)
lvl rtn
-
sym
)
)
(
list
'LM:dcld:addlist
(
cadr
key
)
(
list
'
nth
(
1+
lvl
)
(
list
'LM:dcld:getlists rtn
-
sym 'lst
)
)
)
(
list
(
LM:dcld:actions
(
cdr
key
)
lst
-
sym rtn
-
sym
(
1+
lvl
)
)
(
list
'
set_tile
(
cadr
key
)
"0"
)
'lst
)
)
(
list
'
lambda
'
(
val lst
)
(
list
'
setq
rtn
-
sym
(
list
'LM:substnth '
(
atoi
val
)
lvl rtn
-
sym
)
)
)
)
)
(
action_tile
(
car
key
)
(
vl-prin1-to-string
(
list
fun '$value lst
-
sym
)
)
)
fun
)
(
mapcar
'LM:dcld:addlist key
(
LM:dcld:getlists
(
eval
rtn
-
sym
)
(
eval
lst
-
sym
)
)
)
(
(
eval
(
LM:dcld:actions key lst
-
sym rtn
-
sym
0
)
)
(
set_tile
(
car
key
)
(
itoa
(
car
(
eval
rtn
-
sym
)
)
)
)
(
eval
lst
-
sym
)
)
(
princ
)
)
;; DCL List-Tile Dependency - Get Items - Lee Mac
;; Returns a list of the items selected from each dependent list tile.
;; idx - [lst] List of selection indexes
;; lst - [lst] List data
(
defun
LM:dcld:getitems
(
idx lst
/
tmp
)
(
if
(
cdr
idx
)
(
cons
(
car
(
setq
tmp
(
nth
(
car
idx
)
lst
)
)
)
(
LM:dcld:getitems
(
cdr
idx
)
(
cdr
tmp
)
)
)
(
list
(
nth
(
car
idx
)
(
car
lst
)
)
)
)
)
Logged
ronjonp
Needs a day job
Posts: 7531
Re: File size is upnormal
«
Reply #6 on:
February 21, 2023, 10:49:24 AM »
Quote from: HasanCAD on February 13, 2023, 06:39:38 AM
Hi All,
This file size is upnormal even when is empty.
The old wblock trick knocks this file down to 96 kb.
Code - Auto/Visual Lisp:
[Select]
(
command
"_.-wblock"
(
strcat
(
getvar
'dwgprefix
)
(
getvar
'dwgname
)
)
"*"
)
Logged
Windows 11 x64 - AutoCAD /C3D 2023
Custom Build PC
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
CAD Forums
»
CAD General
»
Topic:
File size is upnormal