Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/26/2022 in all areas

  1. Ingenuity and Stupidity are flipsides of a single coin...AKA life. The more you know, the more you realize you don't know. Perfection is an unattainable aspiration. A commendable goal? Hell yes! Live and learn. Enjoy the ride.
    3 points
  2. Following Steven P's code, I've achieved what I wanted, maybe it can be more efficient but won't deal with that right now. Thank you all so much.
    2 points
  3. need to run the save command either in ZA or the script "_.qsave" "_.close"
    2 points
  4. Where I used to work we would get final year students and employ for 12 weeks this was a requirement to get there degree, work experience. Most had a exposure to Autocad, so knew the basics. we would get them to do projects where they copied another issued plan for the detail required, involving them also in what and why they were drawing. The would soak up the experience learning rapidly, I am happy to say as far as I know all were employed shortly after as employers knew they had been overseen and trained well ensuring quality output. They also had the extra value of field experience going out to project sites, assisting the project engineer. So Keithm you can get software generally for a month as a trial, if your a school student you can get Autocad for 12 months. So spend the time learning, in you other time like ReMark think about what industry you want to work in, go knock on doors and ask for a job, you may be surprised who is looking for a junior.
    2 points
  5. @mhuppWhat have you against local variables? Yeah, I thought this would be simple enough to do, well it turned out simple and a small piece of code but I couldn't see any help on the multiple command for LISP anywhere. Perhaps others can use this in the future for other things.
    1 point
  6. Yeah its kinda strange that (command "_.Multiple") returns nil Was going to see if a keybinding in CUI was going to do the trick but this works well. little tweak (defun c:foofighters () (vla-SendCommand (vla-get-ActiveDocument (vlax-get-acad-object)) "MULTIPLE STRETCH ") )
    1 point
  7. This seems to work.. (vl-load-com) (defun c:foofighters (/ actDoc) (setq actDoc (vla-get-ActiveDocument (vlax-get-acad-object))) (vla-SendCommand actDoc (strcat "MULTIPLE STRETCH ")) ) (c:foofighters)
    1 point
  8. (defun c:foo ( / done ) (while (not (setq done (acet-sys-lmouse-down))) (vl-cmdf "_.STRETCH") (while (< 0 (getvar 'cmdactive)) (vl-cmdf "\\") ) (prompt "\nLeft click to FINISH...") ) (princ) )
    1 point
  9. This is what i use to copy text to another text. tho it doesn't allow you to select multiple to copy. https://autocadtips1.com/2012/02/27/autolisp-copy-text-to-table-cells/
    1 point
  10. Here is mine. uses getfile to allow user to select the folder they want to process. ;;----------------------------------------------------------------------------;; ;; Make script file for drawings in a folder (defun c:MakeScript (/ Path UserFile blkLst F FileName) (vl-load-com) (setq UserFile (getfiled "Choose a Folder to Process" (getvar 'DWGPREFIX) "*" 16) Path (vl-filename-directory UserFile) blkLst (vl-directory-files Path "*.dwg" 1) ;add all dwg files to list blkLst (append blkLst (vl-directory-files Path "*.dxf" 1)) ;add all dxf files to list blkLst (vl-remove (getvar 'DWGNAME) blkLst) ;if current file is in folder remove from list blkLst (vl-sort blkLst '<) F (open (strcat (getenv "userprofile") "\\Documents\\Script.scr") "w") ) (if blkLst (progn (foreach FileName blkLst (write-line (strcat "_.Open \"" Path "\\" FileName "\"") F) (write-line " commands here " F) (write-line "_.qsave" F) (write-line "_.close" F) ) ) (prompt "\nNo Drawings Found in Folder") ) (close F) (prompt (strcat "\nScript File for " (itoa (length BlkLst)) " File(s) Created")) ;(vl-cmdf "_.Script" (strcat (getenv "userprofile") "\\Documents\\Script.scr")) ;uncomment if you want to run right away (princ) )
    1 point
  11. Whoops - Not doing so well here!! Yes, it should be like that
    1 point
  12. I though the (write-line "_.CLOSE" f) and (write-line "n" f) should do that, however a good point to note, always worth double checking and no harm in a double save! (in my defence we have a 'wonderful' file management system that doesn't like qsave, I have a lisp 'asave' - does the same thing - which I'd taken out above)
    1 point
  13. Thanks again. I'm trying to get the grasp of scripts right now but I'm failing to save the changes. I've saved the simple function (c:za) as a .lsp file and have it loaded for each drawing opened (through Startup Suite). In a new lsp file a have this simple code, copied from you (setq batchfileslist (list (strcat "C:\\Users\\RecPC\\Desktop\\transmit\\"(getvar "dwgname")))) ;;i only need one single file that will be saved to a ;;standard directory each time ;;Create and open script file ;;I've left foreach loop untouched, even if I only need one iteration (setq acount 0) ;; a counter (setq tempscript (strcat (getvar "TEMPPREFIX") "tempbatchscrpt.scr")) ;;temp script file (setq f (open tempscript "w")) ;;open file (foreach n batchfileslist (progn (write-line (strcat "_.OPEN \"" (nth acount batchfileslist) "\"") f) ;;open the drawing ;;(c:za) ;;This is just a LISP for example, "ZA", see above (write-line "(c:za)" f) ;;shouldn't this be like it? within write-line command? (write-line "_.CLOSE" f) ;;close the drawing (write-line "n" f) ;;'n' to save the drawing (change this about later) ) ;(setq acount (+ 1 acount)) ) (close f) (command "_.SCRIPT" tempscript) ;;run script After running the last command, the drawing B opens, function (c:za) is being executed but the effect isn't saved. I try to manually open drawing B after all that, and it seems that no change was ever made. Am I missing something here? Probably yes :p. EDIT: Found my mistake. I wasn't writing "(c:za)" to script file.
    1 point
  14. I guess my most recent brain fart was trying to make a lisp that would extend an both sides of the arc to the closest quadrant point. was about 80-100 lines of figuring out were the start and end angles where and if they needed to be extended or not. Scrapped it all to 6 lines of code that pull the center point and radius then delete the arc and create a circle in its place.
    1 point
  15. A belated welcome to the forum Keithm. I love doing Cad, started using it when I was 58, and still love using it. Enjoy the learning curve and limitlessness of its potential. There is ALWAYS more to learn, for those who appreciate a challenge. Once you access AutoCad, the mycadsite.com is a very good way to get started self teaching. Within a couple days to a week, depending on your appetite and curiousity, you will be well on your way to learning the ropes of the software and essential commands and functionality.
    1 point
  16. If you have the lisp already saved on hard disk then you can load inside the script, avoids the problem of if not autoloaded. (c:za) ;;This is just a LISP for example, "ZA", see above (if (not za)(load "myZA.lsp")) (c:za)
    1 point
  17. The amount of times solved a big problem at 20 minutes, then a rewrite now 6 minutes, then a dumfounded why did I not do this, now 50 seconds. We are talking processing thousands of objects.
    1 point
  18. ReMark is the only reason Penn Foster is still in business, as he so clearly exhibits his willingness to respond to, and help their students. So much so that the indifferent "instructors" for Penn Foster routinely just refer students with questions (if they respond at all?) to the numerous Penn Foster threads on this forum, knowing that if ReMark hasn't already posted answers, he soon will, in a very timely and well informed manner.
    1 point
  19. Your basic math skills would be sufficient to get a job as an AutoCAD technician. If hired you would most likely start as an entry level computer aided draftsman and would be tasked with working off of sketches, redlines, or even basic CAD drawings done by an engineer to flesh out a concept/design. But as you point out much depends on what discipline you find yourself employed in. Do you have some idea, at this time, what particular field you might like to eventually work in? Some options are civil, structural, architectural, electrical, mechanical, hydro-geological, chemical, marine, environmental and industrial to name a few. Regarding Penn-Foster AutoCAD course. You'll get the basics by way of creating a subdivision layout, an industrial building, an electrical schematic, and such. They have recycled the same drawings for years without adding much in the way of new content. Their instructors are said to be mostly indifferent to their students often going days before answering a question if they answer at all. But there are a few people who have reported back that after completing the certificate course they were able to land a job.
    1 point
  20. Thank you very much! works perfectly with this version too! Satisfy my curiosity...What does foo mean? Hello!
    1 point
  21. Plain LISP will work only on the window that starts it. When you move the focus to another drawing, then that LISP doesn't move with you, so open drawing 2, you can't keep running LISP from drawing 1 in it. You can however look at script processes, Lee Mac and others have script editors, and you can look at that. So you start a script via drawing 1, but it is then the script that is running and not a LISP in drawing 1. This lets you shift between drawings, open, save and close them as required. So have a look at Lee Mac script editor or scriptpro, see if they will get you what you want
    1 point
×
×
  • Create New...