Jump to content

Search the Community

Showing results for tags 'lisp'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • 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

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...

Found 431 results

  1. Hi there! I am exploring lisp and dcl at the same time. I have this DCL as shown below. Whenever the command is done and doing the same command again, values reset (pic2). I want the values to remain whenever I used the dcl again after I press "Ok" to edit particular inputs instead of typing the whole data again. How could I possibly do that? Here is the dcl code I used. CHECKING : dialog { label = "CHECKING"; : row { :boxed_row { label = "PARAMETERS"; : edit_box { key = "a"; label = "Wind Pressure (kPa)"; edit_width = 8;} : edit_box {key = "b"; label = "Tributary Width (mm)"; edit_width = 8;} : edit_box {key = "c"; label = "Unsupported Length (mm)"; edit_width = 8;} } } : row { :boxed_column { label = "SECTION PROPERTIES (ALUMINUM)"; : edit_box { key = "d"; label = "Moment of Inertia (mm^4)"; edit_width = 8;} : edit_box {key = "e"; label = "Area (mm^2)"; edit_width = 8;} : edit_box {key = "f"; label = "Extreme Fiber (mm)"; edit_width = 8;} : edit_box {key = "g"; label = "Allowable Stress (MPa)"; edit_width = 8;} } :boxed_column { label = "SECTION PROPERTIES (STEEL)"; : edit_box { key = "h"; label = "Moment of Inertia (mm^4)"; edit_width = 8;} : edit_box {key = "i"; label = "Area (mm^2)"; edit_width = 8;} : edit_box {key = "j"; label = "Extreme Fiber (mm)"; edit_width = 8;} : edit_box {key = "k"; label = "Allowable Stress (MPa)"; edit_width = 8;} } } : button { key = "accept"; label = " &OK "; is_default = true; mnemonic = "S"; } : button { key = "cancel"; label = " Cancel "; is_default = false; is_cancel = true; } } and here is the lisp code: (defun saveVars() (setq wp(distof(get_tile "a"))) (setq tw(distof(get_tile "b"))) (setq L(distof(get_tile "c"))) (setq Im(distof(get_tile "d"))) (setq Am(distof(get_tile "e"))) (setq cm(distof(get_tile "f"))) (setq Fbm(distof(get_tile "g"))) (setq Is(distof(get_tile "h"))) (setq As(distof(get_tile "i"))) (setq cs(distof(get_tile "j"))) (setq Fbs(distof(get_tile "k"))) ) (defun C:CC() (if(not(setq dcl_id (load_dialog "CHECKING.dcl"))) (progn (alert "The DCL file could not be loaded!") (exit) ) (progn (if (not(new_dialog "CHECKING" dcl_id)) (progn (alert "CHECKING.DCL file could not be loaded!") (exit) ) (progn (action_tile "accept" "(saveVars)(done_dialog 2)") (action_tile "cancel" "(done_dialog 1)") (setq ddiag(start_dialog)) (unload_dialog dcl_id) (if(= ddiag 1) (princ "\n END") ) (if(= ddiag 2) (progn (setq IT(+ Im (* 2.87 Is))) (setq moment(/ (* wp tw L L) 8000)) (setq stress(/ (* moment cm) Im)) (setq stressratio(/ stress Fbm)) (setq deflection(/ (* 5 wp tw L L L L) (* 384000 69600 IT))) (setq allowdeflection(/ L 175)) (setq defratio(/ deflection allowdeflection)) (setq pt1 (getpoint)) (setq pt2 (getpoint)) (command "_mtext" pt1 pt2 "\n Actual Bending Stress =" (rtos stress 2 2) "\n Allowable Bending Stress =" (rtos Fbm 2 2) "\n Stress Ratio =" (rtos stressratio 2 2) "\n Actual Deflection =" (rtos deflection 2 2) "\n Allowable Deflection =" (rtos allowdeflection 2 2) "\n Deflection Ratio =" (rtos defratio 2 2) "" ) ) ) ) ) ) ) ) One more thing. About the mtext output. The output is this. Numerical results always appear on the next line. and I want the result to be like this with units as text (MPa, mm, etc) Does someone has a thing about this? Thank you in advance. :)
  2. aban

    Ortho with 45 degrees

    Hello, is there any way to get ortho to also include 45 degrees? I know polar tracking has the different angles, but I would need ortho to do that. If not, is there a way to make a lisp file to assign "DD" to turn that lisp file on? Please help with this because I really need this to work. Thank you!
  3. Hi All, I am experimenting with contextual ribbon menus based on some drawing properties and I am trying to find if it is possible to setup a reactor that will detect when you change drawings either using Switch Windows or clicking on the drawing tab. Any and all input on this issue greatly appreciated :-) Colin Holloway Brisbane, Queensland, Australia.
  4. fuccaro

    Caliper fun

    Hello people! Today I realized that AutoCAD is just waiting on my hard disc, so I started it and I wrote a short Lisp program. If someone wants to play: load the lisp and start it by typing TESTME in the command line. Probable you will have to double click with the wheel to get the zoom to the right place. You should see a caliper open at a random dimension. All you have to do is to read the caliper and enter the value. The command line should show at least 3 lines to see the result. Want to play again? Press enter. While AutoCAD waits for your input, you may use the mouse to zoom/pan. Or if you want to cheat, you can measure the opening of the caliper and enter the measured value. Have fun! (defun c:TestMe() (if (not (tblsearch "BLOCK" "SublerA")) (MakeBlockA)) (if (not (tblsearch "BLOCK" "SublerB")) (MakeBlockB)) (if (not (ssget "X" (list '(0 . "INSERT") '(2 . "SublerA")))) (entmake (list '(0 . "INSERT") '(2 . "SublerA") '(10 0 0 0)))) (if (not (ssget "X" (list '(0 . "INSERT") '(2 . "SublerB")))) (entmake (list '(0 . "INSERT") '(2 . "SublerB") '(10 0 0 0)))) (setq measured (/ (rem (getvar "millisecs") 1500) 10.0)) (setq entl (entget (entlast))) (setq entl (subst (list 10 measured 0 0) (assoc 10 entl) entl)) (entmod entl) (setq entered (getreal "Enter measured value ")) (princ (if (= measured entered) "Ok " (strcat " Not Ok! The answer is " (rtos measured) ))) (princ) ) (defun MakeBlockA() (entmake (list '(0 . "BLOCK") '(2 . "SublerA") '(10 0.0 0.0 0.0)'(70 . 0))) (setq i 0) (repeat 151 (cond ((= (* 5 (/ i 5)) i) (progn (setq m 0.5) (entmake (list '(0 . "text") (list 10 i 2.6 0) (cons 1 (itoa i)) '(40 . 1.4) (cons 50 0.7))) ) ) ) (entmake (list '(0 . "LINE") (list 10 i 0 0) (list 11 i (+ 1.5 m) 0))) (setq i (1+ i) m 0) ) (setq points (list '(-3 0 0) '(170 0 0) '(170 8 0) '(-10 8 0) '(-10 -15 0) '(-5 -25 0) '(-5 -30 0) '(-3 -30 0))) (setq p1 (list -3 -30 0)) (foreach p points (entmake (list '(0 . "LINE") (cons 10 p1) (cons 11 p))) (setq p1 p) ) (entmake (list '(0 . "ENDBLK"))) ) (defun MakeBlockB() (entmake (list '(0 . "BLOCK") (cons 2 "SublerB") (list 10 0.0 0.0 0.0)'(70 . 0))) (setq i 0) (repeat 11 (cond ((= i (* 5 (/ i 5))) (progn (setq n -0.5) (entmake (list '(0 . "text") (list 10 (- (* 0.9 i) 0.5) -5 0) (cons 1 (itoa i)) '(40 . 1.4) (cons 50 0)(cons 62 1))) ))) (entmake (list '(0 . "LINE") (list 10 (* 0.9 i) 0 0) (list 11 (* 0.9 i) (+ -2 n) 0)(cons 62 1))) (setq i (1+ i) n 0) ) (setq p1 '(-3 -30 0)) (setq points (list '(-3 0 0) '(15 0 0) '(15 -7 0) '(4 -7 0) '(4 -15 0) '(-1 -25 0) '(-1 -30 0) '(-3 -30 0))) (foreach p points (entmake (list '(0 . "LINE") (cons 10 p1) (cons 11 p))) (setq p1 p) ) (entmake (list '(0 . "ENDBLK"))) )
  5. Hello, I am trying to create a lisp routine that sets all existing MLEADERs to a certain pre-set MLEADERSTYLE, the equivalent of doing a Quick Select for Mleaders, and setting the style under the properties window. I was able to write a similar routine that selects all dimensions and sets them to a certain DIMSTYLE, using entmod and DXF code 3 for dimstyle. So far, I have not been able to find a group code for MLEADERSTYLE Any help would be greatly appreciated! (defun C:dimstylechange (/ ENTITIES NO_OF_ENTITIES SSPOSITION ENTITY_NAME OLD_ENTLIST NEW_STYLE NEW_ENTLIST) (setvar "CMDECHO" 0) (setq ENTITIES (ssget "X" '((0 . "DIMENSION")))) (setq NO_OF_ENTITIES (sslength ENTITIES)) (setq SSPOSITION 0) (repeat NO_OF_ENTITIES ;***CHANGE STYLE*** (setq ENTITY_NAME (ssname ENTITIES SSPOSITION)) (setq OLD_ENTLIST (entget ENTITY_NAME)) (setq OLD_STYLE (assoc 3 OLD_ENTLIST)) (setq NEW_STYLE (cons 3 "BCR 11x17")) (setq NEW_ENTLIST (subst NEW_STYLE OLD_STYLE OLD_ENTLIST)) (entmod NEW_ENTLIST) ;***CHANGE LAYER*** (setq OLD_ENTLIST (entget ENTITY_NAME)) (setq OLD_STYLE (assoc 8 OLD_ENTLIST)) (setq NEW_STYLE (cons 8 "DIM")) (setq NEW_ENTLIST (subst NEW_STYLE OLD_STYLE OLD_ENTLIST)) (entmod NEW_ENTLIST) (setq SSPOSITION (1+ SSPOSITION)) ) (command ".CHPROP" ENTITIES "" "C" "BYLAYER" "LT" "BYLAYER" "") (princ (strcat "\n..." (rtos NO_OF_ENTITIES 2 0) " Dimension(s) changed...")) (setvar "CMDECHO" 1) (princ) ) dimstylechange.LSP
  6. hi, my problem is that i want to get the information of a several number of Autocad files into an Excel file that i´ve already made previously(becouse in that Excel file, i have excel´s macros to work easier) , and the code that i´m going to show now, opens a new Excel and that´s what i don´t want to. I have the excel file that i want to work with, in a route like "C:\Users\Desktop\actualiza.xlsm" Thanks beforehand (if (and Dwg$lst (apply 'or (apply 'append (mapcar 'cadr Dwg$Lst)))) (progn (setq xlApp (vlax-get-or-create-object "Excel.Application") xlCells (vlax-get-property (vlax-get-property (vlax-get-property (vlax-invoke-method (vlax-get-property xlApp "Workbooks") "Add" ) "Sheets" ) "Item" 1 ) "Cells" ) )
  7. volkansahin

    Hello everybody,

    I need a complicated lisp for take information to attributes and choose blocks in cad file. So, I am working about Building Automation Systems, I am preparing "point list" and " connection diagram" for a project. My manager wants a lisp from me for choose blocks and insert data from excel point list automatic. Can anybody help me for it? I have not any idea about lisp language.( I am searching some solutions last 2 days. if possible, a lisp will look to point list, choose module type (there are 3 type modules, so 3 blocks.) and draw modules as example and will write module no, cable no (C1-xxx), equipment name and description to attributes. I attached point list and example blocks to here. Thanks for your helps. diagram_example.dwg point list.xlsx
  8. Good morning! I have not had any luck in finding much that my novice LISP skills can fix up to suit my needs. Perhaps someone here has something laying around? I am looking to have a LISP that does the following: allows the user to select one or more dimensions Allows user to pick from 3-4 options with the underlined letter being what the command needs: (XHM), (THR), (YJM), and (CPA) Then add the user selected string as a dimension suffix to the selected dimension. We add suffixes to dimensions often, and there are several different ones we use daily. Just looking to save time by having a command that will add the selected string to the suffix. Does anyone have anything similar? I am able to do some editing to suit my needs, but I don't even know where to start with editing a dimension suffix via LISP. Thanks in advance!
  9. Anyone has a code to accomplish this? I am dealing with bunch of poorly converted lines from PDF that used to be AutoCAD text in the drawing. Greatly appreciated!
  10. hai, i need a small help.i have a working lisp routine which gives perpendicular line distance to main line when clicked on a place perpendicular, only thing i want to try and add is to remove the leader that adds and only add text without leader in position where i can click. pls reply if its possible... thanks:) (defun c:Test ( / s p c a d) (if (and (setq s (car (entsel "\nPick a polyline :"))) (or (= (cdr (assoc 0 (entget s))) "LWPOLYLINE") (alert "Invalid object! Please pick a polyline only.") ) (setq p (getpoint "\nSpecify point perpendicular to polyline :")) (setq c (vlax-curve-getclosestpointto s p)) (setq a (angle p c)) (not (grdraw p c 1 -1)) ;; rubber line in red colour. (setq d (angle '(0. 0. 0.) (vlax-curve-getfirstderiv s (vlax-curve-getparamatpoint s c)))) (or (or (equal (rem (+ d (* pi 0.5)) (+ pi pi)) a 1e-4) (equal (rem (+ d (* pi 1.5)) (+ pi pi)) a 1e-4) ) (alert "Picked point is not a perpendicular to picked polyline. <!>") ) ) (command "_.leader" "_non" p "\\" "" (strcat "CHAINAGE=3+0" (rtos (vlax-curve-getdistatpoint s c) 2 4)) "") ) (princ) ) (vl-load-com)
  11. Hello Anybody Help. I need to get point from spline with use lisp function in autocad vba vlax-curve-getPointAtDist Could somebody can help me? Best Regard Joe
  12. Could anyone help me with it?? I am trying to install Global Attribute Extractor & Editor (http://www.lee-mac.com/macatt.html) on a colleague's computer which has Windows 10 inside. When I run extractor or editor, Autocad let me to state all the blocks and the files. However, when i press ok button it send me a error with automatisation problem. Did you have something similar?
  13. Goal: To select all the the objects I want to manipulate at once using a selection window, then the lisp program modifies the properties of just the Circle Entities in that selection. Below I am currently just changing the color property. After modifying the circles, I would like to modify all polyline & LWpolylines with a separate color change. I do not want to have to select the objects twice. Hopefully if this is possible I would like to followup saving Mtext or Text entites in another list. Below is where I have landed after two days of searching for solution. I am not a novice to programming but am with the lisp language. My assumption is that the ssget "_P" command can only be used once. The lisp runs and works for changes the circle entities, but not he polylines.( Command Output shown after the lisp script below) (defun c:FGT (/ ss sf1 sf2 ) (princ "\nSelect objects to export: ") (setq ss (ssget '((-4 . "<or") (0 . "CIRCLE") (0 . "MTEXT") (0 . "TEXT") (0 . "LWPOLYLINE") (0 . "POLYLINE") (-4 . "or>")))) (setq sf1 (ssget "_P" '((0 . "CIRCLE")))) (command "_chprop" sf1 "" "c" "150" "" ) (setq sf2 (ssget "_P" '((-4 . "<or") (0 . "POLYLINE") (0 . "LWPOLYLINE") (-4 . "or>")))) (command "_chprop" sf2 "" "c" "green" "" ) ) COMMAND: Command: FGT Select objects to export: Select objects: Specify opposite corner: 107 found Select objects: _chprop Select objects: 104 found Select objects: Enter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness/TRansparency/Material/Annotative]: c New color [Truecolor/COlorbook] : 150 Enter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness/TRansparency/Material/Annotative]: Command: _chprop Select objects: Command: FGT Unknown command "FGT". Press F1 for help. Command: c Unknown command "C". Press F1 for help. Command: green Unknown command "GREEN". Press F1 for help. Command: FGT Unknown command "FGT". Press F1 for help. Command: nil Command: Automatic save to C:\Users\Wesley\appdata\local\temp\Test_1_6214_5330.sv$ ... Command: Command: 'VLIDE Command: Command: Specify opposite corner or [Fence/WPolygon/CPolygon]:
  14. Dani_Nadir

    Coordinates LISP

    Hello, I am looking for the next lisp. I need to create a plline (for example a rectangle) wherever I want inside the model. Then, the routine will ask me about the distance between coordinate tic marks (x) , the plot scale (1/500 for example) and the height text. Then I will click the rectangle and finally it will create all the coordinate tick marks inside the rectangle as an editable objects (block for example) with its coordinates N (vertical) and E (horizontal). I am attaching a dwg Thanks, Best regards, Daniel. 1.dwg
  15. Dani_Nadir

    Automatic layout LISP

    Hello, I am interested in a LISP able to make overlapping sheets as layouts following a road alignment and overlap a fraction. Each sheet will have its own UCS or view orientation. You can see it from these videos: anyone knows one? Best regards, Daniel
  16. hhhhhhhanna3

    LISP Sq.Ft

    Hi All, Could anyone help me please?... I have been looking for a LISP file that calculates sq.ft. of a closed polyline and generates a sq.ft. text inside the polyline. Unit of the file that I am working on is metric, but I want sq.ft. instead of sq.mm.. Thank you so much in advance!
  17. Hello guys .... is there is any Lisp Routine for each layouts to separate dwg files ..... with bind all the xrefs thanx guyzz:roll::roll:
  18. bogeymen77

    simple area

    i'm looking for a simple area routine base on the dimension not the line. i want to be able to click on 2 cotation that i got from the dimlinear command and have the area "print" in a text format where i want to. I know a routine with a lot of visual lisp routine in it, but i'm looking a version with a standard/ basic lisp. thank you.
  19. Hello, I am searching for a lisp that can export the lengths of all selected polylines and export them to either Excel or an AutoCad table. I have found and tested around 20 lisps but so far cannot find the right one. There were only 2 that look promising, maybe they could be modified? One was by Lee Mac and the other Jimmy Bergmark. I can post the 2 Lisp if needed. The lisp would need to have you select multiple polylines and give the total lengths of each polyline in the order that they were selected in. Then the data would either appear on an AutoCad table or Excel. Thanks for any help that can be provided.
  20. I made below lisp code to have field code copied to text,dim etc. but not work on ATT thing anyone could help me with this how to make it happen that copy field code to ATT? :) (defun c:ffd () (progn (setvar "cmdecho" 0) (setvar "blipmode" 0) (vl-load-com) (progn (setq ent (entsel "select text to be copied:")) (setq egg (cdr (assoc 0 (entget (car ent))))) (setq entx (vlax-ename->vla-object (car ent))) (cond ((= egg "INSERT") (setq entp (entget (car (nentselp (cadr ent))))) (setq entr (cdr (assoc -1 entp))) (setq objid (vla-get-objectid (vlax-ename->vla-object entr))) (setq field (strcat "%<\\AcObjProp Object(%<\\_ObjId " (itoa objid) ">%).TextString>%")) ; %<\AcObjProp Object(%<\_ObjId 8796059764128>%).TextString>% ; %<\AcObjProp Object(%<\_ObjId 8796083319744>%).TextString>% ) ((= egg "DIMENSION") (setq objid (vla-get-objectid entx)) (setq field (strcat "%<\\AcObjProp Object(%<\\_ObjId " (itoa objid) ">%).Measurement \\f \"%lu2\">%")) ) ) ;%<\AcObjProp Object(%<\_ObjId 8796059773904>%).Measurement \f "%lu2">% (setq ent1 (entsel "copy to:")) (setq egg1 (cdr (assoc 0 (entget (car ent1))))) (setq entx1 (vlax-ename->vla-object (car ent1))) (cond ((= egg1 "INSERT") (setq entp (entget (car (nentselp (cadr ent1))))) (setq entr (cdr (assoc -1 entp))) (vla-put-TextString (vlax-ename->vla-object entr) field) ) ((OR (= egg1 "TEXT") (= egg1 "MTEXT")) (vla-put-textstring entx1 field) ) ((= egg1 "DIMENSION") (vla-put-TextOverride entx1 field) ) ) ) ) )
  21. Hi everybody. Here goes my first post. I'm using Autocad map 3D 2013. I dont know how to create any lisps. Thank you for any help, any is really appreciated since that i know that is really taking some of your time. I have a .dwg file with a lot of GPS points, that were taken from the field and uploaded to our systems. The GPS points come in as blocks with attributes, Im want some of does attributes to be in a multi leader (The text area). Is easy for me to replace the GPS points (Blocks) with a multileader that I created as a block, in which the arrow points exactly to where the gps point was located. I use the xpress tools to replace one block for another, since that all corresponding blocks are named the same, only the attributes change, so basically the multileader now is the GPS point. The GPS has two attributes that I need. Clearance_Ft=18.5 and crossing type= driveway or anything that we are crossing. I can also get the actual attributes Clearanace and Crossing type in a text form if I do a querry of the data. After I replace the point with a multileaders I try to insert fields in to the multileader to pick up it's own attributes, that didn't work, because since that I'm inside the block multileader when I press to insert the info that I need, the attributes disappear and is just a multileader inside block editor. I try Concatenation of Block Attributes, and it didnt work, at one point the insert field it did work but it was giving me the same clearance for all the points, Lol. I knew it was wrong. If I can get this issue resolve it would save me hours of work since that, for now I have to type every clearance by hand. When i mentioned the part that i can get the info out of the point as a text is because maybe you guys do have a better idea of how to solve the problem. Again Thank you. sample.dwg
  22. Hi, i'm looking for a lisp that will offset a line to a distance of 1.875 and change the color from blue to white. thanks.
  23. Hi All. I was wondering if anyone knows of a tool or a way to basically, batch PDF multiple viewports or specific coordinates within a paper layout. I have an A0 drawing where i need a print of the A0 drawing, and multiple grids set to A4 then a Jpeg showing the full plan with the grids on. I have set up a script using the -plot command and set the Coordinates for each grid. However it is a bit slow and cumbersome to do this on multiple drawings. Does anyone know of a way to maybe either through a script or a lisp, to open a drawing. Find certain instances of a block or polyline and print (with certain parameters like include an outline of 10mm around the edge of the grid) and when it has no more blocks to search for, it saves, closes and opens next drawing to search and print? Any help is very much appreciated. Thanks
  24. hello , i am a complete novice only know some basics i work on drawings with 100's of layers and sometimes 100's of XREF's i would like some help on writing a routine i would like to run a routine called simplelayout and this routine would turn off any layers containing AM_5 for example please please please help me and dont hesitate to ask me questions it is driving me nuts
  25. Hello, I'm new to the forum, I would like to ask you for help. I need a program / application (LISP) which will insert a deviation dart and a distance from a point to a straight line. More specifically, I would like to mark the point from the measurement and the designed line to indicate its deviation from the project. I tried to write something myself but it is too complicated for me. The arrow should show the direction in which the execution deviates from the design and it is best if its length can be determined separately depending on the drawing. In the picture I show what I mean. Thank you in advance for all your help Regards