자료실 Q&A
글 수 2,319
|||| 안녕하세요. 급하게 질문할게 있어서 글 남깁니다.
도면용량을 2MB 이하로 맞추어야 하는데요.
제 도면은 어떻게 된건지 3MB넘는건 기본입니다.
딱 도면 한장 정도밖에는 안되고,
다른분들의 도면은 1MB도 채 되지 않는데 말입니다.
purge나 wblock,layer정리 등 할수 있는건 다 해봐도
2.9MB이하로는 절대로 안줄어듭니다.
뭐가 문제인지 모르겠습니다.
다른도면을 붙여다가 쓰고 기존도면에서 saveas해서 쓰고
그게 반복이 되어 그런건지...
혹시 방법이 있다면 부탁드립니다. ㅠ_ㅠ
도면용량을 2MB 이하로 맞추어야 하는데요.
제 도면은 어떻게 된건지 3MB넘는건 기본입니다.
딱 도면 한장 정도밖에는 안되고,
다른분들의 도면은 1MB도 채 되지 않는데 말입니다.
purge나 wblock,layer정리 등 할수 있는건 다 해봐도
2.9MB이하로는 절대로 안줄어듭니다.
뭐가 문제인지 모르겠습니다.
다른도면을 붙여다가 쓰고 기존도면에서 saveas해서 쓰고
그게 반복이 되어 그런건지...
혹시 방법이 있다면 부탁드립니다. ㅠ_ㅠ
2006.01.29 01:04:48 (*.116.10.243)
중복삭제 리습드릴게요
;;중복 블럭 삭제
(defun c:blkdel( / ss ssdup ct len e eb
pt lay bname ang sclx scly sclz obj obj_list)
(princ "\nSelect block objects.") ;Select objects and filter all but block insert objects.
(setq ss (ssget (list (cons 0 "INSERT"))))
(if ss ;If any valid objects were selected.
(progn
(princ "\nBuilding list of objects.")
(setq ssdup (ssadd)) ;Initialize new selection set to hold objects to delete
(setq len (sslength ss)) ;Find out how many objects were selected.
(setq ct 0)
(while (< ct len) ;Loop through selected objects
(setq e (ssname ss ct)) ;Get an object name
(setq eb (entget e)) ;Get the entity list from the object name
(setq ct (+ ct 1)) ;Increment index into selection set
(setq pt (cdr (assoc 10 eb))) ;Access object's coordinate
(setq lay (cdr (assoc 8 eb))) ;Access object's layer
(setq bname (cdr (assoc 2 eb))) ;Access object's block name
(setq ang (cdr (assoc 50 eb))) ;Access object's rotation angle
(setq sclx (cdr (assoc 41 eb))) ;Access object's x scale
(setq scly (cdr (assoc 42 eb))) ;Access object's y scale
(setq sclz (cdr (assoc 43 eb))) ;Access object's z scale
;Make list of object properties
(setq obj (list pt lay bname ang sclx scly sclz))
(if (not (member obj obj_list)) ;If these properties are not already in list
(setq obj_list (cons obj obj_list)) ;Add them to the list
(ssadd e ssdup) ;Else add object to selection set to delete
) ;End if
) ;End of while loop
(if (> (sslength ssdup) 0) ;If there are any objects in the selection set to delete
(progn
(princ "\nDeleting duplicate objects.")
(setq len (sslength ssdup)) ;Find out how many many objects to delete.
(setq ct 0)
(while (< ct len) ;Loop through objects and delete.
(setq e (ssname ssdup ct)) ;Get object name
(setq ct (+ ct 1)) ;Increment index into selection set
(entdel e) ;Delete duplicate object
) ;End of while loop
(princ ;Print the number of objects deleted to command line
(strcat "\nDeleted "
(itoa len)
" duplicate objects."
))
) ;End progn
(princ "\nNo duplicates found.") ;Else no there were no duplicates to delete.
) ;End if
) ;End progn
(princ "\nNo block objects selected.") ;Else there were no valid objects selected
) ;End if
(princ)
)
;; 중복 포인트 삭제
(defun c:ptdel( / ss ssdup ct len e eb
pt lay obj obj_list)
(princ "\nSelect point objects.") ;Select objects and filter all but valid objects.
(setq ss (ssget (list (cons 0 "POINT"))))
(if ss ;If any valid objects were selected.
(progn
(princ "\nBuilding list of objects.")
(setq ssdup (ssadd)) ;Initialize new selection set to hold objects to delete
(setq len (sslength ss)) ;Find out how many objects were selected.
(setq ct 0)
(while (< ct len) ;Loop through selected objects
(setq e (ssname ss ct)) ;Get an object name
(setq eb (entget e)) ;Get the entity list from the object name
(setq ct (+ ct 1)) ;Increment index into selection set
(setq pt (cdr (assoc 10 eb))) ;Access object's coordinate
(setq lay (cdr (assoc 8 eb))) ;Access object's layer
;Make list of object properties
(setq obj (list pt lay))
(if (not (member obj obj_list)) ;If these properties are not already in list
(setq obj_list (cons obj obj_list)) ;Add them to the list
(ssadd e ssdup) ;Else add object to selection set to delete
) ;End if
) ;End of while loop
(if (> (sslength ssdup) 0) ;If there are any objects in the selection set to delete
(progn
(princ "\nDeleting duplicate objects.")
(setq len (sslength ssdup)) ;Find out how many many objects to delete.
(setq ct 0)
(while (< ct len) ;Loop through objects and delete.
(setq e (ssname ssdup ct)) ;Get object name
(setq ct (+ ct 1)) ;Increment index into selection set
(entdel e) ;Delete duplicate object
) ;End of while loop
(princ ;Print the number of objects deleted to command line
(strcat "\nDeleted "
(itoa len)
" duplicate objects."
))
) ;End progn
(princ "\nNo duplicates found.") ;Else no there were no duplicates to delete.
) ;End if
) ;End progn
(princ "\nNo point objects selected.") ;Else there were no valid objects selected
) ;End if
(princ)
)
;; 중복 텍스트 삭제
(defun c:txtdel( / ss ssdup ct len e eb
pt lay ang sty hgt str obj obj_list)
(princ "\nSelect text objects.") ;Select objects and filter all but block insert objects.
(setq ss (ssget (list (cons 0 "TEXT"))))
(if ss ;If any valid objects were selected.
(progn
(princ "\nBuilding list of objects.")
(setq ssdup (ssadd)) ;Initialize new selection set to hold objects to delete
(setq len (sslength ss)) ;Find out how many objects were selected.
(setq ct 0)
(while (< ct len) ;Loop through selected objects
(setq e (ssname ss ct)) ;Get an object name
(setq eb (entget e)) ;Get the entity list from the object name
(setq ct (+ ct 1)) ;Increment index into selection set
(setq pt (cdr (assoc 10 eb))) ;Access object's coordinate
(setq lay (cdr (assoc 8 eb))) ;Access object's layer
(setq ang (cdr (assoc 50 eb))) ;Access object's rotation angle
(setq sty (cdr (assoc 7 eb))) ;Access object's text style
(setq hgt (cdr (assoc 40 eb))) ;Access object's text height
(setq str (cdr (assoc 1 eb))) ;Access object's text string
;Make list of object properties
(setq obj (list pt lay ang sty hgt str))
(if (not (member obj obj_list)) ;If these properties are not already in list
(setq obj_list (cons obj obj_list)) ;Add them to the list
(ssadd e ssdup) ;Else add object to selection set to delete
) ;End if
) ;End of while loop
(if (> (sslength ssdup) 0) ;If there are any objects in the selection set to delete
(progn
(princ "\nDeleting duplicate objects.")
(setq len (sslength ssdup)) ;Find out how many many objects to delete.
(setq ct 0)
(while (< ct len) ;Loop through objects and delete.
(setq e (ssname ssdup ct)) ;Get object name
(setq ct (+ ct 1)) ;Increment index into selection set
(entdel e) ;Delete duplicate object
) ;End of while loop
(princ ;Print the number of objects deleted to command line
(strcat "\nDeleted "
(itoa len)
" duplicate objects."
))
) ;End progn
(princ "\nNo duplicates found.") ;Else no there were no duplicates to delete.
) ;End if
) ;End progn
(princ "\nNo text objects selected.") ;Else there were no valid objects selected
) ;End if
(princ)
)
(defun c:ddd ()
(setvar "cmdecho" 0)
(setq OldError *error*)
(setq *error* ErrHandle)
(command "undo" "be")
(setq option_value
(getstring
"블럭[B]/텍스트[T]/포인트[P]/"
)
)
(if (= nil option_value)
(progn
(setq option_value h)
)
(progn
(cond ((or (= option_value "B") (= option_value "b")) (blkdel))
((or (= option_value "T") (= option_value "t")) (txtdel))
((or (= option_value "p") (= option_value "p")) (ptdel))
)
)
) ;if
(command "undo" "e")
(princ)
)
(defun ErrHandle (Err)
(if (and (/= Err "quit / exit abort")
(/= Err "Function cancelled")
)
(princ Err)
)
(setq *error* OldError)
(princ)
)
(PROMPT "\n실행명령 ====>ddd")
(PRINC)
아니면 rocover를 사용하여 도면 복구하여보세요
;;중복 블럭 삭제
(defun c:blkdel( / ss ssdup ct len e eb
pt lay bname ang sclx scly sclz obj obj_list)
(princ "\nSelect block objects.") ;Select objects and filter all but block insert objects.
(setq ss (ssget (list (cons 0 "INSERT"))))
(if ss ;If any valid objects were selected.
(progn
(princ "\nBuilding list of objects.")
(setq ssdup (ssadd)) ;Initialize new selection set to hold objects to delete
(setq len (sslength ss)) ;Find out how many objects were selected.
(setq ct 0)
(while (< ct len) ;Loop through selected objects
(setq e (ssname ss ct)) ;Get an object name
(setq eb (entget e)) ;Get the entity list from the object name
(setq ct (+ ct 1)) ;Increment index into selection set
(setq pt (cdr (assoc 10 eb))) ;Access object's coordinate
(setq lay (cdr (assoc 8 eb))) ;Access object's layer
(setq bname (cdr (assoc 2 eb))) ;Access object's block name
(setq ang (cdr (assoc 50 eb))) ;Access object's rotation angle
(setq sclx (cdr (assoc 41 eb))) ;Access object's x scale
(setq scly (cdr (assoc 42 eb))) ;Access object's y scale
(setq sclz (cdr (assoc 43 eb))) ;Access object's z scale
;Make list of object properties
(setq obj (list pt lay bname ang sclx scly sclz))
(if (not (member obj obj_list)) ;If these properties are not already in list
(setq obj_list (cons obj obj_list)) ;Add them to the list
(ssadd e ssdup) ;Else add object to selection set to delete
) ;End if
) ;End of while loop
(if (> (sslength ssdup) 0) ;If there are any objects in the selection set to delete
(progn
(princ "\nDeleting duplicate objects.")
(setq len (sslength ssdup)) ;Find out how many many objects to delete.
(setq ct 0)
(while (< ct len) ;Loop through objects and delete.
(setq e (ssname ssdup ct)) ;Get object name
(setq ct (+ ct 1)) ;Increment index into selection set
(entdel e) ;Delete duplicate object
) ;End of while loop
(princ ;Print the number of objects deleted to command line
(strcat "\nDeleted "
(itoa len)
" duplicate objects."
))
) ;End progn
(princ "\nNo duplicates found.") ;Else no there were no duplicates to delete.
) ;End if
) ;End progn
(princ "\nNo block objects selected.") ;Else there were no valid objects selected
) ;End if
(princ)
)
;; 중복 포인트 삭제
(defun c:ptdel( / ss ssdup ct len e eb
pt lay obj obj_list)
(princ "\nSelect point objects.") ;Select objects and filter all but valid objects.
(setq ss (ssget (list (cons 0 "POINT"))))
(if ss ;If any valid objects were selected.
(progn
(princ "\nBuilding list of objects.")
(setq ssdup (ssadd)) ;Initialize new selection set to hold objects to delete
(setq len (sslength ss)) ;Find out how many objects were selected.
(setq ct 0)
(while (< ct len) ;Loop through selected objects
(setq e (ssname ss ct)) ;Get an object name
(setq eb (entget e)) ;Get the entity list from the object name
(setq ct (+ ct 1)) ;Increment index into selection set
(setq pt (cdr (assoc 10 eb))) ;Access object's coordinate
(setq lay (cdr (assoc 8 eb))) ;Access object's layer
;Make list of object properties
(setq obj (list pt lay))
(if (not (member obj obj_list)) ;If these properties are not already in list
(setq obj_list (cons obj obj_list)) ;Add them to the list
(ssadd e ssdup) ;Else add object to selection set to delete
) ;End if
) ;End of while loop
(if (> (sslength ssdup) 0) ;If there are any objects in the selection set to delete
(progn
(princ "\nDeleting duplicate objects.")
(setq len (sslength ssdup)) ;Find out how many many objects to delete.
(setq ct 0)
(while (< ct len) ;Loop through objects and delete.
(setq e (ssname ssdup ct)) ;Get object name
(setq ct (+ ct 1)) ;Increment index into selection set
(entdel e) ;Delete duplicate object
) ;End of while loop
(princ ;Print the number of objects deleted to command line
(strcat "\nDeleted "
(itoa len)
" duplicate objects."
))
) ;End progn
(princ "\nNo duplicates found.") ;Else no there were no duplicates to delete.
) ;End if
) ;End progn
(princ "\nNo point objects selected.") ;Else there were no valid objects selected
) ;End if
(princ)
)
;; 중복 텍스트 삭제
(defun c:txtdel( / ss ssdup ct len e eb
pt lay ang sty hgt str obj obj_list)
(princ "\nSelect text objects.") ;Select objects and filter all but block insert objects.
(setq ss (ssget (list (cons 0 "TEXT"))))
(if ss ;If any valid objects were selected.
(progn
(princ "\nBuilding list of objects.")
(setq ssdup (ssadd)) ;Initialize new selection set to hold objects to delete
(setq len (sslength ss)) ;Find out how many objects were selected.
(setq ct 0)
(while (< ct len) ;Loop through selected objects
(setq e (ssname ss ct)) ;Get an object name
(setq eb (entget e)) ;Get the entity list from the object name
(setq ct (+ ct 1)) ;Increment index into selection set
(setq pt (cdr (assoc 10 eb))) ;Access object's coordinate
(setq lay (cdr (assoc 8 eb))) ;Access object's layer
(setq ang (cdr (assoc 50 eb))) ;Access object's rotation angle
(setq sty (cdr (assoc 7 eb))) ;Access object's text style
(setq hgt (cdr (assoc 40 eb))) ;Access object's text height
(setq str (cdr (assoc 1 eb))) ;Access object's text string
;Make list of object properties
(setq obj (list pt lay ang sty hgt str))
(if (not (member obj obj_list)) ;If these properties are not already in list
(setq obj_list (cons obj obj_list)) ;Add them to the list
(ssadd e ssdup) ;Else add object to selection set to delete
) ;End if
) ;End of while loop
(if (> (sslength ssdup) 0) ;If there are any objects in the selection set to delete
(progn
(princ "\nDeleting duplicate objects.")
(setq len (sslength ssdup)) ;Find out how many many objects to delete.
(setq ct 0)
(while (< ct len) ;Loop through objects and delete.
(setq e (ssname ssdup ct)) ;Get object name
(setq ct (+ ct 1)) ;Increment index into selection set
(entdel e) ;Delete duplicate object
) ;End of while loop
(princ ;Print the number of objects deleted to command line
(strcat "\nDeleted "
(itoa len)
" duplicate objects."
))
) ;End progn
(princ "\nNo duplicates found.") ;Else no there were no duplicates to delete.
) ;End if
) ;End progn
(princ "\nNo text objects selected.") ;Else there were no valid objects selected
) ;End if
(princ)
)
(defun c:ddd ()
(setvar "cmdecho" 0)
(setq OldError *error*)
(setq *error* ErrHandle)
(command "undo" "be")
(setq option_value
(getstring
"블럭[B]/텍스트[T]/포인트[P]/"
)
)
(if (= nil option_value)
(progn
(setq option_value h)
)
(progn
(cond ((or (= option_value "B") (= option_value "b")) (blkdel))
((or (= option_value "T") (= option_value "t")) (txtdel))
((or (= option_value "p") (= option_value "p")) (ptdel))
)
)
) ;if
(command "undo" "e")
(princ)
)
(defun ErrHandle (Err)
(if (and (/= Err "quit / exit abort")
(/= Err "Function cancelled")
)
(princ Err)
)
(setq *error* OldError)
(princ)
)
(PROMPT "\n실행명령 ====>ddd")
(PRINC)
아니면 rocover를 사용하여 도면 복구하여보세요