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


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...

Found 490 results

  1. hopefully you can read the red text on the picture as it explains what i'm looking for...if not, let me know and I'll type it out again. thank you
  2. Hey guys! How's going? Can anyone help me? Look: i need to place a lot of blocks in an extensive polyline but the blocks need to have a specific distance from the polyline beginning - and this distance will not be equal to each block. So, i thought in create a list (excel or csv file) and specify each block name and distance to the lisp read the archive and place the block at correct point. Did you get it? PS: remember that the blocks will not have the same interval distance. This is an example for the list layout. And the result is something like this: I hope you guys could understand and help me! - sorry for my english - Thanks! Much love from Brazil Wellington Moura
  3. 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.
  4. 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!
  5. 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!
  6. 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)
  7. hanhphuc

    HP BUTTONS.lsp

    Version 1.0.1

    52 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
  8. 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
  9. 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.
  10. 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.
  11. 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
  12. 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
  13. 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!
  14. 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
  15. 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!!
  16. Sambuddy

    DCL Suffix Prefix

    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!
  17. 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
  18. 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.
  19. 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
  20. I have a drawing that has two different blocks (see attached), what I needed to do was transfer over the attributes of one block over to the other (both have different tags). For example copying over attributes in "rev0_date" from the first block tag over to "revslot1date" in the second block tag , I ran across some code in the forums that did just that created by Lee Mac.The problem with it is it only transfers one attribute over, I modified it a little but its still not exactly what I need. The way it currently works is - It asks me to choose the first block with the attributes to copy, once selected it then asks me to choose the second block that will have the attributes pasted to it, once I've selected them, it then pastes the first specified tag attribute in the first block to the second, after that I have to repeat the process again, clicking the block with the attribute to copy and then choosing the second block to paste, I have to keep repeating these steps, clicking the first block then the second over and over until all the tag attributes have been copied over. My question is how can I stop having click the first and then second block over and over again for each tag and instead only have to go through the process once (click first block, then second and then transfer all the attributes over at once). Here is my current code (sorry if its a mess I'm very new to this): (defun c:blockswap ( / _SelectBlockWithTag a b des src tag ) (vl-load-com) (setq DAT1A "Rev0_Date" ; Source Attribute Tag 1 DES1A "Rev0_Desc" ; Source Attribute Tag 2 REV1A "Rev0" ; Source Attribute Tag 3 RDB1A "Rev0_Drawn_By" ; Source Attribute Tag 4 REV1B "RevSlot1Number" ; Destination Attribute Tag 3 DES1B "RevSlot1Description" ; Destination Attribute Tag 2 DAT1B "RevSlot1Date" ; Destination Attribute Tag 1 RDB1B "RevSlot1DrawnBy" ; Destination Attribute Tag 4 ) (defun _SelectBlockWithTag ( tag / e a ) (setq tag (strcase tag)) (while (progn (setvar 'ERRNO 0) (setq f (car (entsel (strcat "\nSelect Block with attribute " tag ": ")))) (cond ( (= 7 (getvar 'ERRNO)) (princ "\nMissed, Try Again.") ) ( (not f) nil ) ( (and (eq "INSERT" (cdr (assoc 0 (entget f)))) (= 1 (cdr (assoc 66 (entget f)))) ) (if (not (setq z (vl-some (function (lambda ( x ) (if (eq tag (strcase (vla-get-tagstring x))) x) ) ) (vlax-invoke (vlax-ename->vla-object f) 'getattributes) ) ) ) (princ (strcat "\nBlock does not contain tag " tag ".")) ) ) ( (princ "\nInvalid Object Selected.") ) ) ) ) z ) (and (setq aa (_SelectBlockWithTag DAT1A)) (setq ab (_SelectBlockWithTag DAT1B)) ) (vla-put-textstring ab (vla-get-textstring aa)) (and (setq ba (_SelectBlockWithTag DES1A)) (setq bb (_SelectBlockWithTag DES1B)) ) (vla-put-textstring bb (vla-get-textstring ba)) (and (setq ca (_SelectBlockWithTag REV1A)) (setq cb (_SelectBlockWithTag REV1B)) ) (vla-put-textstring cb (vla-get-textstring ca)) (and (setq da (_SelectBlockWithTag RDB1A)) (setq db (_SelectBlockWithTag RDB1B)) ) (vla-put-textstring db (vla-get-textstring da)) (princ) ) drawing.dwg
  21. 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
  22. So the problem im having is i have code that runs to show the offset of measured points to design points, unfortunately the code works by inserting one of 4 predefined blocks for NSEW, or one of 4 when in 2 directions; only showing orthogonal distances. These work by passing through the distance to the block tag, and then comparing the EW, and/or NS values to determine the correct arrow direction to insert the correct block. What i want is instead of using orthogonal distances, is to have an arrow block within these blocks, that changes the direction of the arrow, based on a bearing that you pass through. eg if the horizontal distance between 2 points is 25mm at a bearing of 45 degrees, then a tag is created as per normal with 25 and an arrow point 45 degrees. Any good ideas? I've looked in the forums and couldn't find anything to solve this. Attached is an image of what i have currently made, note the aligned one showing 130mm is kinda what i want, but that arrow is not dynamic, it just goes left or right and the whole block is just rotated to show the bearing. It makes for a messy plan and a lot of neck craning to present to a client
  23. 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
  24. 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
  25. 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
×
×
  • Create New...