Jump to content

All Activity

This stream auto-updates

  1. Today
  2. I think for this you are going to have to go full 'Lee Mac' - if you want snaps as well then look at Lee Macs website and grsnaps where he has this, though you'll need to read, understand and put into your LISP. I'm not sure why you are doing it that way, this should do the job just as well, where xscale is the scale factor (1?), first pause could be pt1 "_non" (command "-insert" -Blockame- pause "" xscale pause)
  3. Although, really, once you dive into '(grread nil...)' the state of these variables no longer directly affects you. It's like finding a corner where you're safe from the 'Matrix'
  4. ronjonp

    Autolisp for PDF underlays

    I really miss that guy. ;/ He was such a witty kind person and one of the most talented lisp programmers I knew.
  5. Hi @Laranjeira '(grread T 15 0)' won't let you toggle ORTHOMODE or OSMODE at runtime. If you want that option to work, you'll have to use '(grread nil...)' And then you'll have to 'manufacture' the object reference yourself.
  6. I have this routine where I select a block, the routine asks for an insertion point and allows the block to be rotated to orthomode angles. The block becomes visible and rotates following the mouse. The routine requests other points and the blocks are inserted and rotated according to the project's needs. What I need is for the routine to also accept free angles, but accept osnap and F8 for orthomode. There is an error in the input of the name of the last block used, but I think I can fix that. (defun c:insrot0 (/ *error* blk oldosmode oldortho blkname pt1 pt2 ang tmp_blk dyn_ang continue) ;; Error handler (defun *error* (msg) (if (and tmp_blk (entget tmp_blk)) (entdel tmp_blk)) (if (not (member msg '("Function cancelled" "quit / exit abort"))) (princ (strcat "\nError: " msg)) ) (if oldosmode (setvar 'osmode oldosmode)) (if oldortho (setvar 'orthomode oldortho)) (princ) ) ;; Get block name (setq blkname (getstring "\nNome do bloco (Enter para último usado): ")) (if (or (not blkname) (eq blkname "")) (setq blk (getvar 'insname)) (setq blk blkname) ) (while (not (tblsearch "block" blk)) (alert (strcat "Bloco \"" blk "\" não encontrado.")) (setq blkname (getstring "\nDigite o nome do bloco válido: ")) (if (or (not blkname) (eq blkname "")) (setq blk (getvar 'insname)) (setq blk blkname) ) ) (setq oldosmode (getvar 'osmode)) (setq oldortho (getvar 'orthomode)) (setvar 'osmode (boole 7 oldosmode 514)) ; 512+2=514 ;; Main insertion loop (while (setq pt1 (getpoint "\nPonto de inserção (Enter para terminar): ")) ;; Create temporary block (entmake (list (cons 0 "INSERT") (cons 2 blk) (cons 10 pt1) (cons 50 0))) (setq tmp_blk (entlast)) (setq continue T) ;; Dynamic rotation (princ "\nSelecione o ponto para determinar o ângulo (F8 para ortogonal): ") (setq dyn_ang 0.0) (redraw) (while continue (setq pt2 (grread t 15 0)) (cond ((= (car pt2) 5) ; Mouse movement (setq ang (angle pt1 (cadr pt2))) (if (= (getvar 'orthomode) 0) (setq dyn_ang (* (fix (+ (/ ang (/ pi 2)) 0.5)) (/ pi 2))) ; Ortho angle (setq dyn_ang ang) ; Free angle ) (entmod (subst (cons 50 dyn_ang) (assoc 50 (entget tmp_blk)) (entget tmp_blk))) (redraw) ) ((or (= (car pt2) 3) (= (car pt2) 25)) ; Left click or right click (entdel tmp_blk) (command "_.-insert" blk "_non" pt1 "" "" (angtos dyn_ang)) (setq continue nil) ) ((= (car pt2) 2) ; Keyboard (if (member (cadr pt2) '(13 32)) ; Enter or Space (progn (entdel tmp_blk) (command "_.-insert" blk "_non" pt1 "" "" "0") (setq continue nil) ) ) ) ((null pt2) ; User pressed Enter (entdel tmp_blk) (setq continue nil) ) ) ) ) (setvar 'osmode oldosmode) (setvar 'orthomode oldortho) (princ) )
  7. SLW210

    Program to measure in a PDF doc?

    Precise measuring is not the intended purpose of PDF format. If you are asking for new programs to do this, then by default, those needing it will need to be trained. Apparently they do not even know how to use Acrobat which they already have, I would presume. They could always plot and use the appropriate ruler scale like in old times. Though I would presume they would need training. You do not have to "know" CAD to open a drawing and get some dimensions any more than you would need to learn to do it for a PDF. There are some very cheap and free CAD programs that would work for measuring .dxf etc. Inkscape/Illustrator has measure tool, not sure if it's easier or better than the Acrobat one though.
  8. jim78b

    blockname lisp

    Ok for now i appreciate your help. I will work better tomorrow . I think is a good job.
  9. aridzv

    blockname lisp

    Of course it happens in the lisp, that's the idea. see at the start of the code (setq osnp (getvar "OSMODE")) (setvar "OSMODE" 0) and at the end of the code restore the OSNAP mode: (command "._PSPACE") (SETVAR "OSMODE" osnp) (princ) Try selecting the block with the cursor trying to snap at every entity around...
  10. aridzv

    blockname lisp

    @jim78b for some reason when I finish with right click it dose restore the OSNAP. try restart autocad, open the drawing and load the lisp again.
  11. aridzv

    blockname lisp

    try the last code and finish the command with ENTER, not escape or right click. only ENTER.
  12. jim78b

    blockname lisp

    Ok thanks very much. But it happened i think during command running. If i turn off the osnap with f3.
  13. aridzv

    blockname lisp

    yap. with the code above you must use ENTER to exit the lisp and get OSNAP restored back...
  14. aridzv

    blockname lisp

    see attached code and video. EXIT WITH ENTER TO RESTORE OSNAP. (defun c:MLeaderWBlname( / osnp tm tagname ptms ss ensel obj obj1 ifobj nam) (setq osnp (getvar "OSMODE")) (setvar "OSMODE" 0) (setq tm (getvar "TILEMODE")) (setq ifobj 0) (princ "Select object in paper space,select start point of MLeader,exit with ENTER") (while (getpoint) ;;get point in paper space on the target object (if (= tm 0);if in paper space (progn (command "._MSPACE") (setq ptms (cadr (grread t)));;get the point where the cursor is on the target object in model space (if (=(setq ss (ssget ptms)) nil) ;;selction set of the object crossing the ptms point (progn (alert "There is no selection set please run again") (setq ifobj 0) (command "._PSPACE") );progn (progn (command "._PSPACE") (setq obj(ssname ss 0)) (setq ifobj 1) );progn );if );progn (progn ;in model space (setq ensel (entsel "\nSelect Block: ")) ;select the block object to copy (setq obj (car ensel)) ;set the block object to varaible (setq ifobj 1) );progn );if (if (= ifobj 1) ;; check if there is a selection set (progn (if (= (cdr (assoc 0 (entget obj))) "INSERT");; check if selected object is block (progn (setq obj1 (vlax-ename->vla-object obj)) (setq nam (vlax-get-property obj1 (if (vlax-property-available-p obj1 'effectivename) 'effectivename 'name ) ) ) (command "_mleader" "H" pause pause nam) (setq ifobj 0) );progn (alert "Not a Block") );if );progn (alert "Not a Block") );end if );end while (command "._PSPACE") (SETVAR "OSMODE" osnp) (princ) ) Screen Recording 2025-03-26 183108.mp4
  15. jim78b

    blockname lisp

    now work after restart autocad but sometimes the osnap reset all my settings
  16. aridzv

    blockname lisp

    you select an empty space
  17. jim78b

    blockname lisp

  18. aridzv

    blockname lisp

    try this code. it is with out error trap - it looks for errors by checking the selection set and the object properties: (defun c:MLeaderWBlname( / osnp tm tagname ptms ss ensel obj obj1 ifobj nam) (setq osnp (getvar "OSMODE")) (setvar "OSMODE" 0) (setq tm (getvar "TILEMODE")) (setq ifobj 0) (princ "Select object in paper space,select start point of MLeader,exit with esc'") (while (getpoint) ;;get point in paper space on the target object (if (= tm 0);if in paper space (progn (command "._MSPACE") (setq ptms (cadr (grread t)));;get the point where the cursor is on the target object in model space (if (=(setq ss (ssget ptms)) nil) ;;selction set of the object crossing the ptms point (progn (alert "There is no selection set please run again") (setq ifobj 0) (command "._PSPACE") );progn (progn (command "._PSPACE") (setq obj(ssname ss 0)) (setq ifobj 1) );progn );if );progn (progn ;in model space (setq ensel (entsel "\nSelect Block: ")) ;select the block object to copy (setq obj (car ensel)) ;set the block object to varaible (setq ifobj 1) );progn );if (if (= ifobj 1) ;; check if there is a selection set (progn (if (= (cdr (assoc 0 (entget obj))) "INSERT");; check if selected object is block (progn (setq obj1 (vlax-ename->vla-object obj)) (setq nam (vlax-get-property obj1 (if (vlax-property-available-p obj1 'effectivename) 'effectivename 'name ) ) ) (command "_mleader" "H" pause pause nam) (setq ifobj 0) );progn (progn (alert "Not a Block") );progn );if );progn (alert "Not a Block") );end if );end while (command "._PSPACE") (SETVAR "OSMODE" osnp) (princ) )
  19. jim78b

    blockname lisp

    SORRY THIS RESET MY OSNAPS!! AFTER I END TO USE THE CODE!
  20. aridzv

    blockname lisp

    use this (defun c:MLeaderWBlname( / *error* trap1 osnp tm tagname ptms ss ensel obj obj1 nam) (setq temperr *error*);store *error* (setq *error* trap1);re-assign *error* (setq osnp (getvar "OSMODE")) (setvar "OSMODE" 0) (setq tm (getvar "TILEMODE")) (princ "Select object in paper space,select start point of MLeader,exit with esc'") (while (getpoint) ;;get point in paper space on the target object (if (= tm 0);if in paper space (progn (command "._MSPACE") (setq ptms (cadr (grread t)));;get the point where the cursor is on the target object in model space (setq ss (ssget ptms));;selction set of the object crossing the ptms point (setq obj(ssname ss 0)) (command "._PSPACE") );progn (progn ;in model space (setq ensel (entsel "\nSelect Block: ")) ;select the block object to copy (setq obj (car ensel)) ;set the block object to varaible );progn );if (setq obj1 (vlax-ename->vla-object obj)) (setq nam (vlax-get-property obj1 (if (vlax-property-available-p obj1 'effectivename) 'effectivename 'name ) ) ) (command "_mleader" "H" pause pause nam) );end while (command "._PSPACE") (SETVAR "OSMODE" osnp) (princ) ) (defun trap1 (errmsg) (command-s "._PSPACE") ;<--- HERE (SETVAR "OSMODE" osnp) (princ) ) other way (the one I use) is this version: (defun c:MLeaderWBlname( / *error* osnp tm tagname ptms ss ensel obj obj1 nam) (defun *error* ( msg ) (command "._PSPACE") (setvar "OSMODE" osnp) (princ) ) (setq osnp (getvar "OSMODE")) (setvar "OSMODE" 0) (setq tm (getvar "TILEMODE")) (princ "Select object in paper space,select start point of MLeader,exit with esc'") (while (getpoint) ;;get point in paper space on the target object (if (= tm 0);if in paper space (progn (command "._MSPACE") (setq ptms (cadr (grread t)));;get the point where the cursor is on the target object in model space (setq ss (ssget ptms));;selction set of the object crossing the ptms point (setq obj(ssname ss 0)) (command "._PSPACE") );progn (progn ;in model space (setq ensel (entsel "\nSelect Block: ")) ;select the block object to copy (setq obj (car ensel)) ;set the block object to varaible );progn );if (setq obj1 (vlax-ename->vla-object obj)) (setq nam (vlax-get-property obj1 (if (vlax-property-available-p obj1 'effectivename) 'effectivename 'name ) ) ) (command "_mleader" "H" pause pause nam) );end while (command "._PSPACE") (SETVAR "OSMODE" osnp) (princ) ) damm lisp error traping...
  21. Steven P

    hatch when creating block

    It doesn't look like you are specifying pt or r in the (vla-addcircle line in the snip above, so it will be either 0,0 or a previous point named pt. Might also look at your entmakex attdef doesn't have a closing bracket ?
  22. Not sure if reactors are in LT
  23. Hi all, Its alive! For now, its 4 commands: BOUNDARY-FROM-ALL-BLOCKS This tool determines the corresponding boundary based on the centroids of all blocks. This layer is assigned the layer name of the block so that the material properties are also transferred. BOUNDARY-FROM-BLOCKS Same as the above, but the user selects a block manually. This gives more control over which blocks should or should not be used. BOUNDARY-MOST-COMMON The user selects a point within a surface, and the boundary is determined. Based on all detected contour lines, the ‘most common’ boundary line is used as the leading layer. BOUNDARY-VARIABLE The user selects a point within a surface, and the boundary is determined. Based on all detected contour lines, a selection list is generated, allowing the user to choose the desired layer. This provides a more controlled version of the ‘most common’ variant. ;;--------------------------------------------;; ;;--------------------------------------------;; (defun C:BOUNDARY-MOST-COMMON ( / *error* ) (defun *error* ( msg ) (LOCAL:RESTOREVARIABLES) (LOCAL:ENDUNDO (LOCAL:ACTIVEDOCUMENT)) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (progn (alert "Something went wrong!") (alert (strcat "Error: " msg)) ) ) (princ) ) (vl-load-com) (LOCAL:STARTUNDO (LOCAL:ACTIVEDOCUMENT)) (LOCAL:STOREVARIABLES '("CMDECHO" "OSMODE")) (setvar "CMDECHO" 0) (setvar "OSMODE" 0) (CREATEBOUNDARY 0 nil nil) (LOCAL:RESTOREVARIABLES) (LOCAL:ENDUNDO (LOCAL:ACTIVEDOCUMENT)) (princ) ) ;;--------------------------------------------;; ;;--------------------------------------------;; (defun C:BOUNDARY-VARIABLE ( / *error* ) (defun *error* ( msg ) (LOCAL:RESTOREVARIABLES) (LOCAL:ENDUNDO (LOCAL:ACTIVEDOCUMENT)) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (progn (alert "Something went wrong!") (alert (strcat "Error: " msg)) ) ) (princ) ) (vl-load-com) (LOCAL:STARTUNDO (LOCAL:ACTIVEDOCUMENT)) (LOCAL:STOREVARIABLES '("CMDECHO" "OSMODE")) (setvar "CMDECHO" 0) (setvar "OSMODE" 0) (CREATEBOUNDARY 1 nil nil) (LOCAL:RESTOREVARIABLES) (LOCAL:ENDUNDO (LOCAL:ACTIVEDOCUMENT)) (princ) ) ;;--------------------------------------------;; ;;--------------------------------------------;; (defun C:BOUNDARY-FROM-BLOCK ( / *error* en blockloc blocklay) (defun *error* ( msg ) (LOCAL:RESTOREVARIABLES) (LOCAL:ENDUNDO (LOCAL:ACTIVEDOCUMENT)) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (progn (alert "Something went wrong!") (alert (strcat "Error: " msg)) ) ) (princ) ) (vl-load-com) (LOCAL:STARTUNDO (LOCAL:ACTIVEDOCUMENT)) (LOCAL:STOREVARIABLES '("CMDECHO" "OSMODE")) (setvar "CMDECHO" 0) (setvar "OSMODE" 0) (while (not (and (setq en (entsel "\nSelecteer block... "))(= (cdr (assoc 0 (entget (car en)))) "INSERT")))) (if en (progn (setq blockloc (cdr (assoc 10 (entget (car en))))) (setq blocklay (cdr (assoc 8 (entget (car en))))) (CREATEBOUNDARY nil blockloc blocklay) ) ) (LOCAL:RESTOREVARIABLES) (LOCAL:ENDUNDO (LOCAL:ACTIVEDOCUMENT)) (princ) ) ;;--------------------------------------------;; ;;--------------------------------------------;; (defun C:BOUNDARY-FROM-ALL-BLOCKS ( / *error* en blockloc blocklay) (defun *error* ( msg ) (LOCAL:RESTOREVARIABLES) (LOCAL:ENDUNDO (LOCAL:ACTIVEDOCUMENT)) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (progn (alert "Something went wrong!") (alert (strcat "Error: " msg)) ) ) (princ) ) (vl-load-com) (LOCAL:STARTUNDO (LOCAL:ACTIVEDOCUMENT)) (LOCAL:STOREVARIABLES '("CMDECHO" "OSMODE")) (setvar "CMDECHO" 0) (setvar "OSMODE" 0) (setq selset (ssget "_X" (list (cons 0 "INSERT")))) (if selset (progn (setq counti 0) (repeat (sslength selset) (setq loopent (ssname selset counti)) (setq blockloc (cdr (assoc 10 (entget loopent)))) (setq blocklay (cdr (assoc 8 (entget loopent)))) (CREATEBOUNDARY nil blockloc blocklay) (setq counti (+ 1 counti)) ) ) ) (LOCAL:RESTOREVARIABLES) (LOCAL:ENDUNDO (LOCAL:ACTIVEDOCUMENT)) (princ) ) ;;--------------------------------------------;; ;;--------------------------------------------;; (defun CREATEBOUNDARY ( mode xyz lay / *error* pickedpoint oldosmode oldcmdecho saveent newent ss i ii objectsonmidpoints midensel midensellay layerlist newlayers newlayer resultvalue) (if (not xyz) (setq pickedpoint (getpoint "\nSpecify internal point: ")) (setq pickedpoint xyz) ) (command "CIRCLE" "0,0" "1") (setq saveent (entlast)) (command "-BOUNDARY" pickedpoint "") (setq newent (entlast)) (if (eq saveent newent) (progn ;(princ "\nFailed to create boundary!") ) (progn ;(princ "\nHurray!") (if lay (progn (command "ERASE" newent "") (command "-LAYER" "MAKE" (strcat lay "-GV") "COLOR" "6" "" "") (command "-BOUNDARY" pickedpoint "") ) (progn (command "EXPLODE" (entlast)) (setq ss (ssget "_P")) (if (not ss) (progn (princ "\nOm onbekende redenen is er iets misgegaan!") ) (progn (setq i 0) (repeat (sslength ss) (setq refensel (ssname ss i)) (setq refpoint (LOCAL:MIDOFOBJECT (ssname ss i))) (command "ERASE" refensel "") (setq objectsonmidpoints (ssget "_CP" (list (mapcar '+ refpoint (list -0.1 -0.1 0)) (mapcar '+ refpoint (list -0.1 0.1 0)) (mapcar '+ refpoint (list 0.1 0.1 0)) (mapcar '+ refpoint (list 0.1 -0.1 0))) (list (cons 0 "LINE,ARC,CIRCLE,LWPOLYLINE")(cons 8 "~*GV")))) (setq ii 0) (if objectsonmidpoints (progn (setq midensel (ssname objectsonmidpoints ii)) (setq midensellay (cdr (assoc 8 (entget midensel)))) (setq layerlist (cons midensellay layerlist)) (setq ii (+ 1 ii)) ) ) (setq i (+ 1 i)) ) (if layerlist (progn ;; MODE 0 zorgt dat er een keuzemenu komt als er geen 'meer voorkomende' layer is. ;; MODE 1 zorgt ervoor dat er altijd een keuze menu komt als er meer dan 1 layer gevonden is. (cond ((= mode 0) (setq newlayers (LOCAL:MOST-COMMON layerlist)) ) ((= mode 1) (setq newlayers (LM:Unique layerlist)) ) ((= mode 2) ;;;;; (setq newlayers (LM:Unique layerlist)) ) ) (if (= (length newlayers) 1) (progn (setq resultvalue (nth 0 newlayers)) (command "-LAYER" "MAKE" (strcat resultvalue "-GV") "COLOR" "6" "" "") (command "-BOUNDARY" pickedpoint "") ) (progn (BOUNDARYPICKLAYER newlayers) (if resultvalue (progn ;(alert (strcat "NEWBOUNDARY MET LAYER " resultvalue)) (command "-LAYER" "MAKE" (strcat resultvalue "-GV") "COLOR" "6" "" "") (command "-BOUNDARY" pickedpoint "") ) ) ) ) ) ) ) ) ) ) ) ) (command "ERASE" saveent "") ) ;;--------------------------------------------;; ;;--------------------------------------------;; (defun LM:CountItems ( l / c x ) (if (setq x (car l)) (progn (setq c (length l) l (vl-remove x (cdr l)) ) (cons (cons x (- c (length l))) (LM:CountItems l)) ) ) ) ;;--------------------------------------------;; ;;--------------------------------------------;; (defun LOCAL:MIDOFOBJECT ( object / ) (vlax-curve-getpointatparam object (/ (+ (vlax-curve-getstartparam object) (vlax-curve-getendparam object)) 2.0)) ) ;;--------------------------------------------;; ;;--------------------------------------------;; (defun LOCAL:MOST-COMMON (lst / unique counts max-val max-keys) (setq unique '() counts '()) (foreach item lst (if (not (member item unique)) (setq unique (cons item unique)) ) ) (foreach u unique (setq counts (cons (list u (apply '+ (mapcar '(lambda (x) (if (equal x u) 1 0)) lst))) counts)) ) (setq max-val 0 max-keys '()) (foreach item counts (cond ((> (cadr item) max-val) ;; Found a new highest count (setq max-val (cadr item) max-keys (list (car item)))) ((= (cadr item) max-val) ;; Found another with the same highest count (setq max-keys (cons (car item) max-keys)) ) ) ) max-keys ) ;;--------------------------------------------;; ;;--------------------------------------------;; (defun LM:Unique ( l ) (if l (cons (car l) (LM:Unique (vl-remove (car l) (cdr l))))) ) ;;--------------------------------------------;; ;;--------------------------------------------;; (defun BOUNDARYPICKLAYER ( newlayers / *error* dcl_content dcl_contentmiddle dcl_content2 dcl_filename dcl_id tabellen_options pickresult ) ;; DCL BOUWEN (setq dcl_content "picklist_dialog : dialog { label = \"Kies een layer voor de boundary\"; : column { ") (setq dcl_contentmiddle "") (setq dcl_contentmiddle (strcat dcl_contentmiddle ": row { : column { : text { label = \"Gevonden layers\"; key = \"Tabellen\"; } : popup_list { key = \"tabellen_list\"; width = 60; popup_list_height = 6; } } }")) (setq dcl_content2 "} : spacer {} : row { : button { label = \"OK\"; key = \"accept\"; is_default = true; } : button { label = \"Cancel\"; key = \"cancel\"; } } }") ;; Define the temporary DCL file path (setq dcl_filename (strcat (getvar "TEMPPREFIX") "picklist_temp.dcl")) ;; Create and write the DCL content to the temporary file (setq dcl_id (open dcl_filename "w")) (if dcl_id (progn (write-line (strcat dcl_content dcl_contentmiddle dcl_content2) dcl_id) (close dcl_id) ) (progn (princ "\nError: Unable to create temporary DCL file.") (exit) ) ) ;; Load the temporary DCL file (setq dcl_id (load_dialog dcl_filename)) (if (not (new_dialog "picklist_dialog" dcl_id)) (progn (princ "\nError: Unable to load dialog.") ;(exit) ) ) ;; Define picklist contents in LISP (setq tabellen_options newlayers) ;; Load the content of each picklist (start_list "tabellen_list") (mapcar 'add_list tabellen_options) (end_list) ;; Define actions for the dialog (action_tile "accept" "(progn (setq pickresult (nth (atoi (get_tile \"tabellen_list\")) (eval (read \"tabellen_options\")))) (done_dialog 1) )") (action_tile "cancel" "(progn (done_dialog 0) )") ;; Intercept the close button action (X button) (action_tile "close" "(progn (done_dialog 0) )") ;; Start the dialog (start_dialog) ;; Unload the dialog and delete the temporary DCL file (unload_dialog dcl_id) (vl-file-delete dcl_filename) (if (not pickresult) (progn (alert "Geen keuze gemaakt!") ) (progn (setq resultvalue pickresult) ) ) resultvalue ) ;;--------------------------------------------;; ;;--------------------------------------------;; (defun LOCAL:ACTIVEDOCUMENT ( / ) (vla-get-activedocument (vlax-get-acad-object)) ) ;;--------------------------------------------;; ;;--------------------------------------------;; (defun LOCAL:STARTUNDO ( doc / ) (LOCAL:ENDUNDO doc) (vla-startundomark doc) ) ;;--------------------------------------------;; ;;--------------------------------------------;; (defun LOCAL:ENDUNDO ( doc / ) (if (= 8 (logand 8 (getvar "UNDOCTL"))) (vla-endundomark doc) ) ) ;;--------------------------------------------;; ;;--------------------------------------------;; (defun LOCAL:STOREVARIABLES ( variables / ) (foreach x variables (setq storedvariables (cons (list x (getvar x)) storedvariables))) (if (lspICDIsEventToggleEnabled)(setq infracadenabled "T")(setq infracadenabled nil)) ) ;;--------------------------------------------;; ;;--------------------------------------------;; (defun LOCAL:RESTOREVARIABLES ( / ) (foreach x storedvariables (if (/= (car x) "")(setvar (car x)(cadr x)))) (setq storedvariables nil) (if infracadenabled (lspICDEnableEventToggle)(lspICDDisableEventToggle)) (setq infracadenabled nil) ) ;;--------------------------------------------;; ;;--------------------------------------------;; (princ) ;;--------------------------------------------;; ;;--------------------------------------------;;
  24. jim78b

    blockname lisp

    THE PROBLEM NOW IS that my osnaps every time reset!
  25. In AutoCAD, theoretically, yes. Save this code to a file and name it with the lsp extension. Type 'appload' in the command line, search for, select the file you created, and press the 'Load' button. After that, the file will be loaded. Then, modify DIMSTYLE from the command line: if you get a message... WIN! (if (not GL*react*) (setq GL*react* (vlr-sysvar-reactor nil '((:vlr-sysVarChanged . aviso)))) ) (defun aviso (e p / r) (if (eq (car p) "DIMSCALE") (alert (vl-list->string (reverse '(33 33 78 65 67 32 117 111 89 10 33 33 115 110 111 105 116 97 108 117 116 97 114 103 110 111 67)) ) ) ) )
  26. jim78b

    blockname lisp

    SO what code should i use? however ALWAYS the code reset my osnap!! is possible?
  1. Load more activity
×
×
  • Create New...