Jump to content

Search the Community

Showing results for tags 'autolisp'.

  • 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. My boss may have just asked for the impossible, but he wants a lisp to be able to window select multiple text then window select lines near the text, and have the text align to the line or polyline that is closest to the text. I have something that allows me to pick a line then a text, but I have no idea how to do this. Any help is greatly appreciated, this is way above my ability. The attached pictures show before and after.
  2. Greetings, I´m trying to extract and sum specific data attributes from blocks in my drawing. While Lee Mac's Global Attribute Extractor & Editor is excellent, I need some help with two minor modifications: 1. How to select a certain group of blocks of my interest (by indicating a window selection) and not the entire drawing? 2. My blocks have two attributes: CODE and AMOUNT. When running MacAtt, I get the data for every instance of the block that is found, like this: Is there a way to sum the amount of instances with the same attribute in CODE in order to get a shorter table like this? Any direction provided will be very appreciated, thanks!
  3. hello i want help for creating lisp for me please ... the lisp will do these functions 1- as the attached image (1a) if i have block with yellow at right and some green blocks 2- i want when i launch the lisp to ask me to draw poly line that i want as in image 2a 3- after that when i draw this path with polyline and press enter the lisp ask me to choose blocks that i want to connect to this polyline and i will choose one by one or multiple blocks then after choosing the blocks and press enter ... the lisp will offset the main polyline that i draw and connect every polyline with the basepoint of the blocks that i choose sequentially as appear in this image 5a (attached DWG) can anyone help me please sample.dwg
  4. Hello everyone i have this code that im working for sometime... (while (not (setq ent (car (entsel "\nSelect rectangle: "))))) What i want is to change the selection option into ssget with layer filter, so that i would not pick the rectangle one by one and will do the same routine for every rectangle in the selection set.
  5. Hi there! I've watched this tutorial and have a few questions: 1. how can I load the full project in the current drawing from Visual Studio Code? Currently, I'm able to only attach the currently opened lsp file and have to load the other manually, one by one. In the visual lisp editor, there was a button to load all the files inside the project. I have a big project divided into a few files that also load an opendcl interface and I need to load them all to debug the whole program or it will not work. 2. how can I compile in fas from vscode? Probably is not possible so I have to use the original visual lisp editor. But how can I load it now? The vlisp command starts the vscode and I don't know how to start the old editor. Thanks! Dennis
  6. So I have been trying to figure this out with several approaches now and I need some help. I would like to send all Wipeouts, or really any specified entity type, within a block to the back of the draw order. Is there a way to do this using Lee Mac's Apply To Block Objects routine? I tried this in conjunction with his draw order routines but the MovetoBottom command kept failing. I'm pretty rough with VisualLisp which is part of the issue when trying to troubleshoot his great routines. Or what about this approach? (I dont really understand it, again Visual Lisp) Below is what I tried. I do understand Vanilla Lisp. Visual Lisp I barely know the basics, but eager to learn. Please help me improve my capabilities. I love autolisp. Thank you. The issue is clearly with the lambda function and my improper use of it Im sure. The ssget I am trying to do is incorrect approach for use with his function. ;=========================================================== ; 11/Sep/2020 10:09 AM[Friday] AUTHOR: Brandon Gum ;-- ;DESCRIPTION: ;Select block with wipeout. ;Will send wipeout objects the back of the draw orer ;=========================================================== (defun c:test ( / s ) (princ "\nSelect Block: ") (if (setq s (ssget "_+.:E:S" '((0 . "INSERT")))) (LM:ApplytoBlockObjects (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) (vla-get-effectivename (vlax-ename->vla-object (ssname s 0))) '(lambda ( obj ) (BG:WipeoutToBottom)) ) ) (princ) ) (vl-load-com) (princ) (defun BG:WipeoutToBottom( / ) (LM:movetobottom (ssget "X" '((0 . "WIPEOUT")))) ;(princ) );end of defun ;===============Below here are Lee's draw order functions============== My LeeMac Based Approach.LSP
  7. Hi all, I am attempting to get a viewport from blocks in modelspace to paperspace with a layout template. I would like this automated by selecting all the blocks in numerical order and placing them on the correct numbered layout. I have found plenty of lisp out there, but nothing that seems to work 100%. I know there are programs out there, but I want to try to learn autolisp with this project. I think I was able to get close with these two: Draw bounding box on object-from Blackbox Create multiple viewport from multiple rectangle in model space-from hmsilva The main difference I want to change below is to select all of my objects, instead of being prompted to select a single object, (defun c:BNDBX (/ eName mn mx) (vl-load-com) (if (setq eName (car (entsel "\n >> Select Object >> "))) (progn (vla-getboundingbox (vlax-ename->vla-object eName) 'mn 'mx) (vl-cmdf "._rectang" (vlax-safearray->list mn) (vlax-safearray->list mx)))) (princ) ) ) I have tried inserting (if (setq eName (ssget "_x" '((0 . "INSERT") (2 . "PageView")))) on the 3rd line with no success. Eventually I would like to have the second code produce layouts in order. But I figured I would get this chunk sorted first.
  8. Hi, I've written this code which draws triangles on the inside or outside of a polyline (with multiple vertexes), but it gives increasingly better/worse results depending on the zoom level (better results are obtained with higher zoom). The zoom levels I'm talking about are such that when the polyline occupies the whole screen it does work with some errors, if you reduce the zoom then it does not work, and when you increase the zoom it works perfectly. It probably depends on the relative size of the triangles (which are user inputs) to the zoom level. Is there a way to correct this behavior? (defun c:vert (/ obj1 oft wid spa ip obj2 len l1 l2 sp pt1 pt2 ptm slopeP slopeM ptt1 ptt2 pttR pttL ptt pss it) (vl-load-com) (setq obj1 (ssget C) oft (float (getreal "Triangle height: ")) wid (float (getreal "Triangle width: ")) spa (float (getreal "Distance between triangles: ")) ) (setq ip (strcase (getstring "R(ight) or L(eft): "))) (setq obj2 (vlax-ename->vla-object (ssname obj1 0)) len (vlax-get-property obj2 "length") l1 (float 0) l2 (float wid) ) (while (< l1 len) (setq sp (vlax-curve-getPointAtDist obj2 0) pt1 (vlax-curve-getPointAtDist obj2 l1) pt2 (vlax-curve-getPointAtDist obj2 l2) ptm (vlax-curve-getPointAtDist obj2 (/ (+ l1 l2) 2)) slopeP (+ (if (= (car pt2) (car pt1)) (/ pi 2) (atan (/ (- (nth 1 pt2) (nth 1 pt1)) (- (nth 0 pt2) (nth 0 pt1))))) (/ pi 2)) slopeM (- (if (= (car pt2) (car pt1)) (/ pi 2) (atan (/ (- (nth 1 pt2) (nth 1 pt1)) (- (nth 0 pt2) (nth 0 pt1))))) (/ pi 2)) ptt1 (list (+ (nth 0 ptm) (* oft (cos slopeP))) (+ (nth 1 ptm) (* oft (sin slopeP)))) ptt2 (list (+ (nth 0 ptm) (* oft (cos slopeM))) (+ (nth 1 ptm) (* oft (sin slopeM)))) pttR (if (< (- (* (- (nth 0 pt2) (nth 0 pt1)) (- (nth 1 ptt1) (nth 1 pt1))) (* (- (nth 0 ptt1) (nth 0 pt1)) (- (nth 1 pt2) (nth 1 pt1)))) 0) ptt1 ptt2) pttL (if (> (- (* (- (nth 0 pt2) (nth 0 pt1)) (- (nth 1 ptt1) (nth 1 pt1))) (* (- (nth 0 ptt1) (nth 0 pt1)) (- (nth 1 pt2) (nth 1 pt1)))) 0) ptt1 ptt2) ptt (if (= ip "R") pttR pttL) ) (command "_.pline" pt1 ptt pt2 "") (setq l1 (float (+ l1 wid spa)) l2 (float (+ l2 spa wid)) ) ) )
  9. hello everybody , hope u all are great ... i have this lisp to get sum of some texts in autocad by choosing them one by one , but instead i wanna select those texts in one time by one selection click for them all ... i really appreciate ur help thanks in advance ;; wrriten by dlanorh from cadtutor (defun rh:em_txt ( pt txt lyr sty tht xsf) (entmakex (list '(0 . "TEXT") '(100 . "AcDbEntity") '(100 . "AcDbText") (cons 10 pt) (cons 1 txt) (if lyr (cons 8 lyr)) (if sty (cons 7 sty)) (if tht (cons 40 tht)) (if xsf (cons 41 xsf)) );end_list );end_entmakex );end_defun (vl-load-com) (defun c:t+ ( / *error* sv_lst sv_vals ent elst el num xsf ans tot qflg nlst sel pt txt) (defun *error* ( msg ) (mapcar 'setvar sv_lst sv_vals) (if (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*EXIT*")) (princ (strcat "\nAn Error : " msg " occurred."))) (princ) );end_defun (setq sv_lst (list 'cmdecho 'osmode 'dynmode 'dynprompt) sv_vals (mapcar 'getvar sv_lst) );end_setq (mapcar 'setvar sv_lst '(0 0 3 1)) (while (not tot) (setq el (entget (setq ent (car (entsel "\Select First Text Number Entity : "))))) (cond ( (wcmatch (cdr (assoc 0 el)) "*TEXT") (cond ( (= (cdr (assoc 0 el)) "TEXT") (setq num (atof (getpropertyvalue ent "TextString")) xsf (cdr (assoc 41 el)))) (t (setq num (atof (getpropertyvalue ent "Text")) xsf 1.0)) );end_cond (cond ( (zerop num) (setq num nil) (alert "Text Entity NOT a number")) (t (setq tot num))) ) (t (alert "Not a Text Entity")) );end_cond (cond (num (setq nlst (cons ent nlst)))) );end_while (while (not qflg) (setq sel (entsel "\nSelect Next Text Number Entity : ")) (cond ( (not sel) (initget "Yes No") (setq ans (cond ( (getkword "\nSelection Finished [Yes/No] <No>")) ("No"))) (if (= ans "Yes") (setq qflg T)) ) );end_cond (cond ( (and (not qflg) sel) (setq elst (entget (setq ent (car sel)))) (cond ( (and (wcmatch (cdr (assoc 0 elst)) "*TEXT") (not (vl-position ent nlst))) (cond ( (= (cdr (assoc 0 elst)) "TEXT") (setq num (atof (getpropertyvalue ent "TextString")))) (t (setq num (atof (getpropertyvalue ent "Text")))) );end_cond (cond ( (zerop num) (setq num nil) (alert "Text Entity NOT a number"))) ) ( (vl-position ent nlst) (alert "Already Selected") (setq num nil)) (t (alert "Not a Text Entity")) );end_cond (if num (setq tot (+ tot num) nlst (cons ent nlst) num nil)) ) );end_cond );end_while (cond ( (and tot qflg) (setq pt (getpoint "\nSelect Total Insertion Point : ") txt (if (zerop (rem tot 1.0)) (rtos tot 2 0) (rtos tot 2 3)) );end_setq (rh:em_txt pt txt (cdr (assoc 8 el)) (cdr (assoc 7 el)) (cdr (assoc 40 el)) xsf) (if nlst (foreach o (mapcar 'vlax-ename->vla-object nlst) (vla-delete o))) ) );end_cond (mapcar 'setvar sv_lst sv_vals) (princ) );end_defun
  10. Hello people i have problem with using server path in autolisp. Everything work fine with normal path like "G:\Trudy-menu\ ...." but i cant use "\\46.48.10(random IP)\Network\Trudy-menu\.... if someone can help i will be glad. I want to get files from the path and create folders if it need. Thank you.
  11. I was trying to change the shade plot of a view port by lisp but I didn't see any way to do that through the change properties or through the dxf codes. (progn (setq ss1 (ssget "x" '((0 . "VIEWPORT")))) (command "change" ss1 "" "p") )
  12. Hi Everyone, From few days I'm trying to make an auto lisp which can understand the difference between 2 different layers and calculate area according to that. Unfortunately I'm not getting proper results anyone can please help. I was trying to create the lisp in below steps. Step-1: After entering command user will select whole drawing in single selection Step-2: Lisp will select only object in Layer-1 & Layer-2 (Other layers objects will be ignored) Step-3: Lisp will calculated the area of Layer-1 & Layer-2 Step-4: Now it will Subtract the area of Layer-2 from Layer-1 Step-5: and paste it as Text.
  13. This code: (command "new" "S:\\CADCore\\Titleblocks\\Facilities A Model.dwt") Gives me this error: Unknown command "DWT". Press F1 for help. Please help
  14. Hello everyone, I hope you all healty and feeling hapy. Many greeting to you from capital of the Turkey I've a problem about syntax of my lisp that can print perimeter and area to attribute (Especially Room Tag). I tried many times to fix this error but I never find a solution about my problem. Thank you That's my lisp; ;;;;;; ;;;;;;; (defun AREA_PERIMETER_SEC () (prompt "\nSelect a closed POLYLINE") (setq sonobje (car (entsel))) (if sonobje (progn (setq silobje sonobje) (redraw silobje 3) (command "area" "e" sonobje) ;(alert "Bulunan alan.") (setq alan (/ (getvar "area") 10000)) (setq cevre (/ (getvar "perimeter") 100)) (print)- (prompt (strcat "Bulunan alan ve cevre: " (rtos alan 2 2) "m² " (rtos cevre 2 2) "mt. " ) ) ) ;progn (progn (alert "Kapali alan bulunamadi.Tekrar deneyin.") (exit) ) ) ;if ) ;;;;-----MAIN PROGRAM----- (defun DEGIS (ss es-alan es-cevre / ye-alan ye-cevre) (setq ye-alan (cons 1 (rtos alan 2 2))) (setq ye-cevre (cons 1 (rtos cevre 2 2))) (entmod (subst ye-alan es-alan (entget (entnext (entnext (entnext ss))) ) ) ) (entmod (subst ye-cevre es-cevre (entget (entnext (entnext (entnext (entnext ss))) ) ) ) ) (entupd ss) (print) (prompt (strcat "Onceki alan ve cevre: " (cdr es-alan) "m² " "mt. " ) ) (print) (prompt (strcat "Yazilan alan ve cevre: " (cdr ye-alan) "m² " (cdr ye-cevre) "mt. " ) ) (princ) ) (defun C:RAPT () ; (/ obje x) (setq objeler nil silobje nil ) ;;(prompt "\nHesaplanacak alani,") (initget "Orta Ciz Sec") (setq sec (AREA_PERIMETER_SEC)) (setq ss (car (entsel "\nChoose the ROOM NUMBER to be CHANGED") ) ) (setq x 0) (if ss (progn (setq obje (substr (strcase (cdr (assoc 2 (entget ss)))) 1 7)) (setq es-alan (assoc 1 (entget (entnext (entnext (entnext ss))) ) ) ) (setq es-cevre (assoc 1 (entget (entnext (entnext (entnext (entnext ss)) ) ) ) ) ) (if (= obje "MTAG") (DEGIS ss es-alan es-cevre) ) ;if ) ;progn ) ;if (command "") ) (princ)() RAPT.lsp
  15. Hi, I would like to know some help. 01 - Is there a possibility in this Lee Mac lisp, Automatically Label Attributes, that it can be changed so that every time I open a different file it asks me about the increment, prefix and suffix settings? Because in the current way it always loads the pre-configuration that is already in lisp. I don't want to have to edit the lisp to configure the numbers for each file. Note: I use attributed blocks and multileader blocks. 02 - I also use the Lisp Incremental Numbering Suite, I would like to know if the option for multileaders can be added. As the current options are only for text, mtext and blocks. For my use multileaders are more interesting. Because the use of block with attributes will have to be manually making the leader lines to indicate their positions and references after their insertion and when you have many blocks end up wasting valuable time. I would like to know if it is possible to make any of these changes, since lisps have many lines. Note: Sorry for the google translation. #NumIncV3-9.lsp AutoLabelAttributesV1-4.lsp
  16. Hi All, I'm after an Autolisp function that basically does the following: User selects a text Script finds nearest closed polyline that the text's insertion point lies inside I.e. Given a point (the insertion point for the text entity), I want to automatically find the nearest closed polyline that the point lies in. The polyline is always closed. Picture is below (hopefully clears up some confusion).
  17. Hi all, this is a cutout of a dcl file with toggle boxes. How can I predefine the selection "lathe machine"? (So that this checkbox is always checked). Currently, the selection that was previously selected is always applied. With radio-buttons it works with "value=1", but not in this case. : toggle { key = "tool"; label = "lathe machine"; value = "1"; } Thanks so far.
  18. Hi all, I have rebuilt the dcl and lsp files for my purposes. Can someone show me how to query the set variable (with wcmatch or cond)? Thanks in advance. (defun c:MyToggles (/ Dcl_Id% Layout_A1H$ Layout_A2H$ Layout_A3V$ Layout_A3H$ Layout_A4V$ Layout_A4H$ Return#) ;----- set default variables (if (not *MyToggles@) ;unique global variable name to store dialog info (setq *MyToggles@ (list nil "0" "0" "0" "0" "0" "0")) ) (setq Layout_A1H$ (nth 1 *MyToggles@) Layout_A2H$ (nth 2 *MyToggles@) Layout_A3V$ (nth 3 *MyToggles@) Layout_A3H$ (nth 4 *MyToggles@) Layout_A4V$ (nth 5 *MyToggles@) Layout_A4H$ (nth 6 *MyToggles@) ) ;----- load dialog dcl data (setq Dcl_Id% (load_dialog "MyDialogs.dcl")) (new_dialog "MyToggles" Dcl_Id%) ;----- set dialog initial settings (set_tile "A1H" Layout_A1H$) (set_tile "A2H" Layout_A2H$) (set_tile "A3V" Layout_A3V$) (set_tile "A3H" Layout_A3H$) (set_tile "A4V" Layout_A4V$) (set_tile "A4H" Layout_A4H$) ;----- dialog actions (action_tile "A1H" "(setq Layout_A1H$ $value)") (action_tile "A2H" "(setq Layout_A2H$ $value)") (action_tile "A3V" "(setq Layout_A3V$ $value)") (action_tile "A3H" "(setq Layout_A3H$ $value)") (action_tile "A4V" "(setq Layout_A4V$ $value)") (action_tile "A4H" "(setq Layout_A4H$ $value)") (setq Return# (start_dialog)) ;----- Unload Dialog (unload_dialog Dcl_Id%) (setq *MyToggles@ (list nil Layout_A1H$ Layout_A2H$ Layout_A3V$ Layout_A3H$ Layout_A4V$ Layout_A4H$)) (princ) ;c:MyToggles ) MyToggles : dialog { key = "Title"; label = "Layouts"; //title from lsp file spacer; : boxed_column { label = "Get your Layouts:"; width = 34.26; fixed_width = true; : toggle { key = "A1H"; label = "A1 - Horizontal"; } : toggle { key = "A2H"; label = "A2 - Horizontal"; } : toggle { key = "A3V"; label = "A3 - Vertikal"; } : toggle { key = "A3H"; label = "A3 - Horizontal"; value = "1" ; //predefined selection } : toggle { key = "A4V"; label = "A4 - Vertikal"; } : toggle { key = "A4H"; label = "A4 - Horizontal"; } spacer; } spacer; ok_only; } How do I include the variable query here? (cond ((= Layout_A1H$ 1) "selected") ('T "not selected") )
  19. What command can I use to find a block by its name in my drawing and then delete it?
  20. Hi, I'm trying to query the variable "Weight" and if it has the content "50" I want to define a new variable: "Stamp" with the content "internal". Is WCMATCH the right command for this? (if (= wcmatch Weight "50") (progn (setq stamp "intern"))) (princ)
  21. Hi all, I am trying to write a lisp that will create a DropDown list in Autocad. With the selection from the fields I want to execute different commands that I have defined before. (defun c:create_dropdown () (setq choise1 command1) (setq choise2 command2) (setq choise3 command3) (setq choise4 command4) (strcase (initget (getkword [choise1/choise2/choise3/choise4])))) )
  22. Hello all. I need a lisp that will merge all layouts, that start with a certain name, into one PDF file. I have already made some progress with this Lisp. With the dwgprops I get information about the current file path, which I then merge all with the stract command. This also works, only the command "-Export" "ak" can only print one sheet. The number of layouts that start with "Plan..." are always different. Does anyone have an idea which command works instead for publish all Layouts, that beginns with the same name? The -publish command always asks me for a dsd file. (defun c:Documentsheets ( / pdfName ) (vl-load-com) ;--------- get variabel für contact - number: (setq acadObject (vlax-get-acad-object)) (setq acadDocument (vla-get-ActiveDocument acadObject)) (setq dProps (vlax-get-Property acadDocument 'SummaryInfo)) (vla-getCustomByIndex dProps 4 'myValue1 'myValue2) (setq contact myValue2) (princ) ;--------- get variable for order - number: (setq acadObject (vlax-get-acad-object)) (setq acadDocument (vla-get-ActiveDocument acadObject)) (setq dProps (vlax-get-Property acadDocument 'SummaryInfo)) (vla-getCustomByIndex dProps 5 'myValue1 'myValue2) (setq order myValue2) (princ) ;-------- (setq Pathone "\\\\company.lan\\xyz\\erp\\land\\contact\\") (setq Pathtwo "\\order\\") (setq Paththree "\\folder\\") ;-------- (command "_Qsafe") (foreach layname (vl-remove-if-not '(lambda (ln) (vl-some '(lambda (n) (wcmatch ln n) ) '("Plan*") ) ) (layoutlist) ) (setvar "ctab" layname) (setq pdfName (strcat Pathone Contact Pathtwo Order Paththree (strcat order "_Drawing") ) ) ) (if (findfile pdfName) (command "-EXPORT" "PDF" "Ak" "N" pdfName "J") (command "-EXPORT" "PDF" "Ak" "N" pdfName) ) )
  23. Hello, After a sidestep to Clojure, of course back to AutoLisp. I have quite some exeperience with AutoLisp and on and off I worked with it for almost 20 years now. (Auto)Lisp is known amongst AutoCAD users but further on, the whole lisp-thing doesn't ring a bell with most programmers that I meet. They work with SQL, HTML, XHTML, Java, C# or maybe (V)BA. I stayed interested in Lisp, although limited to AutoLisp. Recently. I discovered that there is a new Lisp called Clojure that is becoming big in the programming world. Possibly due to the fact that it translates to Java or javascript before anything is executed. But this aside. I learned that Clojure is first class because it is capable of accepting a function as a parameter and clojure functions can produce functions. There's a whole lot more to be discoverd about this great language but I leave that to the reader. The subject 'Clojure' is easily found on the web. By taking this interest in Clojure I learned a lot about AutoLisp too. On this page at the subject of 'Closures' halfway the page, there is an example showing how a function is produced in Clojure. Realy, it took me quite some time to grasp it. After that I wanted to know if this could be done with AutoLisp as well. After trials with defun-q-list-set/ref (which also work) I came up with the following. Hart of the solution is (eval (append '(lambda . . Is it the best way to do this? I don't know. Is it useful? I doubt it but see below. Is it interesting? Highly (for me!) (defun messenger-builder (greeting) (setq greeting (strcat "\n" greeting " ")) (eval (append '(lambda (who)) (list (list 'princ (list 'strcat greeting 'who)) '(princ))))) (setq hello-er (messenger-builder "Hello") goodbye-er (messenger-builder "Goodbye")) (defun c:greet_the_world () (hello-er "World!")) (defun c:say_goodbye () (goodbye-er "Everyone!!")) AutoLisp does a great job in AutoCAD. Perfect, but as a Lisp it is less thoroughly designed than Clojure. This shows off in the example above. Clojure handles the subject of producing functions easier. Maybe my example is ill-constructed. I could not find a better solution. Question also is, can we think of any usufull application of this in AutoCAD. Although I took another route in the example, the designated functions for this are (I think) defun-q-list-set/ref. I suppose they are there for a reaon. Or is it all limited to the s::startup example?
  24. Hi to all. I really appreciate the content of this page and so I wanted to ask if anyone has any idea how we could use AutoLISP to design a water supply and sewerage system in our floor plan. Thanks in advance.
  25. Hi Guys, I have several layouts when drawing, which also have different names. I want to save in a Lisp all layouts that start with a specific name in a certain folder as PDF. I am new in lisp, but i have managed to write a lisp that selects the correct location for me. Unfortunately only all layouts are printed. (defun c:Dokument_Export () (command "-EXPORT" "PDF" "ALLE" (strcat (substr (getvar "DWGPREFIX") 1 70) "\\08_Auftragsbestätigung\\" (strcat (substr (getvar "DWGNAME") 1 8) "_Zeichnung") ) ) ) You have any idea? Thanks in advance.
×
×
  • Create New...