Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. Spot on, BIGAL. You're 100% right about the quantity takeoff (QTO) catch. In civil and structural workflows, physically severing a line or pipe geometry for cosmetic reasons creates absolute havoc when extracting true lengths and schedules later on. This quick routine was built purely for 2D drafting/detailing where visual layout takes precedence, but your point about true engineering lengths is a vital distinction that every drafter should keep in mind. To your second point: you're completely right. In the 40-year history of AutoCAD and AutoLISP, is there any daily drafting convenience routine that hasn't already been written a dozen times over? This tool actually came from a junior drafter on another forum who was struggling with basic break operations. For veterans who have spent decades in the forums, digging up a 15-year-old snippet or writing a quick defun is second nature. But for someone just starting out today, wading through thousands of fragmented legacy threads, dealing with APPLOAD, and fixing support paths is an intimidating barrier. And that’s honestly the whole philosophy behind what I’m building with VedaCAD. The goal isn't to claim that I've invented groundbreaking algorithms or brand-new geometry math. The code already exists in the collective wisdom of this community. The bottleneck has always been accessibility and distribution. Packaging even the simplest, most mundane utility into a 6-character VCID isn't about code prestige—it’s about bridging that gap so a beginner can get up and running in 2 seconds without the 30-year-old deployment friction. Really appreciate the engineering critique on the cut-out lengths—always learning from the veterans here!
  3. Today
  4. Just a comment if a dwg has been made by CIV3D the purge command will not remove objects even un used, you need to run PURGESTYLESANDSETTINGS it can make a big difference. After run normal Purge. Also in CIV3D surfaces are inside a dwg. But you may need CIV3D to run purges&s or remove surfaces. Similar for other CAD 3rd party add ons can have lots of proxy objects, you can use "ZOMBIE KILLER" to remove proxy objects, say in Bricscad the opening screen will show a message dwg has proxy objects.
  5. Just a comment, in some instances, one bug with trimming ends as in the triangles is that it is a visual display thing, but for quantities need the true length including the cut out bit. Can be done using other methods. Did you do a google and look at Forums/autodesk pretty sure have seen that done before and code was provided. A google search revealed multiple pages re this subject.
  6. Just a side comment did a wave 3D Tin surface for a huge tract of land, but it was a single wave in one direction. think ocean waves, the site was like 2.5km by 2.5km. Had bridges, ponds, walkways, cut through the wave surface. Using a formula could do one wave but extrapolating that formula for multiple waves would need mathematical modelling, with subtle changes to the formula. Looking at the image the left and right edges are sort of fixed widths a slight variation. If you put up and down lines on the multi simple straight plines and reform them using again a wave formula. No idea where to even start.
  7. BIGAL

    New AutoCAD Museum Forum

    It may now look like a "Medion Design USB Graphics pad". Yes did get it to work with CAD but went back to a mouse, I dont do enough true drafting to really get into using it. Maybe Win 10.
  8. If you go old fashioned this is built into a pop menu. If you can use Notepad then you can make one. Note the Next and Previous inbuilt options. But I also have 2x2, 3x3, 4x4 and so on dcl's they are used when relevant to limited choices in code via an image pick.
  9. BIGAL

    A new get length LISP

    For Excel direct the simplest is open a new Excel. You can open an existing excel by file name or even get current Excel Worksheet. You can then get say last row that contains something so that when you add more answers you know the row to start at. I would just make a simple lisp that has all the required defuns in it. Open a new Excel. Then write the row answers. with say a 1 row gap. As version 1. Yes version 2 Open new, use existing, open an existing file. The other defuns that could be added are stuff like color cell text and backgrounds. I called this little lisp "Alan open-read-write excel.lsp" ; Excel function using lisp ; By AlanH and inspiration from others ; Gilles ; JefferyPSanders.com ; Lee-mac ; MunteanStefan ; danielrodriguez ; code by the great FIXO no longer with us (defun Openexcel ( / ) (princ "\nOpening Excel...") ;; Try to get or create Excel instance (setq myxl (vl-catch-all-apply 'vlax-get-or-create-object '("Excel.Application"))) (if (vl-catch-all-error-p myxl) (progn (prompt "\nError: Could not start Excel.") (exit) ) ) (if (= (vlax-get-property (vlax-get-property myXL 'WorkBooks) 'count) 0) (vlax-invoke-method (vlax-get-property myXL 'WorkBooks) 'Add) ) (vla-put-visible myXL :vlax-true) (vlax-put-property myxl 'ScreenUpdating :vlax-true) (vlax-put-property myXL 'DisplayAlerts :vlax-true) (princ) ) ;; Thanks to fixo ;; ;; = Set Excel cell text = ;; (defun xlsetcelltext ( row column text) (setq cells (vlax-get-property (vlax-get-property myxl "ActiveSheet") "Cells")) (vl-catch-all-apply 'vlax-put-property (list cells 'Item row column (vlax-make-variant (vl-princ-to-string text) vlax-vbstring))) ) ;; Thanks to fixo ;; get value of a cell (defun getcell2 (row column / ) (setq cells (vlax-get-property (vlax-get-property myxl "ActiveSheet") "Cells")) (setq cell (vlax-get (vlax-variant-value (vlax-get-property cells "Item" row column)) 'value)) ) A sample sequence. You could put all the code in your program. Maybe later will post something with a Excel option. (if (not openexcel)(load "alan open-read-write.lsp")) (openexcel) (xlsetcelltext 4 4 "Alan") (getcell2 4 4) @SLW210 Happy to do the CSV, Excel or Libreoffice code. Post updated code and dcl etc.
  10. Yesterday
  11. Perhaps consider annotative dimensions & hatches
  12. 1) Unlike setvar, setenv is not a command but a lisp function that's the reason AutoCAD is returning: setenv Unknown command "SETENV". Press F1 for help. So you would have to begin it with open parenthesis and end it with close parenthesis. An example would be: (setenv"MaxArray""200000") 2) There's no SHOWTABS environment variable unless this is set elsewhere. 3) For a list of AutoCAD environment variables open Windows Registry: Regedit and browse to: HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\<Version>\<ProductID>\FixedProfile\General
  13. The problem is scaling dimensions and hatches. I usually copy a detail into completely separate space to edit and dimension this detail in paper space. Unless I'm missing something here..
  14. I would like to add another advantage of plotting in paper space is the ability to have multiple vports looking at the same area in the model but using different scales.
  15. Installation method (upgradable in the future): [Wave Animator] VCID: 31E6TS @ VedaCAD Note: To install via VCID, you need to install VedaCAD in advance and log in to a free account (or PRO account). Tips: Welcome developers to publish their plugins on VedaCAD and obtain their plugin's VCID for plugin sharing (even free accounts can publish)
  16. You could also add these 2, purgezerolangth and purgezerotxt, they will remove some entities but not generally make a massive change to size. (defun PurgeZeroLengths ( / MySS Fuzz acount DelSS MyEnt EndA EndB) ;; for within blocks (setq MySS (ssget (list (cons 0 "LINE,SPLINE,LWPOLYLINE,POLYLINE,ARC,CIRCLE,ELLIPSE")))) (setq Fuzz 0.0001) ; Fuzz factor to delete very short entities (setq acount 0) (setq DelSS (ssadd)) (while (< acount (sslength MySS)) (setq MyEnt (ssname MySS acount)) (if (equal (vlax-curve-getDistAtParam MyEnt (vlax-curve-getEndParam MyEnt)) 0) (progn (setq DelSS (ssadd MyEnt DelSS)) ) ) ; end if ;;If less then a length (if (< (vlax-curve-getDistAtParam MyEnt (vlax-curve-getEndParam MyEnt)) Fuzz) (progn (setq DelSS (ssadd MyEnt DelSS)) ) ) ; end if (setq acount (+ acount 1)) ) ; end while (princ "\nDeleting ")(princ (sslength DelSS))(princ " lines") (command "erase" DelSS "") (princ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun c:PurgeZeroTexts ( / MySS acount DelSS MyEnt MyText) (setq MySS (ssget (list (cons 0 "*TEXT")(cons 1 "")))) (setq acount 0) (setq DelSS (ssadd)) (if MySS (progn (while (< acount (sslength MySS)) (setq MyEnt (ssname MySS acount)) (setq MyText (cdr (assoc 1 (entget MyEnt)))) (if (equal MyText "") (progn (setq DelSS (ssadd MyEnt DelSS)) ) ) ; end if (setq acount (+ acount 1)) ) ; end while (princ "\nDeleting ")(princ (sslength DelSS))(princ " lines") (command "erase" DelSS "") ) ; end progn (progn (princ "No zero content texts found") ) ) ; end if (princ) )
  17. SLW210

    A new get length LISP

    I have this almost finished, but currently have a separate DCL for it, looks to work very well for all units and recognizes the drawing units for Metric, Imperial by using Insertunits. I'll try to post next week, Tuesday or Wednesday if I get a chance to get it like I want it. I need to look into the option for MS Excel and LibreOffice Calc vs CSV I may or may not bother. So far... ;;; ============================================================ ;;; GetLen.lsp ;;; PROFILE / CENTERLINE LENGTH ;;; ;;; VERSION: 2026-09-03 ;;; ;;; Supports: ;;; LINE ;;; ARC ;;; CIRCLE ;;; LWPOLYLINE ;;; POLYLINE ;;; SPLINE ;;; ELLIPSE ;;; ;;; If PELLIPSE=1: ;;; Heavy Polyline (a.k.a. Old Style or 2D Polylines) made from bulged VERTEX records. ;;; These can be converted with CONVERTPOLY command, I chose to work with the Heavy Polylines. ;;; ;;; Supports: ;;; - Model Space ;;; - Paper Space ;;; - Blocks ;;; - Nested blocks ;;; - Anonymous/dynamic blocks (*U...) ;;; - Uniform block scaling ;;; - Single profile ;;; - Two-profile average / centerline ;;; - Batch (Sends output to CSV for perimeters of multiple selected entities.) ;;; - Screen output ;;; - CSV output ;;; - Multiple output unit formats ;;; * Metric - Millimeters ;;; * Metric - Meters ;;; * Architectural - Feet/Inches ;;; * Imperial - Fractional Inches ;;; * Imperial - Decimal Feet ;;; * Imperial - Decimal Inches ;;; - Automatic drawing-unit detection from INSUNITS ;;; - Endpoint tolerance ;;; - Optional gap measurement
  18. SLW210

    Creating semi random waves

    I'm pretty sure that's something that AutoCAD cannot do out of the box. You posted this in the AutoCAD 3D Modelling & Rendering Forum, were intending to post in the AutoLISP, Visual LISP & DCL Forum?
  19. Those methods only address a small portion of what can cause file bloat, it's a good start, but sometimes more needs to be done to truly clean up a drawing. In the other thread you posted in, there are other methods to clean drawings mentioned. As always, thanks for posting your version, I am sure many will find it useful.
  20. Welcome You can try distributing plugins using the VedaCAD method, which supports LSP, FAS, VLX, ARX, and DLL format plugins. There's no need to configure paths or copy code anymore; on the user side, a 6-digit VCID = a certain plugin function, and it is directly available.
  21. What are the differences in the computers? Graphics Card and/or drivers? Are those images of the PDFs? AutoCAD 2014? Did you try the default DWGtoPDF?
  22. Discus84

    Creating semi random waves

    This will be a flat array which looks like a 3d. Essentially a number of lines/splines.
  23. SLW210

    Creating semi random waves

    Are these 3D objects of some type? Splines? 3D Polylines?
  24. I have moved your thread to the AutoLISP, Visual LISP & DCL Forum. Welcome to CADTutor!
  25. Have you ever had two 3D solids that look connected, but UNION does not combine them? One common reason is that the solids are only touching at an edge or face, rather than overlapping. A simple check is to move one solid slightly and use INTERFERE to see whether the two solids actually occupy the same space. If they need to become one solid, make sure they have a proper intersection and then run UNION again. How many of you have faced this problem? What was stopping the solids from joining?
  26. That’s a fair point. A base point being far from the block isn’t always wrong; it depends on how the block is meant to be used. I was referring to cases where the base point was set incorrectly. Thanks for pointing that out.
  27. Engineer Atlas

    Cleaning up the file

    Hello I follow this workflow to reduce the size of dwg files. 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 Hope this helps. Open for discussion You can also use OVERKILL after step 3 if you feel like, to delete duplicate lines.
  28. 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
  1. Load more activity
×
×
  • Create New...