Jump to content

Search the Community

Showing results for tags 'lsp'.



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

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 31 results

  1. Hello, I have this very helpful LSP that will add the current annotative scale and delete all other scales for any type of annotative object. Is it possible to modify this LSP so that all objects in the workspace can be selected and this same function can be run instad of doing each object one at a time? CH-ASC.LSP
  2. Hello, is there a way to combine the move command with the M2P or FROM command modifiers using LISP? I would want these to be two separate commands. Ideally I would like to program F1 to do _m2p during an active line command and F2 to do from during an active line command... but I'll settle for a lisp that combines each with the move command since I'll be doing that most frequently. Thank you in advance! P.S. here is code that will draw a line starting at M2P.. sort of a start.
  3. This is a very simple one.. I am so inexperienced with writing LSPs. This command adds the current annotative scale for the object. Instead of retyping it I want to assign it to a shorter keyboard shortcut such as "ASA" _AIOBJECTSCALEADD
  4. Anyone know of a .lsp that can rename some text in a dynamic block similar to tcount? I have data racks in a line and they're all dynamic blocks with the default "XX" in the middle. I was wondering if there is a lsp to automate this similar to tcount? example (all dynamic blocks with text in the center - as part of the block itself):
  5. Hello, new user here! I have an old LSP that I've always run with a VBE that takes a portion of the file name and inserts it into an attributed block inside all the drawings in a directory that are named accordingly. Example file name: DCA-ABC-123456789-E001 R0 (drawing number).dwg Each set of characters in the file name will change from project to project as they are project based. We have a DCA block that is called "dca_stmp" that we use in order to create change paper for clients which they then incorporate into their drawings of record. Many times, we have hundreds of these and there are times that we have to re-number them if someone adds a drawing to the package because they're supposed to be in Alpha-Numeric order by drawing number. It is TERRIBLE to have to re-number them all manually by file name AND inside the drawing stamp, so we try to leave them as "DCA-WEH-112177115-EXXX R0 (drawing number).dwg" until the latest possible point in the project. It worked great until we jumped from AutoCAD 2012 to 2016 and now it runs as if it is making the changes, saves the drawings, but doesn't change the block. I have attached the LSP, but it will not allow me to upload the VBE... can anyone help me figure out what I need to do to make this work again?? It has been MANY years since I took classes on LSP and my knowledge is so basic that I can't figure out what is wrong much less how to fix it. FileNameToDCA.lsp
  6. Hello, I was wondering if anyone is able to create an MLeader style based on the parametrs below and set it to the current Mleader style in LSP code? Also could the new MLeader style be named "Alpha". I am completely aware that there is a way to just copy over the MLeader style, and this is not my goal. I am looking for the code to automate this! I want to be able to add it to the startup LSP so that it is present and set to current every drawing that is opened. This would be a huge help for our CAD group. Here are the MLeader settings that need to be hard coded: Thanks in advance.
  7. I have attached an AutoCAD 2010 file as an example of what i am about to try and explain. Please bare with me. I can export the x/y information in itself using the ptExport.lsp routine. I haven't found a way of exporting the entity information because i can't seem to get that one working. (both lsp files attached) What i actually require is being able to extract the polygon x,y, information along with the corresponding text within the polygon itself i.e ITRD 33651 37, and ideally the entity handle itself. If you understood that, firstly thanks. If you know how to help then i would forever in your debt. Thanks in advance for looking Note i have to do this for somewhere in excess of 5000 polygons!! GULP! Basket.dwg PtExport.lsp gethandle.lsp
  8. Hello, My manager made this LSP file for me and it doesn't work and we are both not sure why. Seems correct to me. How it works: Creates the E-Anno-Note layer, otherwise makes it current, then creates an MLeader (to avoid creating leaders on incorrect layers). (DEFUN C:NN () (setvar "cmdecho" 0) (if (not (tblsearch "layer" "E-Anno-Note")) (command "-layer" "n" "E-Anno-Note" "c" "2" "E-Anno-Note" "")) (command "-layer" "m" "E-Anno-Note") (COMMAND "mleader") (princ) ) Thanks!
  9. Hello, Does anyone know of a LSP out there that will number the selection below properly without editing each piece of text?
  10. Okay, here's the deal. I need a LISP that calculates phase balance which is basically percent error between two numbers in the following form. However, we need it to take a selection and find the largest number, smallest number and make the following calculation, regardless of the numbers in the set. (Big - Small)/Big * 100 = X.X% Currently, we use an ADD.LSP which takes a selection and adds up the numbers. I am not familiar enough with the programming in order to take this relatively simple arithmetic and make it a working LSP. I have attached the ADD command if anyone is able to do something like this. add.LSP It should work by making a selection, then prompting the user to select where to place the phase balance (By adjusting the selected text to the updated value X.X%).
  11. Dear friend please help me. I have got XY coordinate label bt this was not dynamic and also it wat leader only and not scaled the text as required. So anybody can make it dynamic label for XY coordinate. Just like as multileader????
  12. I have been trying to figure this out for a couple of days now. The only thing I could find is this LISP that takes the Ellipse properties and uses them to creat an arc. When I use this, the start and end angles are not correct in the drawing. Ellipses must have been drawn in a different UCS). I have tried to get the LISP to use the start and end points of the ellipse along with the radius and center point. For the life of me I cannot figure it out. If anyone knows how to do this please let me know. *NOTE* Elllipses that I am trying to convert have the same minor and major radii. Thanks in advance!! (defun c:e2a (/ acaddoc acadms acadobj center endangle obj radius ss ssn startangle) (vl-load-com) (if (setq ss (ssget '((0 . "ellipse")))) (progn (setq acadobj (vlax-get-acad-object)) (setq acaddoc (vla-get-activeDocument acadobj)) (setq acadms (vla-get-modelspace acaddoc)) (setq ssn (ssname ss 0)) (setq obj (vlax-ename->vla-object ssn)) (if obj ;(equal (vla-get-RadiusRatio obj) 1 0.0001) (progn (setq radius (vla-get-MajorRadius obj)) (setq Startangle (vla-get-Startangle obj)) (setq Endangle (vla-get-Endangle obj)) (setq Center (vlax-get obj 'center)) (entdel ssn) (vla-addarc acadms (vlax-3d-point Center) radius Startangle Endangle) ) ; progn (alert "> Ellipse objects failed to be converted") ) ; if ) ; progn ) ; if (princ) ) ; defun [/Code]
  13. First of me, Hi to everyone! Glad to be part of this. I am pretty new to this forum so as to AutoCad software, I am GIS maniac. Currently working on some urban plan and my company need to calculate area of existing polygons, hatches and polylines. A lot of people worked on same project and that is why we have different types of geometry. I can manually change all of this to closed polylines but there is over 2000 polygons and hatches. Is there any lsp which can calculate all types of geometry? I tried many but they are just calculating closed polylines. Thank you very much and sorry for bad english
  14. Hi All. This is my second attempt to post this since somehow I was logged out automatically. Thankfully I had most of this saved via a notepad file. Now down to business: I'm good with CAD, but when it comes to LISP, i'm a complete beginner. My boss/manager has asked me to create a LISP routine that will be run with a command from the command line and will receive user input to compare to ordinate dimensions within the drawing. I've been on this for two days, trying to wrap my head around even the basics and I can tell you my brain hurts. Programming of any sort is not my forte, i'm still struggling with getting HTML down. Anyways, the reason why my boss would like this is because sometimes our drawings have from a dozen to 50 or so ordinate dimensions and it's tedious to go and check them all against a point. My boss has given me free reign on how to design this sucker, but I'm stumped at how to program it as I'm a newbie. Below is what the lisp routine should be able to accomplish. The idea for the LISP is this: 1.) Load the lisp up and have it start with a defun C: command. 2.) have the user pick an 'origin' point for comparison (because we don't always use 0,0,0). 3.) the lisp takes this point and stores it. 4.) It scans the drawing for Ordinate Dimensions only. 5.) It compares the origin point of the user to the origin point of the ordinate dimensions. (I figure this would be the endpoint closest to 0,0,0. So for instance, if we have 15 dimensions, there are 30 endpoints. The 15 closest endpoints would be the ones that are compared to the origin point of the user.) 6.) It creates a new layer called DIM_WRONG [or whatever] and makes the layer RED. 7.) It draws attention to the incorrect ordinate dimensions (the ones scanned and compared to the user's origin point) by drawing either a red box around the dimension or a rev cloud. these rev clouds are placed on the DIM_WRONG layer, with the layer set to not plot. This way we can easily check between 15 and 30 and more ordinate dimensions with a few clicks. There would be a tolerance in the comparison, up to 1/64 of an inch tolerance. If the ordering steps needs to be adjusted because of programming structure, so be it, it just needs to compare those ordinate dimensions with a user assigned origin point, entered by keyboard or mouse. Again, I'm a beginner with Lisp and I've been trying to get segments done and have been only able to get 4 of the easy ones done (from that list). I've never been good at programming with anything. Any help would be vastly appreciated and I thank you for any advice/knowledge that you can bestow.
  15. Morning All, Habitual LT user here - so no lsp before. Been given 2 month access to a 2014 license to get this job out of the door. I'm trying to create a lsp that grabs the content of a drawing, selects objects by layer and groups them using the layer name as the group name. I've found a couple of lsps that do some of what I want so I've been pulling them to bits and trying to create what I need, but I'm stuck. I've managed to get to a point where I've got a list of the layers and start the group command but I cant get the group names to work. I'm not demanding a full lsp, but would very much appreciate some guidance on how to approach this one. I've gone through the tutorials on Afralisp and some of the other threads but I just don't seem to be making any progress. There's 41 layers in most of these drawings, I don't really fancy doing it manually... PS I cant access any of Autodesks online help as apparently our IT guys have classified it as an "unsafe site".
  16. Hi Everyone, I've been lurking here for over a year now and have found lots of useful information (thanks!), but I've finally done something that doesn't seem to have been solved before, and that there may be no easy answer to. We use a complicated system of layer states, views, and freezing and unfreezing layers to set up different print states to create a package of drawings. It is sort of a wacky use of AutoCAD, but this is due to the necessity of showing an opera as it progresses through time (Act 1, Act 2, etc.). We have hundreds of operas in our repertory and this won't be changing anytime soon. Anyway, as it stands now, there is a .txt file that lives in the same directory as the file containing the scenery that is manually created so that print scripts can work. I am attempting to turn that .txt file into something that lives in a dialog box for ease of use and cleanliness. The data will be stored in a mulitline attribute in a block. I've spent a fair amount of time creating a dialog box that changes size dynamically, allows for reordering of printouts and having multiple scenery layers appear on the same printout. My only real issue (which is of course a big one) is that if you add too many rows, the dialog box becomes too big to fit on the screen. What I would love to be able to do is to make the whole box (except the buttons at the bottom) scroll up and down so that the height of the dialog box is fixed to the smallest screen we use here (~800 pixels). I've spent a little time with OpenDCL but find it a bit byzantine, and I don't know any .NET or VBA so either of those solutions will involve me learning some new programming languages--not necessarily a deal breaker but not ideal either. I'm attaching a .dwg with the attributed block and the .lsp file for anyone who wants to take a look. The command c:met_plot_2015 will create and open the dialog box, which you can then manipulate. I appreciate anyone who read to the end of this post, and any help you can provide. Thanks, Eric P.S. The printing function doesn't actually work yet; that's next on the list once I solve this. specialblock.dwg BETTERPRINTING 5.LSP
  17. I’d like to know if you have one LSP that links points with some 3D POLY LINE between then. Something like an outline, just like this: It is link points given by coordinates. I upload from a device the coordinates and import points to AutoCAD, but I have to link them like the picture. It doesn't have an order, but the 3d lines are only the outside. It will be good if I can select them to link or even link by layer, because I work with tunnels and each point represents the edge of it.
  18. highrez2

    Lee Mac Junky

    Lee helped me out a while ago, Thanks Lee. now I find myself pushing further how do I modify or add to his code "ObjectDBXWrapper" to select sub directories?
  19. I am using ACAD 2013. I am new to using lsp files. Is it possible to combine 3 lsp routines that I regularly run to prepare files for a different software program? Is it possible to use the combined lsp routine to batch process multiple files in a folder? Is it possible to modify the 1st code to open the new file automatically? ;changes layout to model space, appends filename, option to open new file (defun c:L2M ( / BASE LST OLD_DIA) (setq old_dia (getvar 'FILEDIA) base (strcat (getvar 'DWGPREFIX) (vl-filename-base (getvar 'DWGNAME))) ) (setvar 'FILEDIA 1) (setq lst (layoutlist)) (foreach l lst (command "_.ctab" l "exportlayout" (strcat base "-" l) ) ) (setvar 'FILEDIA old_dia) (princ) ) ;Sets linework to by layer, layers to color 7 white, detaches external references (defun c:set7 () (setq uecho (getvar "cmdecho")) (setvar "cmdecho" 0) (command "setbylayer" "al" "" "n" "y") (command "-layer" "c" "7" "*") (command "-xref" "d" "*") (setvar "cmdecho" uecho) (princ) ) ;Justify text (defun c:BL (justify title / ss) (princ (strcat "\nSelect *Text to " title " justify: ")) (if (setq ss (ssget "_:L" '((0 . "ATTDEF,MTEXT,TEXT")))) (command "_.justifytext" ss "" justify) ) (princ) ) (defun c:JL (/) (_justifyIt "_ML" "Middle Left")) (defun c:JC (/) (_justifyIt "_MC" "Middle Center")) (defun c:JR (/) (_justifyIt "_MR" "Middle Right")) (defun c:BL (/) (_justifyIt "_BL" "Bottom Left")) (defun c:BC (/) (_justifyIt "_BC" "Bottom Center")) (defun c:BR (/) (_justifyIt "_BR" "Bottom Right")) (defun c:TL (/) (_justifyIt "_TL" "Top Left")) (defun c:TC (/) (_justifyIt "_TC" "Top Center")) (defun c:TR (/) (_justifyIt "_TR" "Top Right")) I don't know who the code authors are to give credit.
  20. Dear Friends , Please Help Me out With This rcc beam LSP file IT is Not Working, Some thing is missing in this, i am attaching my lsp file for ur refrence.... its asking output file. i dont have that file beams (2).LSP
  21. Dear Friends , Please Help Me out With This LSP file IT is Not Working, Some thing is missing in this, i am attacheing my lsp file for ur refrence.... its asking output file. i dont have that file
  22. Hi everyone, I have this script that will not work when a try to batch run it through Autoscript, however if I paste it dirctly into the command line it works no problem. Obviously I dont want to open each drawing up and paste as I have more than 2500 dwg. Any help please? Thanks in advance, Tom SELECT (ssget "x" '((2 . "AMAZON-LOCKER-08,AMAZON-LOCKER-10,AMAZON-LOCKER-11,AMAZON-LOCKER-13,AMAZON-LOCKER-14,BALER-1800HD,BALER-360,CC-CAT105,CC-HPZ2100-24,CC-HPZ2100-44,CC-HSB,CC-HSC,CC-KM4850,CC-LFB,CC-LFC,CC-SSB,CC-SSC,CC-SSF,CC-WF-LAMINATOR,CC-X4595-HCF-SF,CC-X4595-STD,CC-X4595-STD-F,CC-X4595-STD-HCF,CC-X5655,CC-X6204,CC-X7435,CC-X7655,CC-XDC252,CC-XDoc12-XDoc252,CC-XDOC252,CC-XDOC252-SM,CC-XER4595,CC-XWCP-90,CHAIR-FURN-SELECTOR-STATION,ENDLESS-AILSE-STATION-1,ENDLESS-AILSE-STATION-2,HOT-BUY,OMNI-BEACON-KIOSK,OMNI-CHAIR-KIOSK,OMNI-HUB-TABLE,OMNI-INK-FINDER-KIOSK,OMNI-SATELLITE-KIOSK,P@SS,ROLL-HOLDER-RACK-SPINNER,2PLUG,3PLUG,4PLUG"))) _.chprop layer laydel qsave
  23. To anyone out there, I'm working on a project and I need to get a block count of a select number of blocks within model space broken down to the various visibility states . I've used some of the Lee-Mac.com .lsp's, which work awesome but what i'm looking for is a combination of the three .lsp files. To put it simply how can I add a breakdown of visibility states to the COUNT.LSP that can be found on Lee-Mac.com. Thanks in advance. cadtutor.net newbie
  24. I have been getting back into lisp, after I had a class that scratched the surface of lisp, I never looked back on it until now. This is my first lisp command written without copying it from a book! (defun c:ibeamp() (setq pw (getdist "\nEnter Beam Width: ")) (setq ih (getdist "\nEnter Inner Height: ")) (setq pt (getdist "\nEnter Plate Thickness: ")) (setq po (getdist "\nEnter Overhang Distance: ")) (setq ip (getpoint "\nInsertion point: ")) (setq p2 (polar ip (dtr 180.0) (/ pw 2))) (setq p3 (polar p2 (dtr 270.0) pt)) (setq p4 (polar p3 (dtr 0.0) po)) (setq p5 (polar p4 (dtr 270.0) ih)) (setq p6 (polar p5 (dtr 180.0) po)) (setq p7 (polar p6 (dtr 270.0) pt)) (setq p8 (polar p7 (dtr 0.0) pw)) (setq p9 (polar p8 (dtr 90.0) pt)) (setq p10 (polar p9 (dtr 180.0) po)) (setq p11 (polar p10 (dtr 90.0) ih)) (setq p12 (polar p11 (dtr 0.0) po)) (setq p13 (polar p12 (dtr 90.0) pt)) (command "line" ip p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 "c" ) (princ) ) (defun dtr (x) (* pi (/ x 180.0)) ) (princ) this draws a very general I-beam. Any feedback is appreciated, constructive more so
  25. Bill_Myron

    Convert Ellipse to Arc

    I have been trying to figure this out for a couple of days now. The only thing I could find is this LISP that takes the Ellipse properties and uses them to creat an arc. When I use this, the start and end angles are not correct in the drawing. Ellipses must have been drawn in a different UCS). I have tried to get the LISP to use the start and end points of the ellipse along with the radius and center point. For the life of me I cannot figure it out. If anyone knows how to do this please let me know. *NOTE* Elllipses that I am trying to convert have the same minor and major radii. Thanks in advance!! (defun c:e2a (/ acaddoc acadms acadobj center endangle obj radius ss ssn startangle) (vl-load-com) (if (setq ss (ssget '((0 . "ellipse")))) (progn (setq acadobj (vlax-get-acad-object)) (setq acaddoc (vla-get-activeDocument acadobj)) (setq acadms (vla-get-modelspace acaddoc)) (setq ssn (ssname ss 0)) (setq obj (vlax-ename->vla-object ssn)) (if obj ;(equal (vla-get-RadiusRatio obj) 1 0.0001) (progn (setq radius (vla-get-MajorRadius obj)) (setq Startangle (vla-get-Startangle obj)) (setq Endangle (vla-get-Endangle obj)) (setq Center (vlax-get obj 'center)) (entdel ssn) (vla-addarc acadms (vlax-3d-point Center) radius Startangle Endangle) ) ; progn (alert "> Ellipse objects failed to be converted") ) ; if ) ; progn ) ; if (princ) ) ; defun
×