Jump to content

Recommended Posts

Posted

I find a lisp to do this ,but,not found.

Excuse me, would you give me a hand?thanks!

Posted

Reduce the weight? Do you mean the file size?

Posted
I find a lisp to do this ,but,not found.

 

How you find and not found !!! :shock:

Posted
Reduce the weight? Do you mean the file size?

 

Thanks Remark ,I mean file size.

Posted
How you find and not found !!! :shock:

 

Tharwat ,please help me!:cry:

Posted

There are many reasons for the file size to be large, blocks, dictionaries etc.

 

Run the purge command 3-times in a row, see what that does. (multiple times needed to get to nested blocks)

 

There are also many threads here and other sites addressing this issue. Please conduct a thorough search.

Posted

The commands I would run would be...

 

Overkill

 

-Purge > Regapps

 

-Purge > All

 

Audit > Fix errors? > Yes

 

Zoom > Extents

 

Save

 

Repeat the sequence once more.

Posted
The commands I would run would be...

 

Overkill

 

-Purge > Regapps

 

-Purge > All

 

Audit > Fix errors? > Yes

 

Zoom > Extents

 

Save

 

Repeat the sequence once more.

 

Thanks remark,There is another method: use WBLOCK,Many people use.

Posted

This useful?

 

  (defun DwgWblock (dwgfileLst /   ACADAPP    BACKUPFILE
     BASENAME   DOCOBJ   DWGNAME    FILEPATH
     INDEX      NEWSET   SSETS
    )
   (setq AcadApp (vlax-get-acad-object))
   (repeat (setq Index (length dwgfileLst))
     (setq DwgName (nth (setq Index (1- Index)) dwgfileLst))
     (setq BaseName   (vl-filename-base DwgName)
    filepath   (vl-filename-directory DwgName)
    ;;dxfFile    (vl-string-subst ".dxf" ".dwg" DwgName)
    BackupFile (strcat (getfullpath filepath)
         BaseName
         "_Backup"
         (vl-filename-extension DwgName)
        )
     )
     (if (findfile BackupFile)
(deletefile BackupFile)
     )     
     (if (vl-file-rename DwgName BackupFile) 
(progn
  (setq
    DocObj (vla-open (vla-get-documents AcadApp) BackupFile)
  )
  (setq ssets (vla-get-selectionsets DocObj))
  (if (vl-catch-all-error-p
 (vl-catch-all-apply 'vla-item (list ssets "$$Set"))
      )
    (setq newSet (vla-add ssets "$$Set"))
    (progn
      (vla-delete (vla-item ssets "$$Set"))
      (setq newSet (vla-add ssets "$$Set"))
    )
  )
  ;;select all objects in the drawing
  (vla-Select newSet acSelectionSetAll)
  (vla-WBlock DocObj DwgName newSet)
  (vla-close DocObj :vlax-false)
  (deletefile BackupFile)
)
     )
   )
   (if DocObj
     (vlax-release-object DocObj)
   )
   (if AcadApp
     (vlax-release-object AcadApp)
   )
 )
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (defun DwgWblock1 (HasOpenFiles / *ACAD* *DOCS* DWGNAME N)
   (setq *ACAD* (vlax-get-acad-object))

   (setq HasOpenFiles (mapcar 'strcase HasOpenFiles))
   (vlax-for item (vla-get-Documents *ACAD*)
     (if (member (strcase (vlax-get-property item 'FullName))
   HasOpenFiles
  )
(vla-close item :vlax-false)
     )
   )

   (DwgWblock HasOpenFiles)

   (setq *DOCS* (vla-get-documents *ACAD*))
   (repeat (setq n (length HasOpenFiles)) 
     (setq DwgName (nth (setq n (1- n)) HasOpenFiles))
     (vla-open *DOCS* DwgName)
   )
 )

  • 8 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...