Jump to content

Search the Community

Showing results for tags 'lisp'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions

Categories

  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

  1. Hey everyone. Could use a little assistance here. Not sure if this is even possible, but I assume it should be. I'm still in the "i know enough LISP just to be dangerous, but slightly useful" stage I have a LISP routine that collects 5 variables from the user (r1,r2,r3,r4,r5). (setq r1 (getint "\nEnter First Rev Line Number use ZERO for NONE: ")) (setq r2 (getint "\nEnter Second Rev Line Number use ZERO for NONE: ")) (if (= r2 0)(setq r3 0)(setq r3 (getint "\nEnter Third Rev Line Number use ZERO for NONE: "))) (if (= r3 0)(setq r4 0)(setq r4 (getint "\nEnter Fourth Rev Line Number use ZERO for NONE: "))) (if (= r4 0)(setq r5 0)(setq r5 (getint "\nEnter Fifth Rev Line Number use ZERO for NONE: "))) What I would like to do with them, is sort them by their values, putting the highest value first, then sorting in reverse. Can anyone offer any insight on this? Thank you in advance!
  2. Is there anybody who can tell me where can I find information about ALL VLA-... COMMANDS. It's a disaster not to be able to find any information on the help of AutoCAD 2006 and some others about it. Normally it would be possible to run a routine, script, lisp or whatever within AutoCAD and get a result, but it is really an act of faith not to find a-n-y information about it on the help from the program. I would like to know what it's possible and not to do through a lisp routine. Thanks in advance
  3. Hello all! I am new to this forum, so please forgive me if I ask stupid questions or simply don't make sense My work requires me to create programs for our CNC router. It is done in AutoCAD 2008. To help making programs faster I've created series of dynamic blocks. I am attaching a file with one of those blocks. The file is actually illustrating what I need to do number of times a day. I would like to make the process even faster and more fool-proof. The "old way" in file shows what my current way of creating programs. The "new way" is my attempt to make it faster. My problem is automatically dividing a line in dynamic block into a variable number of segments that are always equal. Naturally I use divide command after I stretch and explode my dynamic block. It would be much faster if the block would be able to do it all by itself. My attempt of solving this was to use Visibility Parameter. However, if you look closely at it, you'll notice that if I want to do it for all the possible combinations it will be extremely complicated and easy to mess up. If only there was a way to have two visibility parameters. Then I'd make one for horizontal holes and another for vertical. Unfortunately I can't. Does anyone have an idea how to accomplish this? LISP, maybe? Unfortunately, I don't know LISP, although I'd love to learn. I'm a pretty fast learner (I've pretty much taught myself how to make dynamic blocks using only AutoCAD help file). So if you guys know a good guide to start learning LISP, let me know. Thanks in advance for all the help. Cheers! Auto hole spacing.dwg
  4. Hello everyone! I would like some help with a lisp that draws lines from multiple starting points to multiple endingpoints. It would be beneficial if lines did not intersect, and if lines were drawn in 45 angles. I will attach a drawing example of what i want. I never made a lisp before so i dont know how hard this is. I know some scripting (autohotkeys). Nice to find this forum. Hope you can help me / direct me. I am willing to learn. Best regards /T example.dwg example.dwg
  5. Hi All, I need some help i have three lisp routines that i would like to combine into one routine. they all use the same objects to get their results so i was wondering if there was a way to combine them together. the order of would be as follows: 1. olo (Offset Polylines) 2. exl (Extrusion Lengths) the only that i see with this one is that it requires use input for placement, i would for it to place the results to the outside of lines. run the lisp routine by creating a rectangle exploded to see what it does. 3. pte (Panel Tab Extension) They all run perfectly by themselves, but im just trying to speed up the process. Here are the codes that i'm using. any help would be appreciated. Thanks, Brian ;| OFFSET POLYLINES [email="mfuccaro@hotmail.com"]mfuccaro@hotmail.com[/email] September 2003 |; (defun c:olo( / plines ; selection set of polylines ext ; extrnal point dist ; distance to offset poly ; a polyline from plines plist ; the list of poly del ; polyline to delete int ; internal point i) (command "undo" "begin") (princ "select polylines") (setq plines (ssget) i 0 ext (getvar "limmax") dist (getdist (strcat "distance <" (if olddist (rtos olddist) ;use old value as default "") ">"))) (if (not dist) (setq dist olddist)) ;reuse old distance if user press <Enter> (repeat (sslength plines) (setq poly (ssname plines i)) (setq plist (entget poly)) (command "offset" dist poly ext "") (setq del (entlast) int (polar (cdr (assoc 10 (entget del))) (angle (cdr (assoc 10 (entget del))) (cdr (assoc 10 plist))) (* 2 (distance (cdr (assoc 10 plist)) (cdr (assoc 10 (entget del))))))) (command "offset" dist poly int "") (command "_.change" (entlast) "" "_p" "_la" (getvar 'clayer) "") (entdel del) (setq i (1+ i))) (command "undo" "end") (setq olddist dist) ;preserve current distance for next run (princ) ) ;Extrusion Length (defun c:EXTL (/ cEnt tStr tBox tHgt tWid gr sPt cPt lAng bPt tPt pt1 pt2 pt3 pt4) (vl-load-com) (if (and (setq cEnt (car (entsel "\nSelect Object: "))) (member (cdr (assoc 0 (entget cEnt))) '("LWPOLYLINE" "POLYLINE" "LINE"))) (progn (setq tStr (strcat "1@" (rtos (- (vla-get-length (vlax-ename->vla-object cEnt)) 4.0)) (strcat "''")) tBox (textbox (list (cons 1 tStr) (cons 40 (getvar "TEXTSIZE")))) tHgt (- (cadadr tBox) (cadar tBox)) twid (- (caadr tBox) (caar tBox))) (princ "\nPosition Text...") (while (eq 5 (car (setq gr (grread t 5 0)))) (redraw) (if (listp (setq sPt (cadr gr))) (progn (setq cPt (vlax-curve-getClosestPointto cEnt sPt) lAng (angle cPt sPt) bpt (polar cPt lAng (/ (getvar "TEXTSIZE") 2.)) tpt (polar bpt lAng tHgt) mPt (polar bPt lAng (/ tHgt 2.)) pt1 (polar bpt (+ lAng (/ pi 2.)) (/ tWid 2.)) pt2 (polar bPt (- lAng (/ pi 2.)) (/ tWid 2.)) pt3 (polar tpt (+ lAng (/ pi 2.)) (/ tWid 2.)) pt4 (polar tPt (- lAng (/ pi 2.)) (/ tWid 2.))) (grvecs (list -3 pt1 pt2 pt3 pt4 pt1 pt3 pt2 pt4))))) (if (eq 3 (car gr)) (progn (setq lAng (- lAng (/ pi 2.))) (cond ((and (> lAng (/ pi 2)) (<= lAng pi)) (setq lAng (- lAng pi))) ((and (> lAng pi) (<= lAng (/ (* 3 pi) 2))) (setq lAng (+ lAng pi)))) (Make_Text mPt tStr lAng)))) (princ "\n<!> Incorrect Selection <!>")) (redraw) (princ)) (defun Make_Text (pt val rot) (entmake (list (cons 0 "TEXT") (cons 8 (getvar "CLAYER")) (cons 62 1) (cons 10 pt) (cons 40 (getvar "TEXTSIZE")) (cons 1 val) (cons 50 rot) (cons 7 (getvar "TEXTSTYLE")) (cons 71 0) (cons 72 1) (cons 73 2) (cons 11 pt)))) ;;; PANEL TAB EXTENSIONS (defun c:PTE(/ lSet actDoc lDel doMode objLst) (vl-load-com) (princ "\n>>> Select lines to extend/reduce <<< ") (if (and (setq lSet (ssget '((0 . "LINE")))); (setq lDel (getreal "\nSpecify : ")) ); end and (progn (initget 1 "Positive Negative Both") (setq doMode (getkword "\nSpecify direction [Positive/Negative/Both]: ") objLst(mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr(ssnamex lSet))))); end setq (vla-StartUndoMark (setq actDoc (vla-get-ActiveDocument (vlax-get-acad-object)))); end vla-StartUndoMark (if(member doMode '("Negative" "Both")) (foreach ln objLst (vlax-put ln 'startpoint (polar (vlax-get ln 'startpoint) (vlax-get ln 'angle)(- lDel))); end vlax-put ); end foreach ); end if (if(member doMode '("Positive" "Both")) (foreach ln objLst (vlax-put ln 'endpoint (polar (vlax-get ln 'endpoint) (vlax-get ln 'angle)lDel)) ); end foreach ); end if (vla-EndUndoMark actDoc) ); end progn ); end if (princ) )
  6. Hi all, i need some help with this lisp, i managed to modify it to do a triangle but i don't know what to write to make the 3 line to be a different color or layer. if some one could help i would appreciate it. Thanks, Brian Tab Corner.lsp ;;function (myline mypt1 mypt2 mypt3) draw three lines ;;the first line goes from mypt1 to the y of mypt1 and the x of mypt2 ;;the 2nd line goes from the y of mypt1 and the x of mypt2 to mypt2 ;;the 3nd line goes from the x of mypt2 and the x of mypt2 to mypt1 ;;the function dose not ask for the point so it can be called ;;from other programs (defun myline (mypt1 mypt2 mypt3 / mypt4 acadObject acadDocument mSpace myobject) (setq acadObject (vlax-get-acad-object)) (setq acadDocument (vla-get-ActiveDocument acadObject)) (setq mSpace (vla-get-ModelSpace acadDocument)) ;;set up point three (setq mypt3 (list (car mypt2) (cadr mypt1) (caddr mypt1))) ;;add the first line (setq myobject (vla-addline mspace (vlax-3d-point mypt2) (vlax-3d-point mypt3) ) ;_ end of vla-addline ) ;_ end of setq ;;if you need to set properties such as Layers, Linetypes, and Groups for ;;line one do it here ;;add the 2nd line (setq myobject (vla-addline mspace (vlax-3d-point mypt3) (vlax-3d-point mypt1) ) ;_ end of vla-addline ) ;_ end of setq ;;if you need to set properties such as Layers, Linetypes, and Groups for ;;line two do it here ;;add the 3nd line (setq myobject (vla-addline mspace (vlax-3d-point mypt1) (vlax-3d-point mypt2) ) ;_ end of vla-addline ) ;_ end of setq ;;if you need to set properties such as Layers, Linetypes, and Groups for ;;line three do it here ) ;_ end of defun ;;command tbc ;;Ask for the two line point and call myline (defun c:tbc (/ mypt1 mypt2 mypt3) (setq mypt2 (getpoint "Enter First Point")) (setq mypt1 (getpoint "Enter 2ND Point" mypt2)) (myline mypt1 mypt2 mypt3) ) ;_ end of defun
  7. I was wondering what do i need to add or modify the attach file to produce a result like this " 1@length" right now it just produces "length". I'm a novice at lisp routines but i'm learning, i can change a few things to make it do what i need it to do but this ones has gotten me stumped. Any help would be greatly appreciated. Thanks, Brian ;Extrusion Length (defun c:EXTL (/ cEnt tStr tBox tHgt tWid gr sPt cPt lAng bPt tPt pt1 pt2 pt3 pt4) (vl-load-com) (if (and (setq cEnt (car (entsel "\nSelect Object: "))) (member (cdr (assoc 0 (entget cEnt))) '("LWPOLYLINE" "POLYLINE" "LINE"))) (progn (setq tStr (rtos (- (vla-get-length (vlax-ename->vla-object cEnt)) 4.)) tBox (textbox (list (cons 1 tStr) (cons 40 (getvar "TEXTSIZE")))) tHgt (- (cadadr tBox) (cadar tBox)) twid (- (caadr tBox) (caar tBox))) (princ "\nPosition Text...") (while (eq 5 (car (setq gr (grread t 5 0)))) (redraw) (if (listp (setq sPt (cadr gr))) (progn (setq cPt (vlax-curve-getClosestPointto cEnt sPt) lAng (angle cPt sPt) bpt (polar cPt lAng (/ (getvar "TEXTSIZE") 2.)) tpt (polar bpt lAng tHgt) mPt (polar bPt lAng (/ tHgt 2.)) pt1 (polar bpt (+ lAng (/ pi 2.)) (/ tWid 2.)) pt2 (polar bPt (- lAng (/ pi 2.)) (/ tWid 2.)) pt3 (polar tpt (+ lAng (/ pi 2.)) (/ tWid 2.)) pt4 (polar tPt (- lAng (/ pi 2.)) (/ tWid 2.))) (grvecs (list -3 pt1 pt2 pt3 pt4 pt1 pt3 pt2 pt4))))) (if (eq 3 (car gr)) (progn (setq lAng (- lAng (/ pi 2.))) (cond ((and (> lAng (/ pi 2)) (<= lAng pi)) (setq lAng (- lAng pi))) ((and (> lAng pi) (<= lAng (/ (* 3 pi) 2))) (setq lAng (+ lAng pi)))) (Make_Text mPt tStr lAng)))) (princ "\n<!> Incorrect Selection <!>")) (redraw) (princ)) (defun Make_Text (pt val rot) (entmake (list (cons 0 "TEXT") (cons 8 (getvar "CLAYER")) (cons 62 1) (cons 10 pt) (cons 40 (getvar "TEXTSIZE")) (cons 1 val) (cons 50 rot) (cons 7 (getvar "TEXTSTYLE")) (cons 71 0) (cons 72 1) (cons 73 2) (cons 11 pt))))
  8. Greetings all, i work with AUtoCAD MEP and use "devices" regularly. We normally convert the consultants electrical blocks to devices and do what we do but on this project half of the the consultants blocks are mirrored. The problem occurs when the conversion to MEP device happens. The devices are created 180 degrees out of rotation from the original block. This means the roughly 1200 devices of 20 different types need to be manually rotated. Ugh! I saw this thread below which is the closest i have found to a solution. http://www.cadtutor.net/forum/showthread.php?54913-Rotate-multiple-blocks-around-their-individual-origin-point I dont know LISP other than a minor tweak here and there. What im hoping someone has is a LISP routine the cloely does the following. Select blocks with negative "x" scale get rotation value "RO" get scale value "SC" While there are blocks with a negative "x" scale invert scale rotate 180 degrees relative to original rotation value"RO" Thanks for you time all!
  9. Since this morning i am trying to learn what are LISP means, but I can't find better explanation. Please can anyone tell me about this? Writing it in notepad is the first way to do that, but how will you know the words/commands (whatever you call it) that you need to input. Do we have to make another tutorial lesson for that thing? how and where?. Thanks so much for the info in advance.
  10. dear, all due to new geo-reference point introduced to project, we need to move all object in drawing identically over 200 files. is there any way to make it batch and automatize the process including insertion of new ucs cordinates? any opinion is well come. thank you in advance.
  11. Bill_Myron

    Lane Taper Lisp?

    This is a long shot, But it is worth an ask. I am looking for a lisp that will draw a lane taper for me. I do this manually that includes tons of steps. I was wondering if anyone would be interested in looking into this? If there is interest, I will post the steps needed. Thanks!
  12. I have a routine that replaces one block with another block based on the block name. I need help making it run only if a specific string of text is found in one of the attributes within the found block. Can someone help? Thanks. (defun c:name () (setvar "attreq" 0) (setq ssblocks (ssget "x" '((0 . "INSERT")))) (if ssblocks (progn (setq lstblockmap (txtfile2lst "C:\\path\\filename.txt" ) ) (setq lstblocks (sel2lst ssblocks)) (foreach enblock lstblocks (setq strblockname (car (getval (setq stroldname (strcase (getval 2 enblock))) lstblockmap ) ) ) (if strblockname (progn (prompt (strcat "****** " strblockname " found.******")) (progn ;;;;;Do more code ) ) (progn (prompt "No block definition, Skipping...") ) ) ) ) ) )
  13. eturner

    acad.lsp file not loading?

    Thanks to the help I've received on this forum I've developed a number of simple lisp routines that help a great deal. My issue is that each time I open up acad, I need to go to tools>lisp>load application in order to load my lisp file. I've read online that you can create / modify your acad.lsp file, place it in a place where acad searches for it (options-->files-->support file search path). I've put my acad.lsp file in there with contents: load "U:\\LISP\filename.lsp" but when I start up Acad, my defined commands are "unknown". Any help? thanks Erik
  14. Hello, I am new to AutoLISP and I have been trying to find/create a code that will simplify drawing HVAC ductwork. I have found an existing code from an autodesk discussion group: http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Doubleline-Duct-lisp-routine/td-p/3198454 (The last posting: DUCTNEW.lsp) This code is meant to do exactly what I am trying to accomplish, except that when it prompts "continue, split, double-split, transition" the only command that works properly is . Any tips or help would be greatly appreciated
  15. I have a lisp routine that we have used for several years. The routine takes a pline, offsets it on either side based on user defined spacing then inserts a premade block to symbolize a road. The block is spaced according to user defined spacing. For instance, a block can be inserted at 2 times the width of the "road" as many times as needed to symbolize the entire length of the offset pline. Hopefully this makes sense! This lisp routine works great on it's own. However, once inserted into a macro, it starts the block insertion at the end of the pline, only inserting one block. This is happening in all versions of AutoCAD we are using from 2004 through 2011. Is there a setvar that should be reset or cleared within the lisp routine? Any suggestions would be appreciated. Thanks!
  16. I have a LISP routine that opens a drawing related to the drawing already open, and another one that performs some layer manipulation in the 2nd drawing, does a COPYALL, and closes the 2nd drawing. What I haven't been able to figure out, through vast amount of internet searching along with trial and error, is how to be able to return to the original drawing and paste the contents. I can, of course, do it manually, but I'd like to automate it as much as possible. I've tried various lisp and script routines, also nested variations of those. The result is either a process halts due to the file opening, or a script or lisp doesn't wait for the previous one to complete before it runs. Does what I'm trying to do even sound possible??? If so, any light that can be shed on this would be greatly appreciated. Thanks.
  17. I am trying to find a lisp that will create a single line flex like a "spline" but if it gets to be longer than 10'-0" then it should show as a "hard round duct" for the remaiing part. (according to code flex can not be longer than 10') can anyone help me or have a lisp that is cappable of doing this? thank you!
  18. OK LISP Masters! I have this one ALMOST where I need it. (some of the functions are still incomplete, but I know how to get those to work). Here is what this lisp is supposed to do. You are presented with a dialog box with options for device type, and other device options, then based on your options, it inserts a block, adds your other picked options, then keeps going. When you right click, the dialog should return, letting you pick different options, so you can insert different blocks. I have the whole thing working, EXCEPT for the "right click to return the dialog". Can anyone please help? (defun c:notif(/ :dlgId :done);new combined notification (setq CVR (getvar "useri2") SCL (GETVAR "userr1") lyr (getvar "clayer") osm (getvar "osmode") ) (if (= 0 scl)(command (alert "Please Set your scale and try agagin")(exit))) (COMMAND "OSMODE" "514") (COMMAND "-LAYER" "s" "F-ALRM-INDC" "") (setq :dlgId (load_dialog "notif.dcl")) (setq :done 3) (while (/= :done 0) (if (not (new_dialog "DLG_Notif" :dlgId)) (exit) ) (action_tile "devStrobe" "(setq dev 1)") (action_tile "devHRNStrobe" "(setq dev 2)") (action_tile "devSPKStrobe" "(setq dev 3)") (action_tile "devHorn" "(setq dev 4)") (action_tile "devSpeaker" "(setq dev 5)") (action_tile "mtWall" "(setq mt 1)") (action_tile "mtCeil" "(setq mt 2)") (action_tile "cd15" "(setq cd 15)") (action_tile "cd30" "(setq cd 30)") (action_tile "cd75" "(setq cd 75)") (action_tile "cd95" "(setq cd 95)") (action_tile "cd110" "(setq cd 110)") (action_tile "cd135" "(setq cd 135)") (action_tile "cd177" "(setq cd 177)") (action_tile "cd185" "(setq cd 185)") (action_tile "wat25" "(setq wat 4)") (action_tile "wat5" "(setq wat 5)") (action_tile "wat1" "(setq wat 1)") (action_tile "wat2" "(setq wat 2)") (action_tile "wat75" "(setq wat 7)") (action_tile "lensClear" "(setq lens 1)") (action_tile "lensAmber" "(setq lens 2)") (action_tile "lensCombo" "(setq lens 3)") (action_tile "spcWP" "(setq wp 1)") (action_tile "spcWG" "(setq wg 1)") (action_tile "accept" "(done_dialog 1)") (action_tile "cancel" "(done_dialog 0)") (setq :done (start_dialog)) (cond ((= :done 1) (setvar "cmdecho" 0) (if (= wat 4)(setq watt ".25W")) (if (= wat 5)(setq watt ".5W")) (if (= wat 1)(setq watt "1W")) (if (= wat 2)(setq watt "2W")) (if (= wat 7)(setq watt "7.5W")) (setq :txting 0) (while (= 0 :txting) (initget 0) (if (= dev 1) (progn (COMMAND "_.-INSERT" "FA_STROBE_ONLYW" pause SCL "" pause CD) (setq :txting 0))(setq :txting 1)) (if (= dev 2) (COMMAND "_.-INSERT" "FA_Hornstrobe" pause SCL "" pause CD)) (if (= dev 3) (COMMAND "_.-INSERT" "FA_Speakerstrobe" pause SCL "" pause CD watt)) ) (setvar "cmdecho" 1) );done ((= :done 0) (prompt "\nEnd notification command.") ) );cond ; (if (= 1 cvr)(command "-layer" "s" "F-STRB-COVR" "")) ; (setq elast (entlast)) ; (IF (= 1 CVR)(command "_.-insert" "sg-15cd" "_non" ; (cdr (assoc 10 (entget elast))) "1" "" (* 180. (/ (cdr (assoc 50 (entget elast))) pi)))) ); while (unload_dialog :dlgId) (COMMAND "CLAYER" LYR) (COMMAND "OSMODE" OSM) (princ) ) I also have the LISP and DCL files attached. NOTIF.LSP notif.dcl
  19. Maybe it is better to ask the question in this manner: What is the best way to manage the LISP codes and know when to load which code from which address. Maybe it is not wise to load all codes at ACAD startup as it is related to loading, I can assume it consumes bits and bytes and make the program fat which is not good. But my problem is that: When number of codes are handful, there is no problem remembering the name and what they do, but when they increase it is hard to know which LISP is necessary and in which folder I should look for it? How the you guys manage your LISP codes?
  20. Had some fun with a recent sub, resulted in these two programs Autoloader This program will generate autoload expressions for all LISP files in a selected directory, proceeding to write such expressions to a text file output (from which the user may copy the contents to an ACADDOC.lsp or destination of their choice). GetSyntax A fun one - sparked from this thread, involving a question regarding how to determine the command to use to call a program when there is no indication in the code header and no loading messages indicating such information. This program will read a selected LISP file and print a report detailing the command syntax for all defined commands in the selected file. Both programs use my GetSyntax sub, which reads a supplied LISP file and returns a list of defined commands within the supplied file. Enjoy! Lee
  21. Hi all, I have just found out that i am going to be asked to add very basic attributed blocks to all of our drawing stock. All the data for each blcok currently sits in a CSV file, and I was wondering (or actually hoping:wink:) whether it is possible to create this without having to create each block individually. Would any bright sparks have any thoughts on if or how it could be possible ? Currently still using ACAD 2008 (frustrating but true!) Many thanks Vicki
  22. I work in an architecture office and we are FINALLY starting to upgrade our computers. We have already purchased one computer. It is windows 7 64-bit. We use AutoCAD 2002 and the boss man wants to keep using AutoCAD 2002 because he has everything set up just the way he wants it. He is just too lazy and too worried about money to take the time to upgrade to newer versions of CAD and set them up the exact same way. I could go on and on about that. Now, to the problem at hand. I have CAD2002 installed on the new machine by doing the XP virtual machine. However, we have a LISP routine that was made years ago for CAD2002 and now it isn't working on the new machine. I have loaded it the same way I have done on all other machines running Windows XP Pro 32-bit. If any one has any possible solutions or needs more information from me please let me know. I would like to get this problem fixed so he gets off of my back. Thank you in advance for the assistance.
  23. OK.. here is the story. This is a modified version of a LISP that I wrote that works perfectly. I added a few more variables to it (there are a ton), and now all the sudden, I'm getting a 'stringp nil' error when it runs, and I cant seem to figure out why! I dont have a ton of experience writing LISPs, so my code is probably very redundant and sloppy, so please excuse the mess Thanks in advance if anyone is able to help out! (defun c:gmE1 () (setq osnapsettings (getvar "osmode")) (setq lyr (getvar "clayer")) (setvar "osmode" 0) (setvar "fieldeval" 13) (command "-layer" "s" "F-ANNO-REV" "") (setq zp1 "37.3,29.6") (setq zp2 "41.6,13.9") (setq rp1 "37.4661,14.3748") (setq rp2 "37.4661,14.5992") (setq rp3 "37.4661,14.8236") (setq rp4 "37.4661,15.048") (setq rp5 "37.4661,15.2724") (setq rp6 "37.4661,15.4968") (setq rp7 "37.4661,15.7212") (setq rp8 "37.4661,15.9456") (setq rp9 "37.4661,16.17") (setq rp10 "37.4661,16.3944") (setq rp11 "37.4661,16.6188") (setq rp12 "37.4661,16.8432") (setq rp13 "37.4661,17.0676") (setq rp14 "37.4661,17.292") (setq rp15 "37.4661,17.5164") (setq rp16 "37.4661,17.7408") (setq rp17 "37.4661,17.9652") (setq rp18 "37.4661,18.1896") (setq rp19 "37.4661,18.414") (setq rp20 "37.4661,18.6384") (setq rpt1 "37.4661,29.215") (setq rpt2 "37.4661,28.9906") (setq rpt3 "37.4661,28.7662") (setq rpt4 "37.4661,28.5418") (setq rpt5 "37.4661,28.3174") (setq rpt6 "37.4661,28.093") (setq rpt7 "37.4661,27.8686") (setq rpt8 "37.4661,27.6442") (setq rpt9 "37.4661,27.4198") (setq rpt10 "37.4661,27.1954") (setq rpt11 "37.4661,26.971") (setq rpt12 "37.4661,26.7466") (setq zw1 "38,25") (setq zw2 "42,17.2") (setq zw3 "38,23") (setq zw4 "41.16,16.56") (command "zoom" "e") (command "rectangle" zp1 zp2) (command "zoom" "w" zp1 zp2) (setq r1 (getint "\nEnter First Rev Line Number use ZERO for NONE: ")) (setq r2 (getint "\nEnter Second Rev Line Number use ZERO for NONE: ")) (if (= r2 0)(setq r3 0)(setq r3 (getint "\nEnter Third Rev Line Number use ZERO for NONE: "))) (if (= r3 0)(setq r4 0)(setq r4 (getint "\nEnter Fourth Rev Line Number use ZERO for NONE: "))) (if (= r4 0)(setq r5 0)(setq r5 (getint "\nEnter Fifth Rev Line Number use ZERO for NONE: "))) (if (= r5 0)(setq r6 0)(setq r6 (getint "\nEnter 6th Rev Line Number use ZERO for NONE: "))) (if (= r6 0)(setq r7 0)(setq r7 (getint "\nEnter 7th Rev Line Number use ZERO for NONE: "))) (if (= r7 0)(setq r8 0)(setq r8 (getint "\nEnter 8th Rev Line Number use ZERO for NONE: "))) (if (= r8 0)(setq r9 0)(setq r9 (getint "\nEnter 9th Rev Line Number use ZERO for NONE: "))) (if (= r9 0)(setq r10 0)(setq r10 (getint "\nEnter 10th Rev Line Number use ZERO for NONE: "))) (if (= r10 0)(setq r11 0)(setq r11 (getint "\nEnter 11th Rev Line Number use ZERO for NONE: "))) (if (= r11 0)(setq r12 0)(setq r12 (getint "\nEnter 12th Rev Line Number use ZERO for NONE: "))) (if (= r12 0)(setq r13 0)(setq r13 (getint "\nEnter 13th Rev Line Number use ZERO for NONE: "))) (if (= r13 0)(setq r14 0)(setq r14 (getint "\nEnter 14th Rev Line Number use ZERO for NONE: "))) (if (= r14 0)(setq r15 0)(setq r15 (getint "\nEnter 15th Rev Line Number use ZERO for NONE: "))) (if (= r15 0)(setq r16 0)(setq r16 (getint "\nEnter 16th Rev Line Number use ZERO for NONE: "))) (if (= r16 0)(setq r17 0)(setq r17 (getint "\nEnter 17th Rev Line Number use ZERO for NONE: "))) (if (= r17 0)(setq r18 0)(setq r18 (getint "\nEnter 18th Rev Line Number use ZERO for NONE: "))) (if (= r18 0)(setq r19 0)(setq r19 (getint "\nEnter 19th Rev Line Number use ZERO for NONE: "))) (if (= r19 0)(setq r20 0)(setq r20 (getint "\nEnter 20th Rev Line Number use ZERO for NONE: "))) (setq rt1 r1 rt2 r2 rt3 r3 rt4 r4 rt5 r5 rt6 r6 rt7 r7 rt8 r8 rt9 r9 rt10 r10 rt11 r11 rt12 r12) (if (> r13 0)(setq rt1 r13)) (if (> r14 0)(setq rt2 r14)) (if (> r15 0)(setq rt3 r15)) (if (> r16 0)(setq rt4 r16)) (if (> r17 0)(setq rt5 r17)) (if (> r18 0)(setq rt6 r18)) (if (> r19 0)(setq rt7 r19)) (if (> r20 0)(setq rt8 r20)) (COMMAND "-PURGE" "B" "" "N") (command "zoom" "e") (Command "erase" "w" zp2 zp1 "") (command "zoom" zp1 zp2) (setq z (itoa 0)) (setq rr1 (itoa r1) rr2 (itoa r2) rr3 (itoa r3) rr4 (itoa r4) rr5 (itoa r5) rr6 (itoa r6) rr7 (itoa r7) rr8 (itoa r8) rr9 (itoa r9) rr10 (itoa r10) rr11 (itoa r11) rr12 (itoa r12) rr13 (itoa r13) rr14 (itoa r14) rr15 (itoa r15) rr16 (itoa r16) rr17 (itoa r17) rr18 (itoa r18) rr19 (itoa r19) rr20 (itoa r20) ) (setq a (strcat "%<\\AcSm SheetSet.REV ")) (setq d (strcat " DATE \\f \"%tc1\">%")) (setq e (strcat " DESCRIPTION \\f \"%tc1\">%")) (setq i (strcat " APPR \\f \"%tc1\">%")) (setq j (strcat " ENG \\f \"%tc1\">%")) (setq k (strcat " PROJ \\f \"%tc1\">%")) (if (< r1 10 )(setq ru1 (strcat z rr1))(setq ru1 (strcat rr1))) (if (< r2 10 )(setq ru2 (strcat z rr2))(setq ru2 (strcat rr2))) (if (< r3 10 )(setq ru3 (strcat z rr3))(setq ru3 (strcat rr3))) (if (< r4 10 )(setq ru4 (strcat z rr4))(setq ru4 (strcat rr4))) (if (< r5 10 )(setq ru5 (strcat z rr5))(setq ru5 (strcat rr5))) (if (< r6 10 )(setq ru6 (strcat z rr6))(setq ru6 (strcat rr6))) (if (< r7 10 )(setq ru7 (strcat z rr7))(setq ru7 (strcat rr7))) (if (< r8 10 )(setq ru8 (strcat z rr8))(setq ru8 (strcat rr8))) (if (< r9 10 )(setq ru9 (strcat z rr9))(setq ru9 (strcat rr9))) (if (< r10 10 )(setq ru10 (strcat z rr10))(setq ru10 (strcat rr10))) (if (< r11 10 )(setq ru11 (strcat z rr11))(setq ru11 (strcat rr11))) (if (< r12 10 )(setq rv12 (strcat z rr12))(setq ru12 (strcat rr12))) (if (< r13 10 )(setq ru13 (strcat z rr13))(setq ru13 (strcat rr13))) (if (< r14 10 )(setq ru14 (strcat z rr14))(setq ru14 (strcat rr14))) (if (< r15 10 )(setq ru15 (strcat z rr15))(setq ru15 (strcat rr15))) (if (< r16 10 )(setq ru16 (strcat z rr16))(setq ru16 (strcat rr16))) (if (< r17 10 )(setq ru17 (strcat z rr17))(setq ru17 (strcat rr17))) (if (< r18 10 )(setq ru18 (strcat z rr18))(setq ru18 (strcat rr18))) (if (< r19 10 )(setq ru19 (strcat z rr19))(setq ru19 (strcat rr19))) (if (< r20 10 )(setq ru20 (strcat z rr20))(setq ru20 (strcat rr20))) (setq date1 (strcat a ru1 d) desc1 (strcat a ru1 e) appr1 (strcat a ru1 i) eng1 (strcat a ru1 j) proj1 (strcat a ru1 k) date2 (strcat a ru2 d) desc2 (strcat a ru2 e) appr2 (strcat a ru2 i) eng2 (strcat a ru2 j) proj2 (strcat a ru2 k) date3 (strcat a ru3 d) desc3 (strcat a ru3 e) appr3 (strcat a ru3 i) eng3 (strcat a ru3 j) proj3 (strcat a ru3 k) date4 (strcat a ru4 d) desc4 (strcat a ru4 e) appr4 (strcat a ru4 i) eng4 (strcat a ru4 j) proj4 (strcat a ru4 k) date5 (strcat a ru5 d) desc5 (strcat a ru5 e) appr5 (strcat a ru5 i) eng5 (strcat a ru5 j) proj5 (strcat a ru5 k) date6 (strcat a ru6 d) desc6 (strcat a ru6 e) appr6 (strcat a ru6 i) eng6 (strcat a ru6 j) proj6 (strcat a ru6 k) date7 (strcat a ru7 d) desc7 (strcat a ru7 e) appr7 (strcat a ru7 i) eng7 (strcat a ru7 j) proj7 (strcat a ru7 k) date8 (strcat a ru8 d) desc8 (strcat a ru8 e) appr8 (strcat a ru8 i) eng8 (strcat a ru8 j) proj8 (strcat a ru8 k) date9 (strcat a ru9 d) desc9 (strcat a ru9 e) appr9 (strcat a ru9 i) eng9 (strcat a ru9 j) proj9 (strcat a ru9 k) date10 (strcat a ru10 d) desc10 (strcat a ru10 e) appr10 (strcat a ru10 i) eng10 (strcat a ru10 j) proj10 (strcat a ru10 k) date11 (strcat a ru11 d) desc11 (strcat a ru11 e) appr11 (strcat a ru11 i) eng11 (strcat a ru11 j) proj11 (strcat a ru11 k) date12 (strcat a ru12 d) desc12 (strcat a ru12 e) appr12 (strcat a ru12 i) eng12 (strcat a ru12 j) proj12 (strcat a ru12 k) date13 (strcat a ru13 d) desc13 (strcat a ru13 e) appr13 (strcat a ru13 i) eng13 (strcat a ru13 j) proj13 (strcat a ru13 k) date14 (strcat a ru14 d) desc14 (strcat a ru14 e) appr14 (strcat a ru14 i) eng14 (strcat a ru14 j) proj14 (strcat a ru14 k) date15 (strcat a ru15 d) desc15 (strcat a ru15 e) appr15 (strcat a ru15 i) eng15 (strcat a ru15 j) proj15 (strcat a ru15 k) date16 (strcat a ru16 d) desc16 (strcat a ru16 e) appr16 (strcat a ru16 i) eng16 (strcat a ru16 j) proj16 (strcat a ru16 k) date17 (strcat a ru17 d) desc17 (strcat a ru17 e) appr17 (strcat a ru17 i) eng17 (strcat a ru17 j) proj17 (strcat a ru17 k) date18 (strcat a ru18 d) desc18 (strcat a ru18 e) appr18 (strcat a ru18 i) eng18 (strcat a ru18 j) proj18 (strcat a ru18 k) date19 (strcat a ru19 d) desc19 (strcat a ru19 e) appr19 (strcat a ru19 i) eng19 (strcat a ru19 j) proj19 (strcat a ru19 k) date20 (strcat a ru20 d) desc20 (strcat a ru20 e) appr20 (strcat a ru20 i) eng20 (strcat a ru20 j) proj20 (strcat a ru20 k) ) (if (> r1 0)(COMMAND "-insert" "REV1T40GME1-BOT" rp1 "" "" "" r1 date1 eng1 appr1))() (if (> r2 0)(COMMAND "-insert" "REV1T40GME1-BOT" rp2 "" "" "" r2 date2 eng2 appr2))() (if (> r3 0)(COMMAND "-insert" "REV1T40GME1-BOT" rp3 "" "" "" r3 date3 eng3 appr3))() (if (> r4 0)(COMMAND "-insert" "REV1T40GME1-BOT" rp4 "" "" "" r4 date4 eng4 appr4))() (if (> r5 0)(COMMAND "-insert" "REV1T40GME1-BOT" rp5 "" "" "" r5 date5 eng5 appr5))() (if (> r6 0)(COMMAND "-insert" "REV1T40GME1-BOT" rp6 "" "" "" r6 date6 eng6 appr6))() (if (> r7 0)(COMMAND "-insert" "REV1T40GME1-BOT" rp7 "" "" "" r7 date7 eng7 appr7))() (if (> r8 0)(COMMAND "-insert" "REV1T40GME1-BOT" rp8 "" "" "" r8 date8 eng8 appr8))() (if (> r9 0)(COMMAND "-insert" "REV1T40GME1-BOT" rp9 "" "" "" r9 date9 eng9 appr9))() (if (> r10 0)(COMMAND "-insert" "REV1T40GME1-BOT" rp10 "" "" "" r10 date10 eng10 appr10))() (if (> r11 0)(COMMAND "-insert" "REV1T40GME1-BOT" rp11 "" "" "" r11 date11 eng11 appr11))() (if (> r12 0)(COMMAND "-insert" "REV1T40GME1-BOT" rp12 "" "" "" r12 date12 eng12 appr12))() (if (> r13 0)(COMMAND "-insert" "REV1T40GME1-BOT" rp13 "" "" "" r13 date13 eng13 appr13))() (if (> r14 0)(COMMAND "-insert" "REV1T40GME1-BOT" rp14 "" "" "" r14 date14 eng14 appr14))() (if (> r15 0)(COMMAND "-insert" "REV1T40GME1-BOT" rp15 "" "" "" r15 date15 eng15 appr15))() (if (> r16 0)(COMMAND "-insert" "REV1T40GME1-BOT" rp16 "" "" "" r16 date16 eng16 appr16))() (if (> r17 0)(COMMAND "-insert" "REV1T40GME1-BOT" rp17 "" "" "" r17 date17 eng17 appr17))() (if (> r18 0)(COMMAND "-insert" "REV1T40GME1-BOT" rp18 "" "" "" r18 date18 eng18 appr18))() (if (> r19 0)(COMMAND "-insert" "REV1T40GME1-BOT" rp19 "" "" "" r19 date19 eng19 appr19))() (if (> r20 0)(COMMAND "-insert" "REV1T40GME1-BOT" rp20 "" "" "" r20 date20 eng20 appr20))() (if (> r1 0)(COMMAND "-insert" "REV1T40GME1-TOP" rpt1 "" "" "" rt1 date1 eng1 appr1 desc1))() (if (> r2 0)(COMMAND "-insert" "REV1T40GME1-TOP" rpt2 "" "" "" rt2 date2 eng2 appr2 desc2))() (if (> r3 0)(COMMAND "-insert" "REV1T40GME1-TOP" rpt3 "" "" "" rt3 date3 eng3 appr3 desc3))() (if (> r4 0)(COMMAND "-insert" "REV1T40GME1-TOP" rpt4 "" "" "" rt4 date4 eng4 appr4 desc4))() (if (> r5 0)(COMMAND "-insert" "REV1T40GME1-TOP" rpt5 "" "" "" rt5 date5 eng5 appr5 desc5))() (if (> r6 0)(COMMAND "-insert" "REV1T40GME1-TOP" rpt6 "" "" "" rt6 date6 eng6 appr6 desc6))() (if (> r7 0)(COMMAND "-insert" "REV1T40GME1-TOP" rpt7 "" "" "" rt7 date7 eng7 appr7 desc7))() (if (> r8 0)(COMMAND "-insert" "REV1T40GME1-TOP" rpt8 "" "" "" rt8 date8 eng8 appr8 desc8))() (if (> r9 0)(COMMAND "-insert" "REV1T40GME1-TOP" rpt9 "" "" "" rt9 date9 eng9 appr9 desc9))() (if (> r10 0)(COMMAND "-insert" "REV1T40GME1-TOP" rpt10 "" "" "" rt10 date10 eng10 appr10 desc10))() (if (> r11 0)(COMMAND "-insert" "REV1T40GME1-TOP" rpt11 "" "" "" rt11 date11 eng11 appr11 desc11))() (if (> r12 0)(COMMAND "-insert" "REV1T40GME1-TOP" rpt12 "" "" "" rt12 date12 eng12 appr12 desc12))() (setvar "osmode" osnapsettings) (setvar "clayer" lyr) (COMMAND "ZOOM" "E") (PRINC) )
  24. Movieangel

    Help with Stud.LSP

    So I have tried to modify a batt insulation lsp originally created by David Sides to draw studs. You would think this would be easy because all I need are 45 degree lines, but I am having some trouble. I have gotten it to work for Horizontal walls and it is ok for vertical walls a bit glitchy but not horrible. Walls at an angle on the otherhand are horrible. Any advice? ;; STUD.LSP ;; ;;========================================================== (setq xos (getvar "osmode")) (setvar "osmode" 0) (defun SSV (savelist) (mapcar '(lambda (sysvar) (list sysvar (getvar sysvar)) ) savelist) ) (setq lista '("aunits" "auprec" "blipmode" "cmdecho" "orthomode")) ;;========================================================= (defun RSV (savelist) (mapcar '(lambda (sysvar) (setvar (car sysvar)(cadr sysvar)) (car sysvar) ) savelist) ) ;;========================================================== (defun HI () (setq olderr *error*) (defun *error* (errstr) (print errstr)(princ) (setq lista (RSV lista)) (setq *error* olderr) (princ) ) (setq lista (SSV lista)) (setvar "aunits" 3) (setvar "auprec" (setvar "blipmode" 0) (setvar "cmdecho" 0) (setvar "orthomode" 0) (prompt "\nArchitectural studs. ") (prompt "\nBy Alison Baillargeon. July 12, 2011. ") (princ) ) ;;============================================================ (defun BYE () (setq lista (RSV lista)) (setq *error* olderr)(princ) (princ "\nProcessing complete. ") (princ) ) ;;============================================================ (defun c:STUD (/ A ANG1 ANG2 ANG3 LEN1 LEN2 PT1 PT2 PT3 PT4 PT5 THK1 THK2 THK3 THK4) (HI) (setq PT1 (getpoint "\nEnter start point... ") PT2 (getpoint PT1 "\nEnter end point. ") THK1(getreal "\nEnter wall thickness. ") THK2(* THK1 THK1) THK3(+ THK2 THK2) THK4(sqrt THK3) LEN1(distance PT1 PT2) LEN2(/ LEN1 THK1) ANG1(angle PT1 PT2) ANG2(+ ANG1 0.7854) ANG3(+ ANG1 5.4977) a 0 ) (while (< a LEN2) (if (= a 0) (progn (setq PT3 (polar PT1 ANG2 THK4) PT4 (polar PT3 ANG3 THK4) PT5 (polar PT4 ANG2 THK4) A 0.5 ) (command ".pline" PT1 "w" 0.0 0.0 PT3 PT4) ) (progn (setq PT3 PT5 PT4 (polar PT3 ANG3 THK4) PT5 (polar PT4 ANG2 THK4)) (command PT3 PT4) (setq a (+ a 2)) ) ) ) (command "") (command ".break" "l" PT4 (polar PT4 ANG1 THK4)) (BYE) (setvar "osmode" xos) (princ) )
  25. Hi everyone, I'm only starting to learn about Lisp programing, and really don't know a lot about that...yet... so here is a problem.. I would like to create a program, which could draw several lines horizontaly. In my imagination it should work like this: In AutoCad I show a square, and the program asks me how many lines I want to be drawn. When I give her a number, she divides total square length by my given number, and then draws the lines ( the length of a line program also gets from the square). The question would be: Can AutoCad calculate? (In my case divide) And maybe someone already has something similar?
×
×
  • Create New...