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 , this lisp is modified to calculate the quantity of steel bars as it placed on the plan of reinforcement in the form shown on the attached cad file named : steel.dwg lisp name and command : steel hope you joy it . and step by step together we improve it to fit what we want to do. steel.dwg steel.LSP
  2. I am a CAD Drafter and Land Surveyor and one of my main job is to plot my surveyed poles. However the standard is to have all the poles perpendicular to the road or to a polyline. Is there a lisp to do that? Here is a sample of what I am doing. The top most pole is what It should look like. I have around 1000 poles to rotate perpendicular and is time consuming. Can anyone help me.
  3. This lisp can only run with CAD 2007, please edit it to run with higher generation AutoCAD (2021..). thanks chialo.lsp
  4. (defun c:deleteCirclesByDiameter () (setq f 0.5000) (setq ss (ssget "_X" '((0 . "CIRCLE")))) (if ss (progn (setq index 0) (repeat (sslength ss) (setq ent (ssname ss index)) (if ent (progn (setq diameter (cdr (assoc 40 (entget ent)))) (setq dia (* diameter 2)) (prompt (strcat "\nCircle: " (itoa (1+ index)) ", Diameter: " (rtos dia 2 4))) (if (and (> x f) (< dia x) (not (= dia 0.6875 x 0.75)) (not (= dia 0.6880 x 0.75))) (progn (entdel ent) (prompt (strcat "\nDeleted Circle: " (itoa (1+ index)) ", Diameter: " (rtos dia 2 4) ", Thickness: " (rtos x 2 4))) ) (progn (entdel ent) (prompt (strcat "\nDeleted Circle: " (itoa (1+ index)) ", Diameter: " (rtos dia 2 4) ", Thickness: " (rtos x 2 4))) ) ) (progn (entdel ent) (prompt (strcat "\nDeleted Circle: " (itoa (1+ index)) ", Diameter: " (rtos dia 2 4))) ) ) ) (setq index (1+ index)) ) ) ) (prompt "\nCircles with diameter less than x have been deleted.") ) (prompt "\nNo circles found in the drawing.") ) (princ) ) In this code, help me to fix my mistakes in if conditions..
  5. Hello Everyone, We are looking for a lisp that will delete objects on every layout in a drawing. I have seen a lisp that will delete objects of the same type and layer on every layout, but unfortunately that doesn't give us enough descriptiveness to only delete the objects we need to delete. The location of the objects we want to delete will be the same on every layout, so ideally the lisp will be able to take a selection window on one layout, and delete all the objects within that window location on every layout. If it is easier for coding purposes, we could even draw a box with lines/polylines on one layout and use that to define the selection window for all the other layouts, and then just delete the box at the end from the one layout. If anyone has any ideas, or if any more information would be helpful, please let me know! Thank you all, - Noah
  6. Explanation: To clean up consultant drawings I explode everything multiple times, move all objects to 0 layer, change all properties to By Layer (or equivalent), and purge the file. Then I Ctrl+Shift+C to select base point and in my file Ctrl-Shift+V to create a clean block that serves as the base for our drawings. Goal: LISP that does all the cleaning! Including: 1. Explode everything multiple times 2. Select everything in file and layer --> 0 color -->By Layer linetype --> By Layer lineweight --> By Layer 3. Purge everything (to be left with only 0 layer) I've found bits and pieces in different posts, but I am hoping to get some more comprehensive help. Thank you for your time, in advance!
  7. I am trying to write a routine to "simulate" MText command in lisp using predefined Text Height (2.0mm in this case for 1:1 scale) and text Style. I started with this code: (defun C:test (/ Height Style) (setvar "cmdecho" 1) (setq Height (* (getvar "DIMSCALE") 2.0 )) (setq Style "My_Style") (command "._MTEXT" pause "H" Height "S" Style pause) (princ) ) The text style seems to work but the Text Height doesn't change. Could anyone help please?
  8. Hello, can anyone help me please with this topic? I have 9 layouts. I've inserted the same block to each layout. I want to change some attributes (the title of the drawing inside block) for each layout out of those 9. The Layout name is variable according to the number of project which I have at that moment (SCH 23-123_01 or SCH 23-125_01 for example), but the attribute values are always the same (for example "1 floor" for layout 1, and "section A-A" for layout 2 etc.) I'm newbie in AutoCAD LISP files, so I've tried something with ChatGPT, but it doesn't seems to work. (defun c:Updateattributes () ;; Define your block name and attribute tag (setq blockName "Pečat Marko Vukićević") (setq attributeTag "NAZIV CRTEŽA") ;; Define a list of attribute values corresponding to each layout (setq attributeValuesList '("OSNOVA JAME" "PRESECI VOZNOG OKNA" "OSNOVA VRHA VOZNOG OKNA I DETALJ MONTAŽNE KUKE" "DETALJ PRAGA VRATA" "TEHNIČKE SPECIFIKACIJE" "OSNOVA KABINE" "PRESECI OPREME I RASPORED KONZOLA" "PREGLED SIGURNOSNIH PROSTORA" "POGLED PRISTUPNIH STRANA")) ;; Start iterating through layouts (vlax-for (layout (vla-get-Layouts (vla-get-ActiveDocument (vlax-get-acad-object)))) (vla-activate layout) ;; Check if the block exists in the layout (if (tblsearch "Pečat Marko Vukićević" blockName) ;; If the block exists, update the attribute value (progn (vla-get-active (setq pspace (vla-get-ModelSpace layout))) (vlax-for obj (vla-get-Block pspace) (if (= blockName (vla-get-Name obj)) (progn ;; Find the attribute reference (vlax-for attrRef (vlax-invoke obj 'GetAttributes)) (if (= attributeTag (vla-get-TagString attrRef)) ;; Update the attribute value from the list (vla-put-TextString attrRef (pop attributeValuesList)) ) ) ) ) ) ) ) (princ "\nAttribute values updated for all layouts.") (princ) ) I've asked Chat GPT also if special characters like "č" "ć" "š" "ž" is possible to have in LISP, and I've got the positive answer, but I'm not sure that is true. Can someone please verify me this information as well? If someone has slightest idea in which direction I should go, It would mean a lot to me. Thanks in advance! P.S. In the attached file there is a sample of my drawings. Also I would like to rename another attribute inside block to be the same as the layout name, but that is on another level. Demo.dwg
  9. 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
  10. Is there a method to update blocks and nested blocks (dynamic and/or annotated without losing their position, visibility status, and annotated values: Tag/prompt/default values) based on new blocks that will contain in a folder (source files)? New blocks have the same block name as old ones. The cad block files within the "source" folder have the same name as the old block. Dynamic blocks have stretch or rotation properties, example: block is stretched to 2100mm and rotated to 30 degrees. 1) is it possible to obtain this kind of sophistication? 2) How would I run this routine without opening the drawing and that select the drawing files? Thanks
  11. Not quite sure how to tackle this, because my options on the -mapimport is very limitted and did not completely understand ADE_ function library. When I use the dialouge box of mapimport, I do get options of "creating object data" in addition to "creating points as blocks" with the option of "getting attribute values from field". So I simply create a block and define attributes with the TAG to match the the "Attribute Table" from QGIS and everything works as it should - that is I now have blocks that show the values for each block because I selected "Get attribute values from field" on Mapimport dialouge box. Can it be possible to have a routine that automate this process to 0) select a folder that contains multiple shape files and not selected one by one 1) import the map (lines and points) 2) lines and maps to be imported with their respected Object data 3) dynamic blocks be inserted that contain attributes to show the OD values at each imported points 4) visibilities of the blocks change with values/ attributes (example: if value is Hydro then visibility A and if Telecom then visibility B)? so here on this code, I am selecting a folder and then reading the content (shape files), but then I cannot go further because -mapimport did not give me all the options needed. also Block_1 and Block_2 are just examples of a block/ currently with no visibility for the conditions stated above. I do not work with Map3D all that often so help is appreciated! ( (lambda ( / path);lstall lstseluser (defun BrowseForFolder ( / sh folder folderobject result) (vl-load-com) (setq sh (vla-getInterfaceObject (vlax-get-acad-object) "Shell.Application")) (setq folder (vlax-invoke-method sh 'BrowseForFolder 0 "" 0)) (vlax-release-object sh) (if folder (progn (setq folderobject (vlax-get-property folder 'Self)) (setq result (vlax-get-property FolderObject 'Path)) (vlax-release-object folder) (vlax-release-object FolderObject) result ) ) ) (if (null (setq path (BrowseForFolder))) ;; just in case you didnt specify a path nil (setq lstall (vl-directory-files path "*.shp" 1))) ;---------------------------------------- ;; msg - [str] Dialog label ;; lst - [lst] List of strings to display ;; bit - [int] 1=allow multiple; 2=return indexes ;; Returns: [lst] List of selected items/indexes, else nil (defun LM:listbox ( msg lst bit / dch des tmp rtn ) (cond ( (not (and (setq tmp (vl-filename-mktemp nil nil ".dcl")) (setq des (open tmp "w")) (write-line (strcat "listbox:dialog{label=\"" msg "\";spacer;:list_box{key=\"list\";multiple_select=" (if (= 1 (logand 1 bit)) "true" "false") ";width=50;height=15;}spacer;ok_cancel;}" ) des ) (not (close des)) (< 0 (setq dch (load_dialog tmp))) (new_dialog "listbox" dch) ) ) (prompt "\nError Loading List Box Dialog.") ) ( t (start_list "list") (foreach itm lst (add_list itm)) (end_list) (setq rtn (set_tile "list" "0")) (action_tile "list" "(setq rtn $value)") (setq rtn (if (= 1 (start_dialog)) (if (= 2 (logand 2 bit)) (read (strcat "(" rtn ")")) (mapcar '(lambda ( x ) (nth x lst)) (read (strcat "(" rtn ")"))) ) ) ) ) ) (if (< 0 dch) (unload_dialog dch) ) (if (and tmp (setq tmp (findfile tmp))) (vl-file-delete tmp) ) rtn ) (if (not (= lstall nil)) (setq lstseluser (LM:listbox "Select one or more shape files (Ctrl or Shift):" lstall 1)) ) ;---------------------------------------- (if (not (= lstall nil)) (progn (alert (vl-prin1-to-string lstseluser)) ) ) ) ) Block_1.dwg Block_2.dwg
  12. Good afternoon, One of our vendors has sent us several shp files with lines/polylines and ones with points. All the data comes in on a single layer, but I would like to sort the data with a LISP based on existing layers I've created and some of the Object data. Below is an example of the OD I want to use, and the layers I would like to have the objects sorted into. Could anyone help with some code that I could use to sort these objects? The OD table name will change depending on the file we receive, if that matters. Thanks
  13. I have some lisp / DCL code that allows me to pick a note from a lstbox and insert it as an MLEADER into the drawing. How should I format that note text in my code so that the fractions insert into the drawing as diagonally stacked fractions? I've tried 3#4 but it shows up just as written, not stacked diagonally Thanks for any help
  14. Here is an example of an array that needs to be worked on and I need an easy way to count the number of rows and columns. For example, I have 3 rows and 20 columns and I need to be able to select for multiple arrays.
  15. I am pretty new to lisp programming and have only been working in it for a few months and I am pretty stuck on how to get this lisp program I've hacked together into what I need. Any help would be greatly appreciated. I would like help optimizing the lisp to be more like autocad's save as an old dxf way of converting an ellipse to a polyline. The current way I am converting an ellipse to poly line is by moving a static degree of distance between each point, the way I cannot figure out and the ideal way for me to do this is by specifying the maximum gap between the true ellipse and the polyline version. I have looked at other lisp programs out there and they are not high resolution enough for what I need, I need the data to be extremely close to the actual ellipse. I would appreciate help in pointing me towards how to do this mathematically, help implement that into a lisp, and any tips on best practice lisp programming that I might be really messing up here. Below is the function I have written to handle this so far, it takes in el which is the vla ellipse object and angleIncrement which is the degree difference between two points of the polyline. In a perfect world the second argument would be changed to be the maximum distance between the true ellipse and the polyline version. This is a function used in another script that then chains the data and does a few other things as well. (defun EllipseToLine (el angleIncrement / majorradius minorradius startangle endangle startpoint endpoint centerpoint tempVar) (vl-load-com) (setvar "cmdecho" 0) (setq majorradius (vla-get-MajorRadius el)) (setq minorradius (vla-get-MinorRadius el)) (setq startangle (* (vla-get-StartAngle el) (/ 180 pi))) (setq endangle (* (vla-get-EndAngle el)(/ 180 pi))) (setq startpoint (vlax-safearray->list (vlax-variant-value (vla-get-startpoint el)))) (setq endpoint (vlax-safearray->list (vlax-variant-value (vla-get-endpoint el)))) (setq centerpoint (vlax-safearray->list (vlax-variant-value (vla-get-center el)))) (setq centerx (nth 0 centerpoint)) (setq centery (nth 1 centerpoint)) (princ "End angle: ")(princ endangle)(princ "\n") (princ "Start angle: ")(princ startangle)(princ "\n") (setq startx (nth 0 startpoint)) (setq starty (nth 1 startpoint)) (setq endx (nth 0 endpoint)) (setq endy (nth 1 endpoint)) ; make sure we convert the ellipse on the correct layer and then later return to the layer we were on (setq ellipseLayer (vla-get-layer el)) (setq currentLayer (getvar "clayer")) (setvar "clayer" ellipseLayer) ; calculate angle between start angle and start point because the start point ; is not at the start angle so we have to adjust so numbers match up (setq angleOffset (- (* (angle centerpoint startpoint) (/ 180 pi)) startangle)) (setq radianOffset (* angleOffset (/ pi 180))) ; a = major radius ; b = minor radius (setq ecc (sqrt (- 1 (/ (expt minorradius 2) (expt majorradius 2))))) (setq angleInverted 0) (setq done 0) (setq i 0) (setq currentAngle startangle) (setq nintyDegrees 90.0) (setq twoHundredSeventyDegrees 270.0) (while (= done 0) (if (< currentAngle 0) (progn (setq currentAngle (+ currentAngle 360)) (setq angleInverted 1) ) ) (if (> currentAngle 360) (progn (setq currentAngle (- currentAngle 360)) (setq angleInverted 1) ) ) (cond ((or (and (> startangle endangle) (= angleInverted 0)) (and (> endangle startangle) (= angleInverted 1))) (if (< currentAngle endangle) (setq currentAngle endangle) ) ) ((or (and (> endangle startangle) (= angleInverted 0)) (and (> startangle endangle) (= angleInverted 1))) (if (> currentAngle endangle) (setq currentAngle endangle) ) ) ) (setq newAngle currentAngle) (if (or (> newAngle 0) (< newAngle 0)) (setq newAngle (* newAngle (/ pi 180))) ) (setq factor -1) (if (or (<= currentAngle nintyDegrees) (>= currentAngle twoHundredSeventyDegrees)) (setq factor 1) ) ; using the origional un rotated angle get the next point on the ellipse (setq x2 (/ (* majorradius minorradius) (* factor (sqrt (+ (expt minorradius 2) (* (expt majorradius 2) (expt (/ (sin newAngle) (cos newAngle)) 2))))))) (setq y2 (* x2 (/ (sin newAngle) (cos newAngle)))) (setq x2 (+ x2 centerx) y2 (+ y2 centery) ) ; rotate point on the ellipse by radian/angle offset so it matches the cad data (setq rotatedx (+ (- (* (cos radianOffset) (- x2 centerx)) (* (sin radianOffset) (- y2 centery))) centerx)) (setq rotatedy (+ (+ (* (sin radianOffset) (- x2 centerx)) (* (cos radianOffset) (- y2 centery))) centery)) (setq x2 rotatedx y2 rotatedy ) (if (= currentAngle endangle) (setq done 1) ) (if (> i 0) (if (= i 1) (command "_.line" (strcat (rtos startx) "," (rtos starty)) (strcat (rtos x2) "," (rtos y2)) "") (if (= done 1) (command "_.line" (strcat (rtos x1) "," (rtos y1)) (strcat (rtos endx) "," (rtos endy)) "") (command "_.line" (strcat (rtos x1) "," (rtos y1)) (strcat (rtos x2) "," (rtos y2)) "") ) ) ) (setq x1 x2 y1 y2 ) (setq currentAngle (+ currentAngle angleIncrement) i (+ 1 i) ) ) ; delete the origional ellipse (vla-delete el) (setvar "clayer" currentLayer) (princ) )
  16. Hi. The following routine generates the exception e06d7363 when using (* push-error-using-command *). If I replace "myerror" (* push-error-using-command *) with (* push-error-using-stack *) and the "command" with "command-s", the exception is not generated; but when activating "myerror" the message is generated that indicates that I must use (* push-error-using-command *) or command-s. (defun test (a b / ) (entradaTest) ;;(*push-error-using-command*) (/ a b) (setq *DrawingGER* (vla-get-ActiveDocument (vlax-get-acad-object))) (setq LayersColeccion (vlax-get-property *DrawingGer* "Layers")) ;;Crea las layer necesarias para alojar las entidades del dibujo. (setq ListaLayers (list "Make_Tuberias" "Biseles" "3D_Perfil")) ;;Funcion: AX-EXISTE+. ;;Parametro "elemento" es una cadena con el nombre de elemento a buscar en una coleccion, ej (ax-existe+ "0" "LAYERS"). ;;Archivo iList.lsp (foreach X ListaLayers (if (not (ax-Existe+ X "Layers")) (vl-cmdf ".-layer" "New" X "T" X "")) ) (salidaTest) ;;(*pop-error-mode*) ) (defun myerror (s) (if (/= s "Function cancelled") (princ (strcat "\nError GER: " s)) ) (setvar "cecolor" color_org) (setvar "cvport" port_view_ger) (command "_vpoint" vpoint_ger) (command "_zoom" "W" MSMAX_GER MSMIN_GER) (setvar "clayer" clayer1) (setvar "INSUNITS" val_var_INSUNITS) (cmd-salir) (SETVAR "osmode" ref0) (setvar "3dosmode" 3DOSMODE_ORG) (setq *error* olderr) (command "_undo" "_end") (SETVAR "cmdecho" 1) (PRIN1) ) (defun entradaTest ( / ) (*push-error-using-command*) ;;(*push-error-using-stack*) (SETVAR "cmdecho" 0) (COMMAND "_undo" "_begin") (setq olderr *error* *error* myerror) (SETQ ref0 (GETVAR "osmode")) (SETVAR "osmode" 0) (setq 3DOSMODE_ORG (GETVAR "3dosmode")) (setvar "3dosmode" 0) (SETQ port_view_ger (getvar "cvport")) ;;(SETQ vpoint_ger (getvar "viewdir")) ;;(SETQ VSMAX_GER (getvar "vsmax")) ;;(SETQ VSMIN_GER (getvar "vsmin")) (setq val_var_INSUNITS (getvar "INSUNITS")) ;;(setvar "INSUNITS" 1) ;1 para pulgadas. (setq clayer1 (getvar "clayer")) (setvar "clayer" "0") (setq color_org (getvar "cecolor")) ) (defun salidaTest ( / ) (setvar "cecolor" color_org) ;;(setq *error* olderr) (setvar "cvport" port_view_ger) (command "_vpoint" vpoint_ger) (setvar "clayer" clayer1) (setvar "INSUNITS" val_var_INSUNITS) (SETVAR "osmode" ref0) (setvar "3dosmode" 3DOSMODE_ORG) (COMMAND "_undo" "_end") (setq *error* olderr) ; Restore old *error* handler (COMMAND "_undo" "_end") (SETVAR "cmdecho" 1) (*pop-error-mode*) (PRIN1) ) (defun AX-EXISTE+ (elemento coleccion / Colecciones temp X resultado *DrawingGER* Coleccion ) ;;Colecciones disponibles. (setq Colecciones (list "Blocks" "Dictionaries" "DimStyles" "FileDependencies" "Groups" "Layers" "Layouts" "LineTypes" "Materials" "ModelSpace" "PaperSpace" "PickFirstSelectionSet" "Plot" "PlotConfiguration" "Preferences" "RegisteredApplications" "SelectionSets" "SummaryInfo" "TextStyles" "UserCoordinatesSystems" "Utility" "Viewports" "Views") ) ;;Verifica si la coleccion existe en el documento actual. (setq temp nil) (foreach X Colecciones (if (equal (strcase coleccion) (strcase X)) (setq temp T)) ) (if temp (progn (setq *DrawingGER* (vla-get-ActiveDocument (vlax-get-acad-object))) ;;Obtiene el objeto DXF del dibujo actual. (setq Coleccion (vlax-get-property *DrawingGer* coleccion)) ;;Obtiene el objeto DXF de la Coleccion requerida, por ejemplo "Layers". (if (not (vl-catch-all-error-p (setq resultado (vl-catch-all-apply 'vla-item (list coleccion elemento))))) t nil) ) (progn (prompt (strcat "\n**(ax-Existe+) Nombre de coleccion \"" coleccion "\" no identificada.\n")) (princ) nil ) ) ) Any idea of the reason for the exception? Greetings.
  17. I had this awesome code from Lee Mac about aligning a block to an object and wanted to know if it can be updated to also allow for the block to maintain the location and just align from the original location. This is helpful for aligning survey block to the orientation of the road line object. The code is attached to this post. LM_BlockAlign.lsp
  18. Hi, I've found the align object lisp from Lee Mac (thank you sir). I have a slope for an underground garage where a special type of car can't pass the entrance (hanging too low). They have given me a model of the car. I want to align the car to the curve i've created. The problem is that the car has two tires, represented by circles. The point where they hit the curve is somewhere along those circles and i should align with 2 points to the curve. Can you help me out? The blue line is a section i've taken from the DTM, The green line is a proposition i've made with trial and error. car align to curve.dwg
  19. Hello For a few days now I have been using the LISP made by Small Fish, LISP is very good, the only problem that it is causing me is that it does not highlight the points that I have selected and on some occasions I select the same point twice, I would appreciate it if you Please tell me a way to modify that. ThaEscrumbo1.LSPnk you
  20. Hi, there, im very new working with Autolisp, in the past i copy and paste code and use the lisp. Thanks to all the people who write this lisp. Now im learning how to code with lisp, i m reading books, developers guide and this forum. I need to understand how some commands works for use it in the lisp code. I cant find a description of how command works. For example (command "xref" "r"). But i know this command have more options, i need the description of the other options and how can i use it. (defun c:CircC () (command "._circle" "0,0" "3,3") (command "._thickness" 1) (command "._circle" PAUSE PAUSE) (princ) ) i want to know how circle command works "0,0" is the origin point "3,3" is for ??
  21. Hey guys! Do y'all know of a LISP that will label a hatch based on its name? Similar to what AlanJT did here with block name->mleader. Bonus points if you can get it to work with AlanJT's code, so I only need one command to label my blocks and hatches. And if this isn't possible, then is there a LISP for populating an mleader with a palette display description? Any help would be great! Thanks.
  22. Hi guys, im looking for a quick way for change the dimension precision in multiple files. I need to change from 0.000 to 0.00 in multiple files. I dont want open each drawing and set the precision to 2 decimal. You know we look for the quick and less bored way of do things. Thanks
  23. Hi, I have thousands of drawings. They are all similar to This.dwg one. My final goal is to merge them into one kml file.. This would take months to do it one by one. If I have the right lisp to automate this in one drawing, then I can use script to run that lisp over other drawings. To reduce the result file size, I decided to keep only the green polyline in the center of the drawing(which matters the most): (defun C:foo ( / varf ins str) ; Selecting Polyline (setq varf (list '(-4 . "<OR") '(0 . "LWPOLYLINE") '(-4 . "<AND") '(0 . "POLYLINE") '(-4 . "<NOT") '(-4 . "&") '(70 . 80) '(-4 . "NOT>") '(-4 . "AND>") '(-4 . "OR>") (cons 62 3) ) ) (sssetfirst nil (ssget "_X" varf)) ; Inverting selection (if (ssget "_I") (progn; then (sssetfirst nil) (command "_.select" "_all" "_remove" (ssget "_p") "") (sssetfirst nil (ssget "_p")) ) (prompt "\nRequires pre-selection."); else ) ; Delete Selection (command "_.erase") ; And This is how I insert Drawing Name (and (or (> (getvar 'DWGTITLED) 0) (alert "Save the drawing then try again!") ) (setq ins (getpoint "\nChoose Insertion Point: ")) (setq str (entmakex (list '(0 . "MTEXT") '(100 . "AcDbEntity") '(100 . "AcDbMText") (cons 10 (trans ins 1 0)) (cons 40 0.8);Text height (cons 7 "STANDARD");Text style '(1 . "") ) ) ) (vla-put-textstring (vlax-ename->vla-object str) "%<\\AcVar Filename \\f \"%tc4%fn2\">%}" ) ) ) Now these are what I'm looking for: - I don't want to pick the insertion point manually, need to insert field inside or over selected polyline - after inserting field text, I want to explode the text. to maintain drawing name after merge. - adding a condition to check the process, if anything goes wrong, insert that drawing name at (0,0,0). this way I can track that file to check it manually. Thank you in Advanced.
  24. Hello guys, would like to ask for your help that I'd like to have a lisp that can let me extract data from multiple lines which then the data can be exported into a txt file. Would like to export the angle of the line ( the angle extracted should be in the form of degree minute second), the distance and also the end point coordinate( Y & X) in this order. Thank you very much. I am struggling with this problem!
  25. Hello guys, I am working in AutoCAD. I am looking for a combined LISP code for creating points for the selected objects at its Endpoints, Midpoints, Center, Geometric center, Node, Quadrant, Intersection & Insertion as per users requirements (options with drop down list mentioning Endpoints, Midpoints, Center, Geometric center, Node, Quadrant, Intersection & Insertion Shall get prompted.) Once I select the required snap then the result shall be creation of points at the chosen object snap. An imaginary Example shall be Like like this, command: POBS(Points at Object Snap)-->prompting for what snap need to be found in the selected objects in the for of drop down list--> Creating points in the selected Object Snaps of the selection set. Actually i had found few LISP codes for the following cases 1.PLE-Points on Line Ends.lsp 2.PAI-Point At Intersection.lsp Thanks for the authors of these above LISP they have saved lot of time till date. Thanks in advance.
×
×
  • Create New...