Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/29/2022 in all areas

  1. Taking MHUPP and adding a bit more.... (meaning he beat me to it again) This is what I use - a longer version than above. Technical bit - each snap option has a value (0, 1, 2, 4, ....) and adding these together will give you the value you want to use in 'osmode variable. Looking at the list below to add up what you want. For a simple example a value of 3 means "End Point" + "Mid Point" which is the sum MHUPP did for you to get 191. I wouldn't have done the calculation, just given you this and let you work it out!! In mine below, change the (* 1 or (* 0 so that it is a 1 if you want to use the snap, 0 if you don't (so I have end point, mid point, centre but not node or quadrant). The first option "none" is just there for completion - has no effect (1 x 0 or 0 x 0 = 0), it will add it up for you and set the snaps. MHUPP: Borrowed your routine name and the princ at the end, ta! (defun c:os ( / snaps) (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) (prompt "Osnap Settings set") )
    3 points
  2. ;;----------------------------------------------------------------------------;; ;; Set Osnaps to Endpoint, Midpoint, Center, Node, Quadrant, Intersection, Perpendicular (defun C:OS () (setvar 'osmode 191) (prompt "Osnap Settings set") (princ) )
    2 points
  3. I might be tempted to combine these to a single -capture everything- LISP using something like (if (findfile "ISO..lin") (setq linefile "Iso.lin") (setq linefile "acadiso.lin") ) fewer files to manage.
    2 points
  4. mid is the point (defun c:FOO (/ pt1 pt2 mid) (if (and (setq pt1 (getpoint "\nSpecify first point: ")) (setq pt2 (getpoint "\nSpecify second point: "))) (progn (setq mid (mapcar '/ (mapcar '+ pt1 pt2) '(2 2 2))) (prompt "\nThe midpoint is: ") (princ mid) (entmake (list (cons 0 "POINT") (cons 10 mid))) ) ) (princ) )
    2 points
  5. yes,bricscad... if I remeber correcttly, in autocad the file name for those issues is ACADDOC.lsp. I made one more change, or should I say a more advanced approach: in the ON_START.LSP file I entered the lisp code without using the lisp name in this way: (foreach lt '("Center" "Center2" "Centerx2" "Hidden" "Hidden2" "Hiddenx2") (if(not(tblsearch "ltype"lt)) (command "_.-linetype" "_l" lt "iso.lin" "") ); end if ); end foreach (princ) what it dose is that the code run on startup, do what it is ment to do (load the line types in this case) but it dosn't create a custom command by the name of LLT and it dosen't load a lisp file in to memory.
    1 point
  6. Ahh, Bricscad, we use AutoCAD so I didn't know the file names..... thanks, I learn something every day too!!!
    1 point
  7. @Steven P thanks for the reply. you gave me a few directions... what I did eventualy is this: I've made sure that the path to the LSP files folder is in the search path. in bricscad there are 2 types startup files - ON_DOC_LOAD.LSP that load for every time a new drawing is opened. ON_START.LSP that open only once when the software is starting. I've entered those lines of code to the ON_START.LSP file: (load "llt") (command "llt") and thats it...
    1 point
  8. True,I agree. but usually people either work with one or the other, and only rarely do they work simultaneously with both.
    1 point
  9. @leonucadomi Hi. I've attached 2 files: llt_Autocad.lsp for autocad lt_Bricscad.lsp for bricscad see if it helps... aridzv llt_Bricscad.lsp llt_Autocad.lsp
    1 point
  10. Amazing! It works! Thank you so much for your help mhupp!
    1 point
  11. See if this works (if (setq vla-obj (vlax-ename->vla-object (car (entsel"\nSelect Object")))) (progn (vla-put-DimensionLineColor vla-obj "ByLayer") (vla-put-extensionlinecolor vla-obj "ByLayer") (vla-put-TextColor vla-obj "ByLayer") ) )
    1 point
  12. (prompt (strcat "\nThe midpoint is: " (vl-prin1-to-string mid)))
    1 point
  13. Give these a try. They will show visual lisp properties and dxf codes of selected entities. ;;----------------------------------------------------------------------------;; ;; Dump all methods and properties for selected objects (defun C:VDumpIt (/ ent) (while (setq ent (car (entsel "\nSelect Entity to Dump"))) (vlax-Dump-Object (vlax-Ename->Vla-Object ent) t) ) (textscr) (princ) ) ;;----------------------------------------------------------------------------;; ;; Dump all DXF Group Data (defun C:DumpIt (/ ent) (while (setq ent (car (entsel "\nSelect Entity to Dump"))) (mapcar 'print (entget ent '( "*"))) ) (textscr) (princ) )
    1 point
  14. ; Get information from user Subidoooo or Pteven P Your welcome to use Multi getvals.lsp can set some default values also. Just a thought is it necessary to do offset maybe work out the other side points and make 1 pline. Because its a continuous shape each pt could be say ptx using set and read can do a (set (strcat "pt" "rtos (setq x (1+ x)) 2 0)) value will find example if you want. Multi GETVALS.lsp
    1 point
  15. Just tested mhupp's code and it looks like it's working just fine , well done mhupp
    1 point
  16. Using the title block instead of creating a viewport (defun c:Clean (/ ss tblk LL UR ss1 ss2) (command "_.Undo" "BE") (setvar 'cmdecho 0) (foreach lay (layoutlist) (setvar 'ctab lay) (command "_.Zoom" "E") (if (and (setq ss (ssget "_X" (list '(0 . "INSERT") '(2 . "GP1117_21" ) (cons 410 lay)))) (= (sslength ss) 1)) (progn (setq tblk (vlax-ename->vla-object (ssname ss 0))) (vla-GetBoundingBox tblk 'LL 'UR) (setq LL (vlax-safearray->list LL) UR (vlax-safearray->list UR) ) (if (and (setq ss1 (ssget "_A" (list (cons 410 lay)))) (setq ss2 (ssget "_W" LL UR (list (cons 410 lay))))) (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss2))) (ssdel ent ss1) ) ) (ssdel (ssname ss 0) ss1) (command "_.Erase" SS1 "") (command "_.Zoom" "E") ) ) ) (setvar 'cmdecho 1) (command "_.Undo" "E") (princ) )
    1 point
  17. Afralisp has some good tutorials. Learn AutoLISP for AutoCAD productivity | AfraLISP https://www.afralisp.net/
    1 point
  18. My first introduction to LISP. My first step to LISP
    1 point
×
×
  • Create New...