Jump to content

All Activity

This stream auto-updates

  1. Today
  2. 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.
  3. 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.
  4. mhupp

    Find&open files

    Didn't have the exe in the startapp line so maybe thats why?
  5. Steven P

    Find&open files

    Didn't quite work for me - opened explorer and went to a folder - not sure why yet ... actually, take away the '/watch?v....." and it works, probably just your dodgy youtube viewing habits..
  6. mhupp

    Find&open files

    @Steven P See what this does. again will use default browser. (startapp "explorer.exe" "https://www.youtube.com/watch?v=dQw4w9WgXcQ") So above can be (defun c:GetGoogle ( / Search Page) (setq Search (getstring "Enter Serch Term: [use '+' between terms] ")) ;; get search term, '+' between words (setq Page (strcat "https://www.google.com/search?q=" Search)) ;; google + search term address (startapp "explorer.exe" page) ) -edit didn't have the exe
  7. I've never worked with reactors. I'll have to dig into it. Thanks!
  8. rlx

    Find&open files

    actually quite nice Steven , think I'm gonna add this to one of my toolbars (if there's still room that is...) for opening things I also like : https://lee-mac.com/open.html
  9. Steven P

    Find&open files

    also shell commands - I've only used that once though: (defun c:GetGoogle ( / SearchTerm PageBase) (setq SearchTerm (getstring "Enter Serch Term: [use '+' between terms] ")) ;; get search term, '+' between words (setq PageBase "(command \"shell\" \"start microsoft-edge:http://google.com/search?q=") ;; google address (setq Page (strcat PageBase SearchTerm "\")" )) ;; google + search term address (eval (read Page)) ;; open 'Page' ) Guess what this does....
  10. Steven P

    Find&open files

    This will search a location for a file type, in the example searching for LISP files in c:\MyLocation\Here - remember to use a double backslash in any location, and return a list of files names + extensions (also folders if the file type is *.*). (setq myfiles (vl-directory-files "C:\\MyLocation\\Here" "*.lsp" nil)) You could do a search of this list to check if your required file is in there As MHUPP use startapp to open the file, here opens the file in variable Lispfile with notepad (startapp "notepad" Lispfile) MHUPP example was for explorer - I didn't know that method would work for any file type to open the default programme. For the first line here, your file path could be contained in a list, looping through each list item (location) until you find the file you want - could search a few locations if you knew them and want to hardcode them in the LISP, and if fails to find them there use MHUPPs 'getfiled' line for the user to select a folder or file. Use an if, cond or while loop to open the file where it finds it and stop the rest of the loop from looping
  11. Have you looked into reactors to trigger the lisp? Never really used them didn't like the fact something is running without me knowing/realizing it. (defun block-modified-callback (reactor obj) (let* ( (ent (vlr-object-reactor-object reactor)) (pos (cdr (assoc 10 (entget ent)))) ) ;; Define your target area (example: lower-left (0,0), upper-right (10,10)) (if (and (>= (car pos) 0) (<= (car pos) 10) (>= (cadr pos) 0) (<= (cadr pos) 10) ) (princ "\nBlock moved into target area!") ;call lisp ? (princ "\nBlock moved outside target area.") ; ) ) ) (defun C:BlockReact ( / ss i ent obj) (setq ss (ssget "_X" '((0 . "INSERT")))) ;maybe limit to the blocks you want to update (if ss (progn (setq i 0) (while (< i (sslength ss)) (setq ent (ssname ss i)) (setq obj (vlr-object-reactor (vlax-ename->vla-object ent) nil '((:vlr-modified . block-modified-callback)))) (setq i (1+ i)) ) (princ "\nReactors attached to block references.") ) (princ "\nNo blocks found.") ) (princ) ) -Edit Would have to run this after ever copy or insert of a block to add a reactor to it. and i don't know how this affect the performance of the drawing.
  12. mhupp

    Find&open files

    Had a command DIR to start in the folder of the active drawing would open the save prompt like window to allow you to select the file you want. pretty sure if you feed the path to explorer it will use the default program to open the file. (defun C:DIR ( / filePath) (setq dwgPath (getvar "DWGPREFIX")) (setq filePath (getfiled "Select a File to Open" dwgPath "*" 0)) ;limit what types you see by changing "*" (if filePath (progn (startapp "explorer.exe" filePath) (princ (strcat "\nOpening: " filePath)) ) (princ "\nNo file selected.") ) (princ) ) -edit You can also hard code where it stats in like if your documents are in a network drive. (setq filePath (getfiled "Select a Spec File" "C:\\Project\\spec\\" "PDF" 0)) ;look in spec folder for all pdf's
  13. CyberAngel

    Find&open files

    If it's not exclusively AutoCAD files, you may be better off using a system tool. What kinds of files would you be looking for? What parameters would you be searching with? What editors would you be opening them with? The more you can tell us, the better we can help you.
  14. There is not enough information to draw a complete object. What is that line on the other side of the rectangular hole? Where does it start and end? Where are the other edges of that surface? What are the dimensions for the ridge next to the ring, and how does it fit into the opposite side? Where does the flange on the left end? What is going on with that rectangular panel on the right? The whole thing looks like it was designed by M.C. Escher. Wait, I'm looking at it inside out as well as upside down. Your best bet may be to start with the rear face (which we can't see). Draw the two uneven sides separately and extrude them. Draw the rectangular side (with two holes) and extrude that along the Z (?) axis. In other words, separate the task into the four faces and pull them in their own directions.
  15. Hello again A quick question (I assume this will be an easy answer for the experts on this forum): I often need to search for and open various types of files, primarily in AutoCAD directories but also in others. Is there a quick way to search for and open any file in an editor using a custom Lisp command? Thanks in advance
  16. Another... https://forums.augi.com/showthread.php?170434-MText-width-set-to-zero&s=8d83700e43971c18c05d195f56cd176a&p=1330953&viewfull=1#post1330953
  17. set the scale to 0.001 then work from there
  18. SLW210

    field text

    That's not a .dwg. Is the original text and the desired results always the same lengths? Is it TEXT or MTEXT? Is the SCALE 1:1000 part of the TEXT/MTEXT? Is the DRAWING TITLE an attribute, TEXT or MTEXT? You could help a lot posting a .dwg.
  19. Nothing I can think of that’s built in, so you would have to roll something. With lisp, you would use an event to update the attributes, i.e. attached to regen There’s more options with ARX, .NET or Python - Create your own custom field - Create an Overrule that updates the attributes on close
  20. Bogging down? Why would it be bogged down? And you think this is simpler than just placing the LISP file in a specific folder without needing to add (load "My lisp") to your one LISP file?
  21. I can't figure out how to draw the 3d model shown in the image sent. It is fig 15.47 shown upside down.
  22. I probably can not help, but post a sample dwg so others can look at it.
  23. Yeah, I can easily do a lisp but I don't want to have my engineers have to run a lisp every time for this workflow. I'm trying to have detail numbers auto populate based on where the detail title is located. So if the detail title attribute is in a specific area of model space, it will always be 1/S3.0, etc
  24. So if understand correctly you want to place a field value which says "This is inside area1 " You can certainly do as a lisp updating a value but not as a field. Not sure if you can do a COND in a field expression say looking at a multiple XY points.
  25. I'm attempting to make a block with an attribute/field that when placed inside a pre-defined set of 4 coordinates (rectangle), the attribute field will update with a custom message. Anyone have any guidance with this? I'm guessing it will need a diesel expression, which I'm not all that familiar with. I'm hoping this is the right forum since it involves coding an expression Thanks
  26. Yesterday
  27. I'll investigate. Any suggestions?
  1. Load more activity
×
×
  • Create New...