Jump to content

Search the Community

Showing results for tags 'tips'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions

Categories

  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 5 results

  1. Hi all, I kept running into drawings that had ballooned to tens of MB, slow to open and painful to share. So I put together a small routine, DWGCLEAN, that runs the full cleanup in one command. Sharing it here in case it saves someone else the hassle. What it does, in order: Purges orphaned RegApp records (the hidden junk third-party and exported objects leave behind) Runs a full PURGE several times, to catch nested items that only become purgeable after their parent is gone Runs AUDIT with fix, to repair database errors WBLOCKs the whole drawing into a fresh file, which is the step that actually rebuilds and shrinks it It writes a new file with a _clean suffix and never touches your original. It also prints the before/after size and the percent saved when it finishes. Here is the code: (vl-load-com) ;; ---- helper: bytes -> whole-KB string ------------------------------------ (defun ea:kb (bytes) (itoa (fix (/ (float bytes) 1024.0)))) (defun c:DWGCLEAN ( / *error* old-cmdecho old-filedia old-expert src-dir src-name src-path base target n pass size-before size-after saved pct ) ;; ---- error handler: always restore system variables -------------------- (defun *error* (msg) (if old-cmdecho (setvar "CMDECHO" old-cmdecho)) (if old-filedia (setvar "FILEDIA" old-filedia)) (if old-expert (setvar "EXPERT" old-expert)) (if (and msg (not (member msg '("Function cancelled" "quit / exit abort")))) (princ (strcat "\nDWGCLEAN error: " msg))) (princ) ) ;; ---- make sure the drawing is saved to disk ---------------------------- (setq src-dir (getvar "DWGPREFIX") src-name (getvar "DWGNAME")) (setq src-path (strcat src-dir src-name)) (if (or (= src-dir "") (not (wcmatch (strcase src-name) "*.DWG")) (not (findfile src-path))) (progn (princ "\n*** Save the drawing to a folder first, then run DWGCLEAN again. ***") (exit)) ) (setq size-before (vl-file-size src-path)) ;; ---- save current sysvars, then set a clean automation state ----------- (setq old-cmdecho (getvar "CMDECHO") old-filedia (getvar "FILEDIA") old-expert (getvar "EXPERT")) (setvar "CMDECHO" 0) (setvar "FILEDIA" 0) (setvar "EXPERT" 5) ; suppress overwrite / confirmation prompts (princ "\n================ Engineer Atlas :: DWGCLEAN ================") ;; ---- STEP 1: remove RegApps ------------------------------------------- (princ "\n[1/4] Removing RegApps ...") (command "_.-PURGE" "_Regapps" "*" "_No") ;; ---- STEP 2: purge all unused, several passes for nested items -------- (princ "\n[2/4] Purging unused layers, blocks, linetypes, styles ...") (setq pass 0) (while (< pass 4) (command "_.-PURGE" "_All" "*" "_No") (setq pass (1+ pass))) ;; ---- STEP 3: audit and fix -------------------------------------------- (princ "\n[3/4] Auditing and fixing database errors ...") (command "_.AUDIT" "_Yes") ;; ---- STEP 4: WBLOCK the entire drawing into a fresh file --------------- (setq base (vl-filename-base src-path)) (setq target (strcat src-dir base "_clean.dwg")) (setq n 1) (while (findfile target) ; never overwrite an existing file (setq target (strcat src-dir base "_clean_" (itoa n) ".dwg")) (setq n (1+ n))) (princ (strcat "\n[4/4] Writing clean file: " (vl-filename-base target) ".dwg ...")) (command "_.-WBLOCK" target "*") ;; ---- restore sysvars --------------------------------------------------- (setvar "CMDECHO" old-cmdecho) (setvar "FILEDIA" old-filedia) (setvar "EXPERT" old-expert) ;; ---- report before / after -------------------------------------------- (setq size-after (if (findfile target) (vl-file-size target) nil)) (princ "\n-----------------------------------------------------------") (if (and size-before size-after (> size-before 0)) (progn (setq saved (- size-before size-after)) (setq pct (fix (* 100.0 (/ (float saved) size-before)))) (princ (strcat "\nOriginal : " (ea:kb size-before) " KB")) (princ (strcat "\nCleaned : " (ea:kb size-after) " KB")) (princ (strcat "\nSaved : " (ea:kb saved) " KB (" (itoa pct) "%)"))) (princ "\nClean file written.")) (princ (strcat "\nNew file : " target)) (princ "\nOpen the *_clean.dwg and verify it before replacing your original.") (princ) ) (princ "\nDWGCLEAN loaded. Type DWGCLEAN to reduce your DWG file size. (Engineer Atlas)") (princ) Load it with APPLOAD (or drag it into the drawing), then type DWGCLEAN. I have also attached the file if you would rather load the file directly, since forum copy-paste sometimes mangles the formatting. If you would rather do it by hand without the LISP, here is the same workflow manually: Type -PURGE, choose Regapps, enter * for all, No to "verify each" Type -PURGE, choose All, * , No. Run this 3 or 4 times so nested blocks and styles clear out Type AUDIT, answer Yes to fix any errors Type WBLOCK, select the entire drawing, and save it to a new file name. Open that new file and check it One safety note: always work on a copy of anything important, and open the _clean file to verify it before you replace the original. The routine is deliberately non-destructive (no OVERKILL, no xref detach, no exploding of objects), so it will not alter your geometry. Hope it is useful. Feedback welcome if anyone spots an edge case. DWGCLEAN.lsp
  2. Hi everyone, we have already placed a block object in multiple locations. Now we need the same block in a converter rectangle array format. Is there any idea or Lisp program available?ilable
  3. while browsing the interwebs the other day i came across a few pages talking about using gaming keyboards and mice in conjunction with autocad. so i did a little bit of reading/research (things are slow at work) and found out it wasn't to difficult to do, and a new mouse was like $80. i thought why not give it a try. i took to amazon to get the logitech G600 for $49 w/prime shipping, i received it monday and tuesday i was off and running. the most difficult thing about it was choosing what commands to program on the thumb keys. it has the normal two mouse buttons and scroll wheel up, down, left and right, with third mouse button as a "shift key" for the 12 thumb buttons to make 24 individual keys, plus two other buttons with the scroll wheel that i believe select between profiles you can set. (haven't dove completely into it) after working with it for the better part of tuesday, this morning wednesday i reconfigured some commands on the thumb pad and printed out a cheat sheet to memorize. some of the commands like copy/past/cut work outside of Autocad which is a plus. it has helped in some areas of accuracy typing commands like move between 2 points (i mistype a lot) but slowed other processes down just because its new and still getting to the nuances of operation. i believe it will become second nature as long as i don't change the commands often as i feel which ones fit best or needed more. anyways i thought i would just throw this out there maybe it's something you would like to try or have some experience with or didn't know you could use. let me know if there is something else out there you have tried to work with. links: http://www.lifehacker.com.au/2015/05/why-i-started-using-gaming-peripherals-to-get-real-work-done/ http://blog.grabcad.com/blog/2010/08/28/best-for-cad-work-mouse-trackball-3d-device/ https://www.amazon.com/Logitech-G600-Gaming-Mouse-Black/dp/B0086UK7IQ/ref=sr_1_sc_1?ie=UTF8&qid=1486577758&sr=8-1-spell&keywords=logitehc+g600
  4. At my last job, most of sat for 8 hours just drafting telephone line routes. For a CAD position, it lacked in creativity and thus did not give a lot of people a chance to shine. Many people who worked there were and still are people who had never heard of CAD until they started the two week training program at this company. These most of these people, along with some of the people who had went to school for CAD, found themselves bored out of their minds. Which is the point of this thread. There are two types of drafters these days: ones that get very bored of CAD and the others that will always be excited about it. A middle group of people who don't care usually is not to be found. If you look at a CAD job as 8 hours in front of a computer, you will no doubt fall in with the first group. But if you look at it as an endless puzzle full of ways to improve, than you will enjoy a career in CAD. My advice would be, if you are shooting for a career in CAD, make sure its something that excites you, or else it could be a very long 8 hours for you.
  5. Though it is possible to be a distinguished AutoCAD user without knowing what is going on in your computer, it is almost entirely impossible to manage a drafting department without this knowledge. Most of AutoCAD users know thier computer front to back, not just the software, but also the hardware. If you are managing a drafting department and do not know the difference between RAM and Hard drive memory, it is hard to make a case to your financial department about why you need the 1200 dollar desktop instead of the 500 dollar desktop. And you really do not want to get stuck with a 500 dollar desktop. Just knowing the system requirements of AutoCAD and what you computer has is a start. But if you want to move up the ladder of your company, this is vital information. This information can be found all over the internet (feel free to post with trusted sites if you know any). Again, a lot of this is well known information, but sometimes overlooked. I know in my own case, I was four or five years into AutoCAD before I knew about what was inside the computer.
×
×
  • Create New...