Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. 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
  3. 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.
  4. Today
  5. 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!
  6. 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.
  7. 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)
  8. 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)) )
  9. Camera command does 90% what your asking idk if it says layer states tho.
  10. Yesterday
  11. 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!
  12. 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.
  13. Hi Bigal, Curious if had any questions.. if my description was clear. Thanks for looking into this.
  14. @cmc1212 did you ever get help I know I’m here like 9 months after your post it I’m stuck and getting desperate
  15. 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!)
  16. 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
  17. Last week
  18. 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.
  19. PGia

    Find&open files

    That seems very interesting!
  20. 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.
  21. 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.
  22. Lee Mac

    Find&open files

    I would also vote for Everything - it's ridiculously fast.
  23. Try Overkill
  24. My thought exactly. It looks like an Impossible Object.
  25. BIGAL

    Find&open files

    I use Everything all the time it indexes hard drives and finds a file instantly. Re Access, Word, Excel and Libre office all of these can be accessed from CAD I use Bricscad. You can for say Access not only open but actually get at the data, most common being Excel get and put. If you have a few known files you want to open all the time can either make a defun for each and load on startup or my preferred would be a sub menu in a POP menu with the file names as the description. As mentioned already using notepad is shown how in ACAD.PGP as an already defined option.
  26. rlx

    Find&open files

    I did write something once to find and launch documents but its a little over the top probably. But Bigal also had a good suggestion , a program called everything.
  27. PGia

    Find&open files

    Thanks to RLX for recommending Lee Mac's code (Lee Mac: thanks for sharing it) I just figured out how it works, and I think it's pretty close to what I need I guess I should create a command to run that code whenever I need it.
  28. PGia

    Find&open files

    Thanks for the answers. They're really very interesting. And I really liked @Steven P's Lisp for searching on Google In response to Ciberangel, I must say that I often need to edit acad.lsp and other AutoCAD support files, and I really feel like I'm wasting a lot of time doing that. Additionally, I almost always need to open Access databases that contain information related to the drawings I manage. I also manage photo banks with standardized names that I need to reference on the fly in my drawings. For these reasons, a tool to search and open these files will save me a lot of time.
  29. mhupp

    Find&open files

    Didn't have the exe in the startapp line so maybe thats why?
  1. Load more activity
×
×
  • Create New...