Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/24/2022 in all areas

  1. Likewise I have a similar LISP on startup, the variables I like to use (might be stealing some of that list) and loading the LISPs I most often use. Taking BigAls LISP a bit further, I have one "Appreload" which loads all the LISP files in my library, which could also be run at start up, can be modified to princ each lisp file name as it loads (defun c:appreload ( / lspname myfiles acount mylistlength Failedtoload) ;;Re-load named LISP files (setq mylispfolder "C:\\Users\\wherever\\") ;;;;;; change this line ;;;;;;;;; ;;;;;;; edit for laptop ;;;;;;; Laptop maps company driver differently to desktop so added this (if (= (findfile "C:\\Users\\wherever\\SIMPLELISP.lsp") nil) ;;;; if it can find this file do nothing.. use anyfile in your library (setq mylispfolder "C:\\Users\\lapTop File Location\\") ) (setq myfiles (vl-directory-files mylispfolder "*.lsp" nil)) ;;myfiles is list of files in mylispfolder location (setq mylistlength (length myfiles)) ;;count of number of lsp files (setq acount -1) (repeat mylistlength (setq acount (1+ acount)) (setq FailedtoLoad (strcat (nth acount myfiles) " failed to load")) (load (strcat mylispfolder (nth acount myfiles)) FailedtoLoad) ;;Loads each LISP file ) (princ "\n") (princ mylistlength) (princ " lsp files loaded from ") (princ mylispfolder) (princ) ) and one for mhupp, snaps (AutoCAD, not sure if Bricscad does it the same way? ;;Snaps. ( * 1.. to use snap, ( * 0 to turn off snap. (setq snaps 0) (setq snaps (+ snaps (* 1 0))) ;None (setq snaps (+ snaps (* 1 1))) ;End Point (setq snaps (+ snaps (* 1 2))) ;Mid Point (setq snaps (+ snaps (* 1 4))) ;Centre (setq snaps (+ snaps (* 0 8))) ;Node (setq snaps (+ snaps (* 0 16))) ;Quadrant (setq snaps (+ snaps (* 1 32))) ;Intersection (setq snaps (+ snaps (* 0 64))) ;Insertion (setq snaps (+ snaps (* 0 128))) ;Perpendicular (setq snaps (+ snaps (* 1 256))) ;Tangent (setq snaps (+ snaps (* 0 512))) ;Nearest (setq snaps (+ snaps (* 0 1024))) ;Geometric Centre (setq snaps (+ snaps (* 1 2048))) ;Apparent Intersection (setq snaps (+ snaps (* 0 4096))) ;Extrnsion (setq snaps (+ snaps (* 0 8192))) ;Parallel (setq snaps (+ snaps (* 0 16348))) ;Superess all running snaps (setvar 'osmode snaps)
    2 points
  2. This is my on on_doc_load.lsp for BricsCAD in "C:\...\BricsCAD\Support" to help keeping a standard between drawings. (setvar 'cmdecho 0) (setvar 'INSUNITS 1) ; Sets the Drawing units to inches (setvar 'THICKNESS 0) ; Sets THICKNESS TO 0 (setvar 'CECOLOR "BYLAYER") ; Sets color property to "BYLAYER." (setvar 'CELTYPE "BYLAYER") ; Sets linetype property to "BYLAYER." (setvar 'CELWEIGHT -1) ; Sets the lineweight to "BYLAYER." (setvar 'CELTSCALE 1) ; Sets the LTScale of new objects to 1. (setvar 'plinetype 2) ; convents all 2D polylines to optimized polylines (setvar 'auprec 4) ; angular unit percision 0.0000 (setvar 'luprec 4) ; linear unit percision 0.0000 (setvar 'selectionmodes 0) ; Set Selection mode to 0 (setvar 'lunits 2) ; Set Linear units to Decimal (setvar 'perspective 0) ; Turn off Perspective view in current viewport ;(setvar 'saveformat 8) ; Set save to 2010 DXF ;might not want this one. have it set for cnc software we use (setvar 'nomutt 1) (vl-cmdf "_.Style" "Standard" "Consolas" "" "" "" "" "") (setvar 'nomutt 0) (setvar 'cmdecho 1)
    2 points
  3. ooo another way. (strcat (chr 92) "46.48.10random IP\...")
    2 points
  4. Are the widths fixed size if so look at my Multi radio buttons.lsp can have the sizes pre programmed. (setq ans (atoi(ah:butts ahdef "V" '("Choose a number" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10")))) Multi radio buttons.lsp
    2 points
  5. I have a custom lisp with all my defuns in it so load on start up. (defun C:zzz ( / ) (load "blahblah.lsp")). See Autoload.lsp below Appload.
    2 points
  6. Yeah, sure. Command TCCR. I let you first enter the width. Then, since you need that width multiple times I put the rest in a while loop. Of course you can hard code the width and remove the while if you want. ;; degrees to rad (defun deg2rad (deg / ) (/ (* deg pi ) 180) ) ;; draws a polyline (defun drawLWPoly (lst cls) (entmakex (append (list (cons 0 "LWPOLYLINE") (cons 100 "AcDbEntity") (cons 100 "AcDbPolyline") (cons 90 (length lst)) (cons 70 cls)) (mapcar (function (lambda (p) (cons 10 p))) lst)))) ;; TCCR for: Two Click Centerline Rectangle (defun c:TCCR ( / w ang p1 p2 bl br tl tr) (setq w (getreal "\nWidth: ")) (while (setq p1 (getpoint "\nPoint 1:")) (setq p2 (getpoint "\nPoint 2:" p1)) ;; calculate bottom/left, bottom/right,... (setq ang (angle p1 p2)) (setq bl (polar p1 (- ang (deg2rad 90.0)) (/ w 2.0))) (setq tl (polar p1 (+ ang (deg2rad 90.0)) (/ w 2.0))) (setq br (polar p2 (- ang (deg2rad 90.0)) (/ w 2.0))) (setq tr (polar p2 (+ ang (deg2rad 90.0)) (/ w 2.0))) (drawLWPoly (list bl br tr tl) 1) ) )
    2 points
  7. @Kreaten_vhar !!!! Perfect! Works exactly like I need Thank You very Much Tom
    1 point
  8. @Kreaten_vhar That's what I'm looking for! Is there a way to display the numbers in fractions, rounded to the nearest 1/8"...? Thanks Tom
    1 point
  9. Just taking a shot and what I assume you're looking for: edit: forgot about the rounding part oops. Gonna see what I can do there if anything. edit2: Threw in Lee Mac's roundm function, but I haven't tested it. Still no fractions edit3: I think I broke it... You can change DISTR to DIST to just get the length with no rounding for now if you'd like, it'll work in that way. edit4: Fix'd-er up, and it displays fractions! (I'm also pretty sure the code could be a bit better. I change the data-type of DIST and DISTR probably needlessly) (defun LM:roundm (n m) ;gotta love Lee Mac (http://www.lee-mac.com/round.html) (* m (fix ((if (minusp n) - +) (/ n (float m)) 0.5))) ) (defun c:linelength (/ s e) ;function taken from helpful post by Tharwat @ https://www.cadtutor.net/forum/topic/55856-lisp-to-get-length-of-single-line/ (princ "\n Pick on one line to get its length :") (if (setq s (ssget "_+.:S:E" '((0 . "LINE")))) (progn (setq DIST (rtos (distance (cdr (assoc 10 (setq e (entget (ssname s 0))))) (cdr (assoc 11 e))) 2)) (setq DISTR (LM:roundm (distof DIST) 0.125)) (setq DISTR (rtos DISTR 5)) (command "TEXT" PAUSE PAUSE 90 DISTR) (princ) ) ) ) You select the line, then select where you want the text of the length to be placed, then choose a size for the text. It then plops it where you set with the 90* rotation applied. Hope that helps
    1 point
  10. Good morning, could you upload a dwg with a before and after of what you want?
    1 point
  11. How I set the snaps I like. ;;----------------------------------------------------------------------------;; ;; Set Osnaps to Endpoint, Middle, Center, Quad, Insertion, Intersection (defun C:OS () (setvar 'osmode 119) (prompt "Osnap Settings set") (princ) ) --edit And I have a hotkeys for tangent, perpendicular, & Geometric center
    1 point
  12. Good to hear another often used is ";" used in excel rather than "," yes as txt should auto open now. For future, to work out number type this on command line (ascii (getstring)) enter say "A" = 65 (defun c:ah:extxt ( / ) (setq ss (ssget '((0 . "*TEXT")))) (if (= ss nil) (alert "Something went wrong no text selected ") (progn (setq fo (open "D:\\acadtemp\\extxt.txt" "W")) (repeat (setq x (sslength ss)) (setq ent (entget (ssname ss (setq x (1- x))))) (setq txt (cdr (assoc 1 ent))) (setq hand (cdr (assoc 5 ent))) (write-line (strcat hand (chr 9) txt (chr 9) txt) fo) ) ) ) (close fo) (startapp "notepad.exe" "d:\\acadtemp\\extxt.txt") (princ) )
    1 point
  13. When you just want A-Z its easy just use (chr 65) (chr 66)....... but is limited to A-Z, a-z (chr 97) ..... Credit to Gilles though look in getexcel for 2 more.
    1 point
  14. Check your other post. Admin merge posts ?
    1 point
  15. Example for a network printer (COMMAND "-PLOT" "Y" "" "\\\\PROD\\your printer" "A3"
    1 point
  16. As you say if blocks are a mix then a problem. The solution appears to be 2 steps not one. You should be able to stop in your script, been a while, generally its no user input, any way a script can have lisp code in it or call a lisp program that program may have a stop and ask a question. Only a quick look but add set units.lsp to your Appload Start up suite then the functions will be available. remove the (command ".script" (strcat folderName "\\batchJob.scr")) in batchjob code. Your batchjob1.scr should be, (BatchJob) (command ".script" (strcat folderName "\\batchJob.scr")) The script needs (c:UNITSET) to be added after open dwg1 etc in batchjob I think that is what you need. Not tested. open dwg1 (c:UNITSET) close Y open dwg2 (c:UNITSET) close Y You dont need lee's bounding box can just load the boundingbox lisp as part of the script.
    1 point
  17. Wonderful, works like a charm! I really need to learn how to write lisp routines, what would you say would be the best way for someone to get started on the language/syntax?
    1 point
  18. Don't know if you want metric or imperial, but I uploaded a zip with a full set of metric ones some years ago: https://www.cadtutor.net/forum/topic/62352-titleblock/?tab=comments#comment-514547
    1 point
  19. If your going to start from scratch here is a little trick to get the maximum print area. Once the page size is set create a viewport and use the fit option. This creates a viewport on the dashed lines in paper space. (the maximum print area) You now have something to snap to when drawing a rectangle. That rectangle will need to be offset in a small distance. Then just delete the viewport and larger rectangle. you can now create a title block within said rectangle.
    1 point
  20. What has all of that have to do with a Title Block Template? I didn't see the request for Drawing Templates. Back on topic, it would be near impossible to give you a Title Block to suit your needs without knowing what those needs would be. I have several different Title Blocks for different types and sizes of drawings. Each one designed to meet specific needs. It is pretty easy to make one. If you need specific help, just ask.
    1 point
  21. Forgot to add just take a existing drawing as a start and erase all objects but dont do a purge and add more to it, like Tombu use Lee's steal.
    1 point
  22. I have a few basic templates that include blocks, styles, layers and layer states we use for all our drawings. Everything else like page setups, layouts with title blocks and additional text & dimension styles are imported using Lee Mac's Steal from Drawing macros. Too many sizes & types of layouts & title blocks to include them all in a new drawing from a template.
    1 point
  23. Its really about you making the template it should have all your text styles, a title block that suits you, just add attributes to suit, linetypes including custom ones. My old dwt for instance for civ3D had like 200 layers, description keys, 100 Blocks and so on. So we had custom purge scripts ran after importing field survey. So removed unwanted objects. Our Surveyors had like 12 different layouts as they contained state survey forms.
    1 point
×
×
  • Create New...