Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. GLAVCVS

    Find&open files

    (defun c:**r** nil (if averigua (progn (vlr-remove **a**) (setq **a** nil averigua nil) (princ "Open-file Command-line DEACTIVATED");"SensiCMD DESACTIVADO") ) (progn (setq **a** (vlr-command-reactor "***" '((:vlr-unknowncommand . averigua)))) (defun averigua (a b / c) (if (setq c (findfile (vl-string-subst "." "@" (car b)))) ;;; (decodifica c) (LM:open c) ) ) (princ "Open-file Command-line ACTIVATED");"SensiCMD ACTIVADO") ) ) (princ) ) Here you go. Copy this code into the acad*.lsp file where you save your custom lisps. Once loaded, you can enable or disable the included code by typing the **r** command. I assume you've downloaded Lee Mac's code (LM:open). It's perfect for what you need, so I've included a call to "LM:open," but you'll have to add the code for this function yourself. As for the **r** command, when the included code is enabled, anything you type on the command line that matches the name of a file found in any of AutoCAD's "SupportPaths," "LM:open" will open it with the default Windows application. To disable the code, just run **r** again. I hope it's useful
  3. Today
  4. if you want to copy a non-block object, it can be done by ncopy command. Using VLISP, can call nentsel and pick a nest object, you can directly get the nest object and transform matrix as Lee mentioned, then rebuild the nest object and apply the matrix to it to "extract" the nest object out.
  5. issammesk

    text field

    dear all these my problem every time i when modify station text must go for all text in red color and modified same station text so i think if i make afield for one to all text when modify in one text automatic change in all thanks again i applodt file for one of these dwg1FIELD-TEXT.dwg1FIELD-TEXT.dwg
  6. Steven P

    Find in Notepad

    Thanks Jerry and BigAl, The main use I have for this one is when I want to edit a LISP file - pop up dialogue to select the routine, open the file in notepad, 'Find' which usually takes me to the LISP name in the file. The find dialogue all happens without me needing to press any buttons. BIgAl - handy but in this case I know the file name and location to go straight to it - handy later in life if I don't know what file I want though, thanks MHUPP - going to look into that this morning, saving the answer into my "make windows work right" file Undoing the alias as in the link was the trick (Start Menu - settings - Apps - Advanced App Settings - Alias), pinned the proper notepad to the task bar (not the new one, located in c:\windows\notepad.exe or c:\windows\system32\notepad32.exe), now to set the proper notepad as the default as it should be.
  7. PGia

    Find&open files

    Hello again, GLAVCVS. I don't want to sound impatient , but it seems like no one knows about the option you're talking about. Could you share it? Thanks in advance.
  8. BIGAL

    Find in Notepad

    Maybe have a look at the windows command findstr it will search a directory for a key word, I guess could open one at a time. findstr d2 d:/mylisps/*.lsp may be useful how I find old posts
  9. mhupp

    Find in Notepad

    in windows 11 they have two notepads now. think you will have to remove the app one to go back to the classic one. https://www.dedoimedo.com/computers/windows-11-notepad-classic.html
  10. Yesterday
  11. Nice, I was thinking AcFdFieldReactor because it has all those plus REGEN, but it’s not available to lisp. You might add REGEN to the list, so the user can see the updated values without needing to save or plot.
  12. JerryFiedler

    Find in Notepad

    @Steven P Your function seems to work for me although I am not sure what you expect. I am using Windows 11 and BricsCAD Pro V25. When I run my test program which calls your routine: NotePad++ is opened with the test data file, the specified text is highlighted and the text is in the "find" dialog box. ( I had to click the binocular icon as the find dialog did not open on its own.) Are you expecting the "find" dialog box to open automatically? testdata.txt testNF.lsp
  13. Here's a proof-of-concept example for consideration - (defun update-attributes ( / bln idx ins map obj sel tag val ) (setq ;; List of ;; ((lower-left point) (upper-right point) "attribute value") map '( (( 0.0 0.0) (10.0 10.0) "abc") ((20.0 20.0) (30.0 30.0) "def") ) ;; Block name bln "YourBlock" tag "YourTag" ) (setq bln (strcase bln) tag (strcase tag) ) (if (setq sel (ssget "_X" (list '(0 . "INSERT") '(66 . 1) (cons 2 (strcat "`*U*," bln))))) (repeat (setq idx (sslength sel)) (setq idx (1- idx) obj (vlax-ename->vla-object (ssname sel idx)) ) (cond ( (/= bln (strcase (vlax-get-property obj (if (vlax-property-available-p obj 'effectivename) 'effectivename 'name))))) ( (setq ins (vlax-get obj 'insertionpoint) val (vl-some '(lambda ( itm ) (if (vl-every '<= (car itm) ins (cadr itm)) (caddr itm))) map) ) (vl-some '(lambda ( att ) (if (= tag (strcase (vla-get-tagstring att))) (progn (if (vlax-write-enabled-p att) (vla-put-textstring att val) ) t ) ) ) (vlax-invoke obj 'getattributes) ) ) ) ) ) ) (defun block-position-callback ( rtr arg ) (if (and arg (wcmatch (strcase (car arg) t) "qsave,save,saveas,plot,publish")) (update-attributes) ) (princ) ) ( (lambda ( key ) (vl-load-com) (foreach rtr (cdar (vlr-reactors :vlr-command-reactor)) (if (= key (vlr-data rtr)) (vlr-remove rtr) ) ) (vlr-set-notification (vlr-command-reactor key '( (:vlr-commandwillstart . block-position-callback) ) ) 'active-document-only ) (update-attributes) (princ) ) "block-position-reactor" ) There is no command to run the program: simply amend the block name, tag name, and map at the top of the code to suit your setup, and then load the program - the attributes will be automatically updated when the drawing is saved or plotted.
  14. Probably a better idea. I have been looking into the object reactors and it was seeming like it was going to bog down the drawing immensely, since we will have dozens of these blocks in a single file. Thanks!
  15. I would suggest using a single command reactor to automatically update all blocks on save or plot - this is far simpler than using an object reactor to track modifications to each individual block reference.
  16. The issue is CAD literacy within the office. One of my engineers would be fine to use it, but the rest are fairly CAD illiterate. I try to keep things as simple as possible (I know running a lisp command is simple to begin with)
  17. Steven P

    Find in Notepad

    Good Morning, I have been using this to search for text in a text file, now I have been upgraded to windows 11 it doesn't work, and I can't work out what change to make. Looking for some guidance again, thanks! fnm: File name (including filepath) str: Text String delay: a delay, say 1000 mS Will open notepad and should perform a 'find' to jump to the text. It gets as far as 'find' to open the dialogue box but won't populate it or hit 'enter' to do the find, using sendkeys - which has always worked before. thanks for any help ;;To find text within a text file. ;;http://www.cadtutor.net/forum/showthread.php?102326-Open-text-file-and-jumping-to-a-line&p=694572#post694572 ; example command to call it (NotepadFind "C:\\Downloads\\test 123.txt" "findtext" 300) (defun NotepadFind (fnm str delay / obj) (vl-catch-all-apply (function (lambda () (setq obj (vlax-get-or-create-object "WScript.Shell")) (vlax-invoke obj 'Run (strcat "Notepad.exe \"" fnm "\"")) ;; or notepad++ if that is used. (setvar 'cmdecho 0) (command "_.delay" delay) ; Milliseconds. For BricsCAD users: (sleep delay) does not work. (setvar 'cmdecho 1) (vlax-invoke obj 'AppActivate "Notepad++") ; Title bar name of application. ++ for notepad++ but still works? (vlax-invoke obj 'SendKeys (strcat "^f" str "{ENTER}{ESC}")) ) ) ) (if obj (vlax-release-object obj)) )
  18. Camera command does 90% what your asking idk if it says layer states tho.
  19. Last week
  20. Hello Is it possible to create a camera view in a drawing that captures what is currently visible, using a LISP command instantly? For example, when I rotate a 3D object and want to take a "screenshot" of that specific view. The proposed idea is to create permanent camera icons (or similar markers) in the drawing, allowing me to click on them to instantly switch to the saved viewing position as it was captured to review area. Thank you!
  21. Start with the profiles on the vertical back plane (XZ world) then extrude. Add consruction lines to define regions. Extrude regions, substract cylinders and union it all together.
  22. Hi Bigal, Curious if had any questions.. if my description was clear. Thanks for looking into this.
  23. @cmc1212 did you ever get help I know I’m here like 9 months after your post it I’m stuck and getting desperate
  24. Reading this one, what is the objection to the engineers running a LISP? You could add it as a button, in the ribbon, or as a command to suit their preferences, and if you make it easier for them they'll use it. For example a single command to draw the rectangle and insert the block instead of 3 or 4 commands makes things quicker and easier, the engineers should jump on that (every speed improvement is after all another few seconds to go and make another coffee!)
  25. Properties 4,5,6 I can’t seem to get the right sizes or anything I saw your 2012 forum and thanks that helped me get to this point but I’m stuck now
  26. If you use a reactor it is a lisp anyway and has to be ran every time you add the block, so as I suggested much easier to do a lisp that looks at the XY point and updates, a lisp will run through multiple blocks very fast and update all. Just make the lisp insert the block 1st.
  27. PGia

    Find&open files

    That seems very interesting!
  28. GLAVCVS

    Find&open files

    @PGia In case you don't mind including all the file locations you need to reference in AutoCAD's "SupportPaths" (other external paths could also be considered, but would require more code), there is another option, unorthodox but disruptive: type the name of the file to open directly into the command line (but with a small convention) I think some of the participants in this thread know what I'm talking about. If not, I'll explain it with a little code when I get home.
  29. Don't create a new reactor for every object - this is likely to severely impact performance - only one object reactor is required with a set of owning objects. Aside, you're missing the definition for your (let*) function.
  1. Load more activity
×
×
  • Create New...