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. Hi, I would appreciate if someone could help me with a lisp to explode all dimensions in multiple drawings in AutoCAD. I know exploding dimensions is not the best, however I have to do it for this specific project and I have a lot of drawings.
  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, I'm having a hard time figuring out how to make a toolbar that can be downloaded for all to use. My problem is how do you share a "common directory" with the world? The toolbar works perfectly fine on my computer, because I have defined my own directory in the macro under the cui command. So the question is: how do you make a "common directory" so that the toolbar can be accessed on any computer? I hope I have made myself clear. Thanks!
  4. hanhphuc

    HP BUTTONS.lsp

    Version 1.0.1

    1,074 downloads

    Thank you for supporting this "HP:BUTTONS.lsp" DCL library. This routine allows you to create DCL with multiple buttons associated to DCL action_tile list on the fly. It creates DCL box with single column x nRows of buttons, 'n' depends on the length of the 'action list' usage: (hp:buttons title lst width ht) title = Name caption on top of DCL - string lst = quoted list or progn list - list width = Width of the dialod box - integer ht = height of each button - integer returns nil or any execution (progn ... ) related to action_tile Save this file into your support folder, append to your startup autoload routine. In order to optimize the user experience, it allows maxinum 15 rows however you can abjust depends on screen size. HP:BUTTONS - v1.0 Free LISP by - hanhphuc email: hanhphuc.diy@outlook.com
  5. Not sure what i have been missing here. But finally decided to do something about our custom code. The lisp looks for a file and if present on system proceeds to step 2. Step 2 it checks for match with path. this is where i get confused.. I thought a (princ) close's the file clean (no loose ends) however the settings are there (in the options) but not applied. what am I missing? I have looked for some way to apply settings under the options dialog but no success. (Setvar "cmdecho" 0) (if (= "24.0s (LMS Tech)" (getvar "ACADVER")) (progn (if (not (wcmatch (getenv "PrinterConfigDir") "*path*")) ;Looking for Printer Configuration Search Path (setenv "PrinterConfigDir" "path") ;If not found add Printer Configuration Search Path ) (if (not (wcmatch (getenv "PrinterDescDir") "*path*")) (setenv "PrinterDescDir" "path") ;If not found add Printer Description Search Path ) (if (not (wcmatch (getenv "PrinterStyleSheetDir") "*path*")) ;Looking for Path in Plot Style Table Search Path (setenv "PrinterStyleSheetDir" "path;") ;If not found add Plot Style Table Search Path ) ) ) ;(alert "message") (Setvar "cmdecho" 1) (princ)
  6. hanhphuc

    FIELD Bugs in windows x64

    hi guys i have a FIELD expression working fine in AC2007 old 32bit desktop LINE's delta properties= x,y multiply scale factor eg: 0.03,-0.04 x 1000, then entmake MTEXT should display dX=30 dY=-40 but it's weird, Bricscad/v19/win7 x64 (sorry as i'm newbie) dX %<cExpr (1000 * %<cObjProp Object(%<\_ObjId 1889532720>%).Delta after double click to edit it became dX %<\_FldIdx 0a (if ACAD double click to edit FIELD, a dialog pops up, you can check formula 1000 * 0.030 & preview) can you replicate this bug?? (defun foo (obj x) (apply 'strcat (mapcar '(lambda (a b) (strcat a "%<\\AcExpr (" (rtos (float x) 2 0) " * %<\\AcObjProp Object(%<\\_ObjId " (itoa (vla-get-objectid obj)) ">%).Delta \\f \"%lu2%pt" b "%pr8\">%" ") \\f \"%lu2%pt" b "%qf1%pr0\">%" " \n" ) ) '("dX " "dY ") '("1" "2") ) ) ) test delta x=0.03 y=-0.04 (and (setq pt (getpoint "\nSpecify point.. ")) (setq en (entmakex (cons '(0 . "LINE") (mapcar '(lambda (a b) (cons a (mapcar '+ pt b)) ) '(10 11) '((0. 0.) (0.03 -0.04)) ) ) ) ) (entmakex (list '(0 . "MTEXT") '(100 . "AcDbEntity") '(100 . "AcDbMText") (cons 40 (getvar 'textsize)) (cons 10 pt) (cons 1 (foo (vlax-ename->vla-object en) 1000.) )) ) ) need some comparison eg: xxxcad/20xx/winxx dX ? ? ? ? dY ? ? ? ? or something else? if there's bug, any solution? thanks
  7. Hello Everyone! I am using vanilla AutoCAD 2017. I have recently done a hydrographic survey, so I have a drawing full of depths (text). Wondering if anyone can point me to a lisp routine that can color code the text based on a range. For example any depths between 10 and 20 is green or any depths between 20 and 30 are red. Thanks in advance.
  8. Hello, I have been working on a VLISP routine that reads from a txt file and draws some plines based on the text file. As a result of how the text files are received some lines are drawn as duplicates. Accordingly, I would like to run the overkill command or something similar at the end of the routine on only the active layer. Can anyone provide advice or code snippets as to how I can complete this. I did not see an ActiveX reference to OVERKILL, and am pretty new to vlisp (so go easy). Thanks David
  9. Good day Everyone, I have an old topic here where I wanted to visualize my lisp routines into drop down menus. I have succeeded in developing an excel sheet to automate the process of adding and removing items into my menus without any hassle or any typing mistakes. However, I am stuck in a small portion of my lisp routines where I would like to call a specific command loaded from a .VLX file into my big .LSP routine. To be more clear, I have the following setup: Excel Sheet has all my data with all commands with their relative routines needed to exist in mylisp.lsp Same excel sheet has the hierarchy of the drop down menu. Each menu item is connected the commands above by calling the command with a simple macro. So far, all my lisp routines consists of native autocad commands which I do not face any issue with them so far. Last menu with last set of lisp routines should consist of simple and native commands combined with an external command loaded from .VLX file. every time I try to include this command loaded from the .VLX into another .LSP file, it can not be loaded and I can not pass any parameter to it as well. Let me show simple example: This is the routine which includes only native autocad commands: BlockName contains 7 different attributes (Some Text). (DEFUN C:EBMSS () (COMMAND "INSERT" "BlockName" "S" "1" "R" "0" (setq p (getpoint "\nSpecify insertion point: ")) "Some Text" "Some Text" "Some Text" "Some Text" "Some Text" "Some Text" "Some Text" ) (COMMAND "LAYMCH" "L" "" "N""ITEM")) Same lisp routine with added the last command which is loaded from the VLX file. It does not work. (DEFUN C:K0 () (COMMAND "INSERT" "BlockName" "S" "1" "R" "0" (setq p (getpoint "\nSpecify insertion point: ")) "Some Text" "Some Text" "Some Text" "Some Text" "Some Text" "Some Text" "Some Text") (COMMAND "LAYMCH" "L" "" "N""ITEM") (COMMAND "BLOCKC" "L" "R" "0" "PREFIX TEXT" "SUFFIX TEXT")) ;This command is executed from loaded .VLX file. FYI, I do not have access to the source code and I do not need to. All I need is to be able to initiate the command into the lisp routine to auto select the last added block with some attributes and passing some arguments to it. I wish if anyone can help me achieving this target. By the way, I am developing these programs to help me and my teammates speeding up the work progress at our design office. Thanks in advance and wish you all a wonderful day. Regards, Sameh Hosny
  10. Hello everyone in the forum, thank you in advance for the help you can give me. Ok this is the situation: I've a LISP, that calculates the slopes in a plan view or in the model, and works very well, but i need some changes adapted to this task. I'll try to explain my best. 1. Here is the code (defun c:plevel (/ decs ;|diff|; elist level osm p1 p2 slope strlevel txtelev txthgt txtpt) (setq osm (getvar 'osmode)) (while (and (or (not (setq txtelev (entsel "\nSelect Starting Level Text : "))) (not (eq "TEXT" (cdr (assoc 0 (setq elist (entget (car txtelev))))))))) (princ "\n Nothing selected or wrong object type selected, try again") ) (setq strlevel (cdr (assoc 1 elist)) decs (- (strlen strlevel) (1+ (vl-string-position 46 strlevel))) level (atof strlevel) txthgt (cdr (assoc 40 elist)) ) (initget 6) (setq slope (getreal "\n Enter Slope Like ==> 0.005 : ")) (if (not slope) (setq slope 0.005)) (setvar 'osmode 39) (setq p1 (getpoint "\nPick 1st Point: ")) ;;; (setq diff (mapcar '- (cdr (assoc 10 elist)) p1)) (while (setq p2 (getpoint "\nPick Next Point (Or Press Enter To Exit): ")) (setq level (- level (* (distance p1 p2) slope)) strlevel (rtos level decs) txtpt (getpoint "\nPick Text Place For Point Level: "); (mapcar '+ p2 diff) ) (entmake (list '(0 . "TEXT") '(100 . "AcDbEntity") '(100 . "AcDbText") (cons 10 txtpt) (cons 11 (list 0.0 0.0 0.0)) (cons 40 txthgt) (cons 1 strlevel) '(50 . 0.0) '(41 . 1.0) '(51 . 0.0) '(7 . "Standard") '(71 . 0) '(72 . 0) (cons 210 (list 0.0 0.0 1.0)) '(73 . 0)) ) (setq p1 p2) ) (setvar 'osmode osm) (princ) ) 2. Basically, what the LISP does is obtain through the slope introduced the levels at the points that the user subsequently enters. To this point, well. Ok, this is what i need 1. It does not calculate the negative slope, if the user enters a negative slope this sends an error message. calculation is not possible in that situation. I need change that to work with negative slopes. 2. that allows me, by selecting objects either line, polyline to calculate the distance first and then with the previous selection of levels, calculate the slope automatically. post the original LISP, Regards. plevel.lsp
  11. Hi guys, Im looking for lisp routine that instantly inserts field for measurement of dimension line to an attribute text or specific attribute tag in a block. i.e. I have this dimension line "dim A" and a tag "cutting_length" in the attribute, such that the attribute value will change according to the dimension. Thanks in advance!
  12. Hello everyone, Very new to AutoCad & lisp coding so please forgive my ignorance. Am looking to join two (regular) parallel lines, end point to end point, with a single perpendicular line. Ideally it would be great if I could just window select the two lines I wanted connected but would settle for manually selecting the two end points. I know much has been said & done about achieving this with polylines etc but I need my lines to remain as just regular lines. I did find a lisp routine that came close but it joined the parallel lines with lines at both ends: thus creating a rectangle. Other routines have placed multiple lines between the two parallels creating a train track kind of look. Again, I apologise as the above mentioned lisps may be quite easy to modify so that only one line is added but that is currently above my pay grade! Hopefully my request has made sense & someone clever can solve my issue. Thank-you everyone. Brad
  13. Ok, I'm at my wits end here ( or maybe I forgot to take my meds ). I can't for the life of me figure out how to do write a lisp command that i can execute when opening a cad drawing. Little history here. I have created standard templates for everyone in my office to use, but some departments like to alter these to fit their needs, which ultimately destroys the whole idea of having standards. I would like help with a lisp command that will do the following. After I open the drawing Run lisp called "Cleanup" that will Select all multileaders by style named horizontal 1 and replace them with H - 1 Select certain blocks and replace them Select certain dimstyles and replace them Is there a way I can have it repeat for different style names that i can edit in the lisp? I have tried using the checkstandards option, selecting and changing all entities a group at a time, and qselect. These options are very time consuming (something I don't have much of) I dont understand how to use the SSGET and SSX commands, let alone create lisp using them. If anyone has any idea please let me know. What i have in mind may not be the easiest way. Thank you in advance!!
  14. I am trying to accomplish this lisp with no knowledge of DCL since I can check and uncheck options when I want. (Typ.) (Type) (TYP.) (TYPE) ± c/c ;option1; ± ;Dimension; c/c or C/C ;option2; ± ;Dimension; c/c or C/C then underneath the dim line to be: all four options of (Typ.)(Type)(TYP.)(TYPE) previously I had made a few lisps to do the task but it seems a DCL would be the way to go: ; Adding (Type) to the dimension line with Arial text (defun c:2 (/ Rtrn txt ss in vl) (progn (princ "\nSelect Dimension to modify: ") (setq ss (ssget "_:L" '((0 . "DIMENSION")))) ) ;end of 1st. progn (progn (setq Txt (strcat "<> " "{\\fArial|b0|i0|c0|p34;(Type)}")) (repeat (setq in (sslength ss)) (setq vl (vlax-ename->vla-object (ssname ss (setq in (1- in))))) (vl-catch-all-apply 'vla-put-TextOverride (list vl txt)) ) ) ;end 2nd. progn ; ) ; end if (princ) ) ;End Defun ; Adding ± to the dimension line keeping dim style (defun c:4 (/ Rtrn txt ss in vl) (progn (princ "\nSelect Dimension to modify: ") (setq ss (ssget "_:L" '((0 . "DIMENSION")))) ) ;end of 1st. progn (progn (setq Txt (strcat "%%P<>")) (repeat (setq in (sslength ss)) (setq vl (vlax-ename->vla-object (ssname ss (setq in (1- in))))) (vl-catch-all-apply 'vla-put-TextOverride (list vl txt)) ) ) ;end 2nd. progn ; ) ; end if (princ) ) ;End Defun for now I have them each under a command but it would be nice to have them using DCL. You see some pre/suffixes are all capital and some regular. also some are taking the dimension style formatting and some are Arial. Any help please? thank you!
  15. Newbie to forum but not to CAD. I need a copy lisp that will add the entered dimension accumulatively. Example: Command; copy, pick object(s), pick base point, enter displacement, "10 foot", first click copies in a direction at ten foot, then twenty, thirty, forty, etc.... I would like to be able to do this without having to snap to the last copied object (as the standard copy command would be used for). The type of work I do, the drawings can be very busy and snaps can move too easily. The other reason is for speed. Hopefully I have been clear in what I need. Thanks for the help with this one and thank you for the help I've already taken from this website. -Nobull
  16. I have this block of text as you can see in the image below, and in the window show me this "VIGA V-SS01 (.25X .50)", BUT I DONT WANT THAT SHOW ME THIS. I want to the program ask me a question first, for example: What is the name? so I will set the answer of this question in the block I have. SO, I want to have this in the window "VIGA V- (AND THE ANSWER OF THE QUESTION)" EXAMPLE: Computer: What is the name? User write: L22 Then, that will show me: "VIGA V- L22" I will glad if you can help me, If you have already notice, I dont know to much about the topic.
  17. Hello Everyone, I'm working on a GIS Application which is running with AutoCAD, in that we are placing some lines and structures, while placing that the annotation will be placced automatically middle point of that poly line. after that we need to align that as per the below image. is there any possible to align the blocks automatically. steps would be Select two Blocks--->Select the Line then the blocks should be alined automatically as per the below image. can anyone help me on this. Thanks in advance. Sample.dwg
  18. is there an easy way to call a variable value from another lisp - I googled this and there are varieties of answers that I do not understand. If it is possible, I would like to call variables azi, eebb and deee from this lisp into other lisps. When I set my true north to be say: 80 degrees, I would like to take this already set value on this lisp and create another lisp to do (- azi newvaliable) for example. Can someone help please? (defun c:azi () (setq temperr *error*) (setq *error* trap1) ; set Barricades width (if (not azi)(setq azi 0.00)) (setq eebb (getangle (strcat "\nTrue north Direction <" (angtos azi) ">:"))) (if (not eebb)(setq eebb azi)(setq azi eebb)) (setq deee (/ eebb 2)) (princ) ) ;defun
  19. This post is very similar to what I intended with rotating blocks by first determining True North and then new azimuth from true north (I succeeded in doing that one no perfectly but it does most of what I wanted). I did try, in the past to obtain some dxf entities from blocks but am clueless when I look at the result. I would like to see, in each drawing file: set an arrow block to North then with a magical lisp each time I enter the command I would like the an insert of the block with inputting new degree from the North to be inserted. and to top it off, if there is a way for the degree to show up on the #### that would be excellent. I also cannot figure out an efficient way to flip the text so it always shows the text correctly but that is another problem. Is there anyone that can cook something up for me please? in the past, BIGAL had helped me a lot in determining my block rotation but this seems it has a lot of DXF entity I cannot figure out! I played around with this lisp but cannot do much! (vl-load-com) (defun c:IR ( / centro angR Fr obj) (setq centro (getpoint "\nSelect Block Insertion Point : ") angD (getreal "\nEnter Rotation Angle for Block in Degrees : ") Fr (getstring "\nEnter Force applied : ") angR (* pi (/ angD 180.0)) );end_setq (command "_-insert" "r" "_s" "1" centro (angtos angR) Fr (strcat (angtos angR) "%%d")) (setq obj (vlax-ename->vla-object (entlast))) (if (< (/ pi 2) angR (* (/ pi 2) 3)) (foreach prop (vlax-invoke obj 'getdynamicblockproperties) (if (= (strcase (vla-get-propertyname prop)) "????") (vla-put-value prop (vlax-make-variant 180.0 (vlax-variant-type (vla-get-value prop)))) );end_if );end_foreach );end_if (princ) );end_defun (princ) Thank you Arrows.dwg
  20. Hey all, I have a block (attached) that I'd like to insert into a drawing and after it's placed I'd like to populate the "PointNo" and "Descr" attributes with some user inputted data. I honestly have no idea where to start and appreciate any and all starting tips or help. Thanks, JT COORD ID.dwg
  21. Hello, i want to ask if it possible to create lisp who can change coordinates on multiple polyline. Something like, few polylines with coordinates (№ X Y) 1 100 200 2 200 250 3 300 210 4 150 220 5 110 250 and i want to export in .txt file all of the lines and their coordinates and change them, after the change i want to replace this coordinate(№ 1,2,3,4,5) with the new. Something like export-->change-->and replace Same line but with other coordinate. Sorry for my english. Thak you
  22. Hi Guys, I have an AutoLISP that creates an Excel sheet from selected table in an AutoCAD Drawing. It exports tables formed by lines and texts, also recognizing what should be merged cells. It opens a new Excel spreadsheet and fill the respective cells. Works like a charm for the job I need to do. However, It does have a flaw. It doesn't saves the generated sheet. I have to do it manually. Can you guys please help-me to complete this LISP? I Have zero programming knowledge. What I'd like it to do is to save the generated spreadsheet in the same folder as the autocad file, with the same name as the autocad file. Lilke DWG001.DWG would save a spreadsheet called DWG001.xls I'll attach my current AutoLISP file. Thanks in advance, guys. TE_TableExport_Exporta tabelas com linhas e textos para Excel.lsp
  23. I would like to modify this lisp script so that the dimension has a centered text instead of on a side of the dimension. But i don't know how. (defun c:HD (/ HD_LineHouse HD_LineProperty HD_Point1 HD_BasePoint1 HD_Text1 HD_Point2 HD_BasePoint2 HD_Text2 HD_ActiveDoc HD_ActiveSpace) (if (and (setq HD_LineHouse (car (entsel "\nSelect house line : "))) (setq HD_LineProperty (car (entsel "\nSelect property boundary: "))) (= (vla-get-ObjectName (setq HD_LineHouse (vlax-ename->vla-object HD_LineHouse))) "AcDbLine") ) (progn (setq HD_LineProperty (vlax-ename->vla-object HD_LineProperty)) (if (not (vl-catch-all-error-p (setq HD_Point1 (vl-catch-all-apply 'vlax-curve-getClosestPointTo (list HD_LineProperty (setq HD_BasePoint1 (vlax-safearray->list (vlax-variant-value (vla-get-StartPoint HD_LineHouse))))))))) (progn (setq HD_Point2 (vlax-curve-getClosestPointTo HD_LineProperty (setq HD_BasePoint2 (vlax-safearray->list (vlax-variant-value (vla-get-EndPoint HD_LineHouse)))))) (setq HD_Text1 (polar HD_Point1 (angle HD_BasePoint1 HD_Point1) 0)) (setq HD_Text2 (polar HD_Point2 (angle HD_BasePoint2 HD_Point2) 0)) (vla-StartUndoMark (setq HD_ActiveDoc (vla-get-ActiveDocument (vlax-get-acad-object)))) (vla-put-TextPosition (vla-AddDimAligned (setq HD_ActiveSpace (vla-get-Block (vla-get-ActiveLayout HD_ActiveDoc))) (vlax-3d-point HD_BasePoint1) (vlax-3d-point HD_Point1) (vlax-3d-point HD_Point1)) (vlax-3d-point HD_Text1)) (vla-put-TextPosition (vla-AddDimAligned HD_ActiveSpace (vlax-3d-point HD_BasePoint2) (vlax-3d-point HD_Point2) (vlax-3d-point HD_Point2)) (vlax-3d-point HD_Text2)) (vla-EndUndoMark HD_ActiveDoc) (mapcar 'vlax-release-object (list HD_ActiveSpace HD_ActiveDoc)) ) ) ) ) (princ) ) HD-Automatic Dimension.LSP
  24. Dear all, Do you have a lisp to labelling horizontal line or vertical line coordinate, just the line's Northing or Easting coordinate parallel to line ,it can be above ,under or on line, can chose location. and can labelling several lines one time. thanks a lot.
  25. Hi guys & gals, I came across a very repetitive problem. While working with a certain type of software data is output to *.dxf as set of 3D polylines and text. From the level of software I work with, I cannot configure any text formatting details. Hence an idea to ask You few questions. 1. Is there any way of rotating text based on azimuth of a 3Dpolyline which lies within 0.3m distance from the text base? Did someone ever came across LISP of this type ? 2. is there any other (more effective) way than OVERKILL to get a rid of duplicated text ? Thank you in advance ! Regards, Adam, Geophysicist.
×
×
  • Create New...