Jump to content

Search the Community

Showing results for tags 'autolisp'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions

Categories

  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

  1. Hi I have written a Lisp routine (shown below) that measures the distance between two points, and applies a scale factor that is written within the lisp, and displays it within the command line. Although the lisp functions, it may not be the 'cleanest'. I was wondering if it was possible to add a function to the lisp that in addition to displaying the newly calculated distance, will display a bearing. ideally, the bearing displayed would be written in a Degrees Minutes Seconds format, and not directional bearings (Ex. N73°25'45"W would be displayed as 286°34'15"). In the language of the lisp I have written, from 'x1', North is 0°, and the angle is turned clockwise from north, to a line drawn between 'x1' and 'x2'. Any help would be great. If anyone has a lisp that already does this, or can amend my lisp to do it, that would be perfect. Thanks Ahmed ;Use this command to measure the distance between two points while applying a Combined Scale Factor ;Be sure to copy this lisp to your job folder, and set your CSF as required. Do not change CSF outside of job folder. ;Ahmed F. 2017 (defun c:DM () (setq TD 0) (setq x1 (getpoint "\nSelect First Point: ")) (setq x2 (getpoint x1 "\nSelect Second Point: ")) (prompt (strcat (rtos (distance x1 x2)) (rtos (setq TD (+ TD (/(distance x1 x2) 0.999848)))) ) ) (prompt (strcat "\nTotal Distance = " (rtos TD))) (princ) ) thanks again.
  2. Think VLIDE but from the year 2018 instead of 1999. More info: https://www.cadnauseam.com/2018/02/20/bricsys-shows-autodesk-how-to-do-mid-term-updates-again/ Screenshot:
  3. Hi there, here a thing I want the do with LISP: I want to change multiple Objects with different Layers, that each Layer change to a different Layer. Example: Select entities with (ssget "_:L" '((8 . "Layername1, Layername2, etc"))) Now change Layer: Layername1 → 1_Layername1 Layername2 → 1_Layername2 I don't want to select each entity and than change its Layer. I want to do all entities at the same time with one command.
  4. Hi, I have a Lisp that paste a file in a folder that require admin access, but is not all users that have a admin access account. So, there is some way to get the admin access with Lisp? Like, write my admin username and password in the Lisp file, and when required, use these information? Thanks!
  5. Hello all. First off let me thank Lee Mac for all that he does with LISP and how he helps others out. He is a great value to the community. Now for the question I have been trying to get his Tip of the day lisp working. I have the lisp in my startup suite, it and the text file are both in a support file search path, and it does not show a tip at the start of the day. The Lisp does load because I can type (LM:tip) and it shows a tip, it just does not show anything for the first dwg of the day. Could the issue be that I am using Civil 3D 2015, maybe so variable that is causing the problem? http://www.lee-mac.com/tipoftheday.html
  6. Hello, I'm using Lee Mac cad lisp program "PolyInfo V 1.3." for exporting polylines vertex coordinates. But for full work joy I need some modifications. URL for program: http://www.lee-mac.com/polyinfo.html URL for code: http://www.lee-mac.com/lisp/html/PolyInfoV1-3.html As you saw the program exports a lot of information about the polyline. So i want to modify the code that will export just polyline start vertex points x and y coords in two columns ( my cad version information exports to txt file ). The result should look like this: ________________________________ Polyline starts points x 649542.45 649542.35 649542.28 Polyline starts points y 495232.54 495232.23 495232.41 ________________________________ Can someone help to figure out which part of code I must to modify to get the result i want? Please.
  7. I have been experimenting with generating variables through code rather than defining them manually. The problem is that when the program creates them, they are defined as global variables. Is there a way to generate them as local variables instead? Below is the sample code that I wrote for testing it. ;ListToVariables creates variables named testvar0, testvar1, testvar2, etc. ;Each newly created variable contains the contents of the correlated slot from testlist. (defun c:test ( / testlist ) (setq testlist (list "aaa" "bbb" "ccc" "ddd" "eee")) (ListToVariables testlist) ) (defun ListToVariables ( listname / i ) (setq i 0) (repeat (length listname) (set (read (strcat "testvar" (rtos i 2 0))) (nth i listname)) (setq i (1+ i)) ) (princ) )
  8. What is the way to add already highlighted objects to a selection set? I feel like I have seen the answer before but I cant remember what I searched to find it. Like how you can select object before you use the move command and autocad will move the objects that were already selected. I am looking to use the TSPACEINVADERS command and have the selected text then have a red circle put around them. Thank you for any help in advance.
  9. Is there a quick and practical way to get X & Y values on a polyline other than by way of "LIST". because I need the X & Y value just like the 2nd image. Thank you Master. img 1 : https://drive.google.com/open?id=0B1KbDu2x_byvU2F6NlpvNWJrU0k img 2 : https://drive.google.com/open?id=0B1KbDu2x_byvVE9qdmpBLWcxWHM
  10. I have a bit a head scratcher. I want a lisp that when run I will be able to select the whole drawing and all the mleaders will automatically justify to the side that the leader and arrow is on. Occasionally our leaders get move and it is time consuming to change them individually. Any help would be greatly appreciated.
  11. I have the code below to place a block on a point. Then array that block based on information given by the user. Then move all of the blocks so that the insertion point is the top and center of all the blocks. It works fine sometimes but about half the time it it skips the first move command. Could someone tell me what I am missing? (DEFUN C:COMEDARRAY ( / OLDL NOR NOC CEB CEP ) (SETQ OLDL (GETVAR "CLAYER")) (COMMAND "_LAYER" "SET" "ELEC-CE" "") (SETQ NOR (GETINT "\nENTER NUMBER OF COMED ROWS: ")) (SETQ NOC (GETINT "\nENTER NUMBER OF COMED COLUMNS: ")) (setq CEP1 (getpoint "\nPICK INSERT POINT FOR BLOCK: ")) (COMMAND "_INSERT" "S:\\LightSett\\LISP FILES\\LISP USED BLOCKS\\COMED PROFILE.DWG" CEP1 "" "" "") (SETQ CEB (ENTLAST)) (COMMAND "_ARRAY" CEB "" "R" NOR NOC 0.6667 0.3333) (SETQ CEP (SSGET '((0 . "INSERT")))) (COMMAND "_MOVE" CEP "" CEP1 (cons (- (CAR CEP1) (/ (* NOC 0.3333) 2)) (CDR CEP1))) (COMMAND "_MOVE" CEP "" CEP1 (LIST (CAR CEP1) (- (CADR CEP1) (* NOR 0.6667)) (CADDR CEP1))) (command "layer" "set" OLDL "") (PRINC) )
  12. Hi Lisp Legends, Actually i am new to autolisp, just now reviewed cadtutor.net, excellent works done by members here. Thanks in advance to those peoples:) I need a urgent help from you friends.... actually I need to align text(as shown in attachment) to three different positions of a block(red coloured). Is there any lisp to get the text aligned to those positions. further explained in attached image Please revert for clarification if any required. Awaiting for your response. Thanks amb sample.dwg
  13. I want to create a auto lisp programme for following As input i want to select one line from model space in auto cad and as output i want table that display length of line and whenever i change length of line, table should automatic update new length I am using auto cad 2014
  14. Hello, I have a question for all those lisp masters out there. The company that I work for has had me learning and creating lisp for them for a couple months now and we are starting to get a library of lisp built up. Currently I have all of the lisp being loaded at startup through the appload command. I have decided to use Lee Mac's Autoloader when necessary, but I was wondering at how many lisp would it be wise to do that for instead of at startup? Right now the PCs in the office are not filling slow (They are what I would consider to be in the middle of the road in power.).
  15. Hello, I am looking for a lisp the can place a block along a polyline every 500 feet. I know about using the measure command, and have made a lisp to use it, but one of the blocks that I have to use has an attribute. Measure does not work with attributed blocks. Is there already a lisp out there that will work like measure with attributes blocks or does anyone have any ideas that could do this?
  16. Hi, Can anyone help me to write a lisp function to sort the points (assume the intersection points) on a polyline? With my code, I have a polyline object and a set of intersection points on it. I need to calculate the cumulative distance between those points and vertex points consecutively. Thanks,
  17. Hello, guys! I have a little question... Is there some way to open / edit a drawing with autolisp without display that drawing? For example... When we are working with VBA, we can use the code ActiveWindow.Visible = False to not show the active window. Can we do something like it in autolisp?
  18. Hello, guys! I'm new here. So, please, be gentle. I had a problem with a routine. I have to open all the drawings in the same folder, compare a specific area of the drawing with a reference and change that area, if necessary. But I have a lot of references to compare, so I need to do that many times. I've already got a batch to open all the drawings in the same folder. So I just modified it to compare the area with the reference and it worked greatly. The only problem is: When i put that batch inside a loop instruction (to change the reference that will be compared), the batch didn't worked. The following error appears: ; error: bad argument type: streamp nil Here goes the code. Could someone help me? (defun c:testloop (/) (setq c 1) (while ( (c:opendrawings) (setq c (1+ c)) ); end while ); end function to test the loop (defun c:opendrawings (/ dwglist dwgname dwgpre file openfile uhoh len) (vl-load-com) (if (and (setq dwgpre (getvar 'dwgprefix)) (setq dwglist (vl-sort (vl-remove (strcat dwgpre (getvar 'dwgname)) (mapcar '(lambda (dwgname) (strcat dwgpre dwgname)) (vl-directory-files dwgpre "*.dwg") ) ) ' ) ) (setq uhoh "Readonly drawings will not be processed!" ) (setq len (strlen uhoh)) ) (progn (setq openfile (open (setq file (strcat dwgpre "myscript.scr")) "w")) (progn (foreach f dwglist (if (and (not (Is_ReadOnly f)) (/= (checkAttFile f) 1) ) (progn (write-line (strcat "_.open \"" f "\"") openfile) (write-line "_.audit _y" openfile) ; (write-line "_.qsave _.close" openfile) ) (setq uhoh (strcat uhoh "\n" f)) ) ) (close openfile) (command "_.script" file) (if (= (strlen uhoh) len) (princ "All drawings successfully processed...") (alert uhoh) ) ) ) ) (princ) ); end function to open all the drawings
  19. Hello, I am trying to draw a solid object by AutoLISP. But I got stuck while drawing an arc. Please see below picture where I got stuck. I need this arc parallel to the lines below it. I tried some UCS command but at that time arc shown up somewhere irrelevant. Couldn't figure it out. I'm doing something wrong. (I can post my .lsp here however it might be confusing for you as it contains many variables defined by me) Can anybody help please?
  20. I am looking for a lisp that will allow me to convert survey figures to flat polylines. Currently I have to select them explode which makes 3dpolylines then convert to 2dpolylines. I then use the flatten command. I have tried making a lisp that uses (command "_explode") and (command "_flatten") and am having trouble getting them to work. Does anyone have any suggestions?
  21. Hello, I have a drawing with approximately 4400 points in it. and a file folder with the same number of files. What i am looking for is a lisp routine that will use the point description and then create a hyperlink to the file in the folder with the name that is the same as the description. So if i have a point thats description is 43804152000, the lisp routine would go to the folder where all the hyperlink files are saved and hyperlink to the file named 43804152000. I have zero knowledge in lisp routines and would appreciate any help! Thanks,
  22. Is it possible using AutoLISP to define a variable name from the command line when running a function? I want to input the name when running it from the command line. Can I do this and still have the variable be global? If so, how would I go about that? Thanks in advance.
  23. Hi, I need a LISP for selecting similarobjects according to area of the object. As I am not familiar in creating LISPS any help would be appreciable. Thanks & Best Regards Vinay
  24. This is the part of code. I am getting the ; error: bad list of points How we will make list of points pt1 and pt2 to pass in ssget "_F". please help (setq txt (entsel "Select text: ")) (setq oText (vlax-ename->vla-object (car txt))) (setq pt1 (vlax-safearray->list (vlax-variant-value (vlax-get-property oText 'InsertionPoint)))) (setq x1 (car pt) y1 (cadr pt)) (setq angle_obj (vlax-get-property oText 'Rotation)) (setq pt2 (polar pt (+ angle_obj PI 90) 0.3)) (setq x2 (car pt) y2 (cadr pt)) (setq ss (ssget "_F" '((x1 y1) (x2 y2)) ))
  25. Hello.. Not familiar with autolisp or scripts I work for a earthworks company, and we are looking for a way to have an excel worksheet to update progress completion by coloring a property another colour in autocad. Example - lot 1 10% complete, and lot 10 is 30% complete as per excel data. I would like lot 1 (10%) to be light green and lot 10(30%) to be a darker green and darker shades for higher % completion and for the autocad drawing to update as the excel data sheet is updated. I have aproximatly 400 lots to program in this way if possible. Each lot will have 10 conditions (ie 10%, 20%, 30%... to 100%) Thank you
×
×
  • Create New...