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 462 results

  1. Hello guys, I'm about to update my code in order to make it more efficient. A long time ago I wrote this function to save my custom values in an XRECORD inside a dictionary. Is it possible to have the number of parameters (300-301-302- and so on) depending on the length of the list? (DEFUN CP:salva_dati (name nomedizionario lst / dict_name anXrec) (SETQ dict_name (CP:get-or-create-Dict "C_plan")) ;(CDR (ASSOC -1 (DICTSEARCH (NAMEDOBJDICT) nomedizionario)))) (SETQ anXrec (ENTMAKEX (LIST '(0 . "XRECORD") '(100 . "AcDbXrecord") (CONS 300 (nth 0 lst)) ;percorso (CONS 301 (nth 1 lst)) ;unità (CONS 302 (nth 2 lst)) ;scala (CONS 303 (nth 3 lst)) ;scala colore (cons 304 (nth 4 lst)) ;moltiplicatore (cons 305 (nth 5 lst)) ;ang_rot ) ) ) (DICTADD dict_name name anXrec) ) (defun CP:get-or-create-Dict ( nome / adict) (if (not (setq adict (dictsearch (namedobjdict) nome))) (progn (setq adict (entmakex '((0 . "DICTIONARY")(100 . "AcDbDictionary")))) (if adict (setq adict (dictadd (namedobjdict) nome adict))) ) (setq adict (cdr (assoc -1 adict))) ) ) In this case, I can save 6 values. I want to use this function to save even only one value or 10 values without creating other dedicated functions. Is it possible? Any suggestion to accomplish that? Another question: to edit these xrecord I usually get values that don't modify and createa list of them plus values that I want to change. (setq lst (list (CP:leggi_dati "Costanti" "C_plan" 300) "M" "1" "1000" "0.01" (CP:leggi_dati "Costanti" "C_plan" 305) ) ) (dictremove (cdr (assoc -1 (dictsearch (namedobjdict) "C_plan"))) "Costanti") (CP:salva_dati "Costanti" "C_plan" lst) (DEFUN CP:leggi_dati (name nomedizionario valore / dict_name) (SETQ dict_name (CDR (ASSOC -1 (DICTSEARCH (NAMEDOBJDICT) nomedizionario)))) (CDR (ASSOC valore (DICTSEARCH dict_name name))) ) There is a better method? (modify only the element I want without collect the others) Thanks for your help! Dennis
  2. Hello, I apologize if my terminology is off as I generally do not work in CAD/LISP. I am working on a lisp routine that draws blocks and adds attributes to the blocks (labels). I set the blocks to be a solid hatch and set their colour with (setvar "cecolor" "255"). After I finished I realized it would be nice to add the ability to draw the blocks without fill if the user wishes. I thought their would be a system variable something like (setvar "transparency" "100") but I can't find anything. Does anyone know how to set the transparency of block fill using LISP or how to set the colour to NULL? Thanks
  3. Good Morning All, All of our drawings are produced in 2D AutoCAD, generally building elevations, roof plans and sectional details. What I want to be able to do is measure a dimension on the plan of a roof, but, use a lisp to apply a factor to this so that the output dimension shows the length at the pitch of the roof... In other words if the plan dimension was 5000mm, but the roof pitch was known to be 10 degrees, the output of that dimension would show 5077mm. Or, at 15 degrees, the output would show 5176mm, etc, etc. What I would also like to do is apply this lisp individually or to a group of dimensions. Hope this makes sense!!
  4. Noklu

    Sort contours

    I am looking for a routine to sort contour lines. I am using 3d polylines that I import from Global Mapper. My problem is all of the lines are on one layer. Ideally, I would like to pick a starting elevation (polyline) and have the routine select every 5th contour up and down. Once then are all selected, I can move them to a new layer (like TOPO-INDEX). Some of these sites are hundreds of acres and have significant elevation changes. To do this by hand is VERY time-consuming (and easy to miss some contours). I am not a programmer, but this seems like the type of task that is ideal for a lisp routine. Any help is appreciated.
  5. Hi All Members Please Please help me for text on Polyline with block Sorry for English S2_A1_CS_LIST_FINAL.dwg
  6. Hello all, I work for a Firm that does Commercial Architectural Drafting and I am currently looking for a simple way to add a lisp routine that allows us to automatically calculate New doors on Floor plans and Parking Spaces on site plans that we create. Reason being that we are just looking for a faster way to do this without counting each individual door or parking space to save time and energy. Not sure if this is possible because I do not have extensive knowledge in Lisp Routines but this seemed like the right place to ask. If anyone knows anything about this that would be helpful. Thank you and have a great day.
  7. Dear Team, Greetings..! I have multiple drawings in one .dwg file in Model (Ref. UNIT 4500.JPG file). I need to covert PDF's with help of "Page Setup Name" Each name Plot area selected. (Ref. Page Setup.jpg file). the converted pdf file with name of same as Page setup name & automatically saved in WRT to Unit path.(Ref. Path.JPG) Kindly help me out I have hundreds of drawing to covert every time of small correction..!!
  8. I'm wanting to create a way to quickly change the layers of a CADworx object. This is what I have so far but its not working like I want. The problem is no matter how many objects I select, it only changes the first then stops working completely. If I try to run it again and select another object it wont do anything. I need to be able to select objects manually. Can someone point me in the right direction? (defun C:ttt () (setq STL_SS nil) (graphscr) (setq STL_SS (ssget '((0 . "LINE")(8 . "CL_Steel"))));;;FIND ALL THE LINES ON LAYER CL-STEEL (setq CL_CNT 0) (if (/= STL_SS nil) (repeat (sslength STL_SS) (setq STL_NAME (ssname STL_SS CL_CNT)) (setvar "pickstyle" 0) (command "chprop" STL_NAME "" "LA" "BEAM_CL" "") (setq CL_CNT (1+ CL_CNT)) );;;repeat );;;if (setq STL_SS nil) (setq STL_SS (ssget "L" '((0 . "3DSOLID")(8 . "STEEL"))));;;FIND ALL THE SOLIDS ON LAYER STEEL (setq CL_CNT 0) (if (/= STL_SS nil) (repeat (sslength STL_SS) (setq STL_NAME (ssname STL_SS CL_CNT)) (command "chprop" STL_NAME "" "LA" "BEAM" "") (setq CL_CNT (1+ CL_CNT)) );;;repeat );;;if (setvar "pickstyle" 1) (princ) )
  9. Does anyone have any information on DraftSight and the use of lisps and setting variables, these are two separate questions. I currently can load a lisp and run them as I do in AutoCad but there are limitations/variations to certain things. Does anyone have a comparison or know the differences with the two programs? My next question is about setting variables in DraftSight, Command Line: (setq no1 10) returns 10, but when I invoke !no1 it returns Error: No Function. as if the value got wiped immediately after being set. Is there a System Variable I need to set to hold these variables or is it just not possible in DraftSight? Any information is much appreciated.
  10. 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!
  11. 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.
  12. Dani_Nadir

    Automatic layout LISP

    Hello, I am interested in a LISP able to make overlapping sheets as layouts following a road alignment and overlap a fraction. Each sheet will have its own UCS or view orientation. You can see it from these videos: anyone knows one? Best regards, Daniel
  13. I am using AutoCAD VBA with array. I need to call a LISP function to pass a parameter (array). How can I the pass an array from VBA to LISP? I am using this expression: ThisDrawing.SendCommand "Myfunction"
  14. Hi. I have a lisp routine that I use all the time but I'm wondering if someone could please tell me how the routine sets the following variables: 1. The number of decimal places (precision) that the distance displays at. It currently displays it to 2 decimal places, I'd like to have 3 eg. 0.000 2. The text offset distance from the line. Thank you all in advance! (defun get_endpts (/ a b) (COMMAND "OSNAP" "ENDP") (setq a (getpoint "\nEnter first point: ")) (setq b (getpoint "\nEnter second point: ")) (COMMAND "OSNAP" "NONE") (list a b) ) (defun c:setdim () ;(initget (+ 1 2 4)) ;(setq scalefactor (getreal "\nEnter scale factor: ")) (if (not setmap) (load "setmap") ) (setmap) (setq scalefactor #mapsc) ;(initget 1 "Y y N n") ;(setq angflg (question "Do you want azimuths printed?")) (setq angflg "Y" angmessage "WILL") ;(cond (angflg ; (if (not (setq dimrotation (getangle "\nEnter angular rotation: "))) ; ;(setq dimrotation #mapang ) ; (setq DIMROTATION 0) ; ) ; (initget 1 "1 5") ; (setq secprec (atoi (getkword "\nRound off seconds to nearest <1 or 5> "))) ; ) ;) (setq dimrotation 0 secprec 5 secsmessage "5") (alert (strcat "DIMLINE SETTINGS: \n\nScale Factor set to: " (rtos scalefactor 2 6) "\nAzimuths " angmessage " print." "\nSeconds rounded off to " secsmessage "\"" "\n\n\nTo change the Scale Factor use MAP SETTINGS CSF \+ ROTATION \non the LISP pulldown.\n\nTo change other settings type SETDIM2.")) (setq dimset T) (princ) ;(chgsize (* (/ scalex 1000) 1.95)) );defun setdim (defun c:setdim2 () (initget (+ 1 2 4)) ;(setq scalefactor (getreal "\nEnter scale factor: ")) (if (not setmap) (load "setmap") ) (setq scalefactor #mapsc) (initget 1 "Y y N n") (setq angflg (question "Do you want azimuths printed?")) (if angflg (progn (setq DIMROTATION 0 angMessage "WILL") (initget 1 "1 5") (setq secsMessage (getkword "\nRound off seconds to nearest <1 or 5> ")) (setq secprec (atoi secsmessage)) ) (setq angMessage "WON'T" ) ) (alert (strcat "DIMLINE SETTINGS: \n\nScale Factor set to: " (rtos scalefactor 2 6) "\nAzimuths " angmessage " print." "\nSeconds rounded off to " secsmessage "\"" "\n\n\nTo change the Scale Factor use MAP SETTINGS CSF \+ ROTATION \non the LISP pulldown.")) (setq dimset T) ;(chgsize (* (/ scalex 1000) 1.95)) ) (defun c:dimline (/ L A B ucsflg) (load "F1") (cond ((not dimset) (c:setdim))) (if (/=(getvar "WORLDUCS") 1) (progn (command "UCS" "W") (setq UCSflg T) );progn );if (setq L (getline)) (dimfunc (getassoc 10 L) (getassoc 11 L) (placetxt (getassoc 10 L) (getassoc 11 L)) ) (if UCSflg (COMMAND "UCS" "P") ) ) (defun c:dimpts (/ ENDPTS ucsflg) (load "F1") (cond ((not dimset) (c:setdim))) (if (/=(getvar "WORLDUCS") 1) (progn (command "UCS" "W") (setq UCSflg T) );progn );if (dimfunc (car(setq ENDPTS(get_endpts))) (cadr ENDPTS) (placetxt (car ENDPTS)(cadr ENDPTS)) ) (if UCSflg (COMMAND "UCS" "P") ) ) (defun dimfunc (a b below / angab distab ctrpt d) (setq angab (angle a b)) (setq distab (distance a b)) (setq ctrpt (polar a angab (/ distab 2))) (setq d (/ distab scalefactor)) (cond (below (cond ((and (> angab (+ NORTH 0.1744)) (<= angab (+ SOUTH 0.1744))) (writedim d angab ctrpt (+ angab A90) (- angab PI) 1.20 2.85) ) (T (writedim d angab ctrpt (+ angab A270) angab 1.20 2.85)) ) ) (T (cond ((and (> angab (+ NORTH 0.1744)) (<= angab (+ SOUTH 0.1744))) (writedim d angab ctrpt (+ angab A270) (- angab PI) 1.20 2.85) ) (T (writedim d angab ctrpt (+ angab A90) angab 1.20 2.85)) ) ) ) ) (defun writedim (d azimuth ctrpt perpang orientation sp1 sp2 / textpt scalept) ;(switchl "DIMENSION") (setq textpt (polar ctrpt perpang (* (getxtht) sp1))) (setq scalePt ctrpt) (COMMAND "TEXT" "M" textpt (angtos orientation) (rtos d 2 2)) (cond (angflg (setq textpt (polar ctrpt perpang (* (getxtht) sp2))) (COMMAND "TEXT" "M" textpt (angtos orientation) (writeang (+ angab (dtr dimrotation))) ) )) (if (= (substr (getvar "CLAYER") 1 2) "34") (progn (findDetailScale) (if (and (/= nil detTxtScl)(/= 0.0 detTxtScl)) (command "SCALE" (lastn 2) "" scalept detTxtscl) (command "SCALE" (lastn 2) "" scalept theRatio) ) ) ) ; (switchl nil) ) (defun findDetailScale ( / detLayer detLen det7thLast undScr) (if (not c:lastn) (load "LASTN") ) (if (null theRatio) (progn (load "labelling") (c:detail) ) ) (setq detLayer (getvar "CLAYER")) (setq detlen (strlen detLayer)) (setq det7thLast (substr detLayer (- detLen 6))) (setq undScr (st_scan "_" det7thlast)) (setq detTxtScl (/ (* 0.001 (atoi (substr det7thLast (+ 1 undScr)))) plscale)) ) (defun writeang (azimuth) (setq azimuth (angtos azimuth 1 4)) (if (= "d" (substr azimuth 3 1)) (strcat (deg_format azimuth 3)) (if (= "d" (substr azimuth 4 1)) (strcat (deg_format azimuth 4)) (strcat (deg_format azimuth 2)) ) ) (cond ((= 5 secprec) (cond ((< 7 (last_digit seconds)) (setq seconds (additostr seconds (- 10 (last_digit seconds)))) ) ((< 2 (last_digit seconds)) (setq seconds (additostr seconds (- 5 (last_digit seconds)))) ) (T (setq seconds (additostr seconds (- 0 (last_digit seconds))))) ) (if (= (strlen seconds) 1) (setq seconds (strcat "0" seconds))) (if (= "60" seconds) (progn (setq seconds "00") (setq minutes (additostr minutes 1)) (if (= (strlen minutes) 1) (setq minutes (strcat "0" minutes))) (if (= "60" minutes) (progn (setq minutes "00") (setq degrees (additostr degrees 1)) )) )) )) (if (/= (strcase (getvar "LOGINNAME")) "Pam.hvizdos") (strcat degrees "%%d" minutes "'" seconds "\"") (strcat degrees "%%d" minutes "'" seconds "\"") ) ) (defun deg_format ( str pos) (setq degrees (substr str 1 (- pos 1))) (min_format (substr str (+ pos 1))) ) (defun min_format (str) (setq minutes (cond ((= "'" (substr str 2 1)) (sec_format (substr str 3)) (strcat"0" (substr str 1 1)) ) (T (sec_format (substr str 4)) (substr str 1 2) ) ) ) ) (defun sec_format (str) (setq seconds (substr (if ( = 2 (strlen str)) (strcat "0" str) str ) 1 2 )) ) (defun last_digit(str) (atoi (substr str (strlen str))) ) (defun additostr(str no) (itoa (+ (atoi str) no)) )
  15. I currently have a lisp routine to place a block at intersection points with one main line (RED) and then all other lines (WHITE) that cross it. I have a problem and cant seem to figure out how to adjust the code to make it work more fluid. I would like the main line to be able to be crossed more than once by a different line and still work. Currently if a RED line is crossed twice by any single white line it will not work and the lisp will bottom out and end (vl-load-com) (defun c:sbx ( / ) (progn (setq ent (car (entsel "\nSelect main line: "))) (if ent (progn (princ "\nSelect crossing line(s): ") (if (setq ss (ssget)) (progn (setq count 0 obj (vlax-ename->vla-object ent) pointlist nil ) (repeat (sslength ss) (setq xent (ssname ss count) xobj (vlax-ename->vla-object xent) ) (if (setq int (vla-IntersectWith obj xobj acExtendNone)) (progn (setq int (vlax-safearray->list (vlax-variant-value int)) pointlist (append pointlist (list int)) ) ) ) (setq count (1+ count)) ) (if (null (tblobjname "BLOCK" "SBblock")) (progn (entmake (list (cons 0 "BLOCK") (cons 2 "SBblock") (cons 70 0) (list 10 0.0 0.0 0.0))) (entmake '((0 . "LWPOLYLINE") (100 . "AcDbEntity") (8 . "0") (100 . "AcDbPolyline") (90 . 2) (70 . 1) (43 . 1.0) (38 . 0.0) (39 . 0.0) (10 2.5 0.0) (40 . 1.0) (41 . 1.0) (42 . 1.0) (91 . 0) (10 -2.5 0.0) (40 . 1.0) (41 . 1.0) (42 . 1.0) (91 . 0) (210 0.0 0.0 1.0) ) ) (setq blockname (entmake '((0 . "ENDBLK")))) ) ) (foreach pt_nth pointlist (entmake (append '((0 . "INSERT") (100 . "AcDbEntity") (8 . "0") (100 . "AcDbBlockReference") (2 . "SBblock")) (list (cons 10 pt_nth)) '((41 . 1.0) (42 . 1.0) (43 . 1.0) (50 . 0.0) (70 . 0) (71 . 0) (44 . 0.0) (45 . 0.0) (210 0.0 0.0 1.0)) ) ) ) ) ) ) ) ) (princ) )
  16. Hi, First time poster so please take it easy..! I am having trouble getting my lisp to open a file, write to it then close again. I am using Lee Mac's 'LM:findfile' function. The variable 'dntxtloc' works when testing, returning a path "L:\\DESIGN\\2018\\2018-167 Commercial Road, MASLIN BEACH\\2018-167 Designer's Notes.txt" so I think the 'LM:findfile' function is working fine. It seems to fail after that, writing the 'write-line' to the command line instead and returning the error below... Command: Drawing Name is of an acceptable format20/05/2019 (Rosdun) - ; error: bad argument type: streamp nil Command: I was hoping someone might be able to help me as I'm sure it's something basic that I'm missing. Any help at all would be greatly appreciated. Snippet that seems to be the problem. (cond ( (setq dntxtloc (LM:findfile nnametxt sfpath)) ( (setq ff (open dntxtloc "a")) (write-line (strcat mydate " (" myusername ") - ") ff) (close ff) (startapp "C://Windows/Notepad.exe" dntxtloc) (princ) ) ) ( (setq dndocloc (LM:findfile nnamedoc sfpath )) ( (startapp "C://Program Files (x86)//Microsoft Office//root//Office16//WINWORD.exe" dndocloc ) (princ) ) ) (t ((alert "Designer's Notes not found...")(princ))) ); End Cond I will attach the full copy also. Regards, Ross. Open Designer's Notes V6.lsp
  17. I want to be able to import 5-10 different blocks that need to be placed at approximately 70 locations each. I want to achieve this by taking a CSV file I have with the following attributes: (NAME, Xcoord, Ycoord, Zcoord) and then place the 'NAME' block at the correct coordinates within the drawing. The blocks are already preloaded within the drawing itself so they can be referenced by name.
  18. I have two polygons. One is my corridor (see white), and my other are disturbances (see red). I'm looking for a lisp that creates polygons everywhere where there is an overlap between the two (see green hatch). I currently have a lisp that gives me the area of the intersecting hatch but it is only a single use. I want to be able to click the white boundary layer and then the red intersecting layer and have it make intersecting polygons between those two.
  19. hi, any way to improve below lisp? it create new layer and new viewport but after layerp command execute the layer color goes back to white and no plot becomes plot again. (defun c:vp() (command ".layer" "M" "viewport" "C" "8" "viewport" "P" "N" "viewport" "" "-VPORTS" pause pause ".layerp") (princ) )
  20. I work as a Project Engineer with practically every one of my jobs requiring drafters to use Autocad to create drawings/plan sets. I've used Lisps for a while now and they are handy when I need to complete a task that I know I have a lisp for it helps complete the task much quicker and efficiently. The drafters I work with have 0-10 years of experience but all of which are unfamiliar with Lisp Routines. Any ideas on how to implement Lisp Routines/other useful drafting techniques into their tool-set that will help them complete plans more accurately and efficiently?
  21. 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
  22. I was using code from Lee Mac but it does not seem as if I am able to edit to export object data as well or the layer the points are on. For example it currently exports into a CSV as (x,y,z). I would like it to export as (Point Layer,x,y,z) or (x,y,z,OD1,OD2,OD3) to export all the object data from each point as their own column line. Attached is Lee Mac's amazing lisp as I referenced. PtManagerV2-4.lsp
  23. I have a bunch of points with Object Data in a drawing and I need that information exported into an Excel file in the format within the Title. At the moment I have been using a workaround by importing and re-exporting and then connecting data with the Task Pane to export to excel file. Is there a lisp to better automate this process?
  24. Hello, I am trying to create a lisp routine that sets all existing MLEADERs to a certain pre-set MLEADERSTYLE, the equivalent of doing a Quick Select for Mleaders, and setting the style under the properties window. I was able to write a similar routine that selects all dimensions and sets them to a certain DIMSTYLE, using entmod and DXF code 3 for dimstyle. So far, I have not been able to find a group code for MLEADERSTYLE Any help would be greatly appreciated! (defun C:dimstylechange (/ ENTITIES NO_OF_ENTITIES SSPOSITION ENTITY_NAME OLD_ENTLIST NEW_STYLE NEW_ENTLIST) (setvar "CMDECHO" 0) (setq ENTITIES (ssget "X" '((0 . "DIMENSION")))) (setq NO_OF_ENTITIES (sslength ENTITIES)) (setq SSPOSITION 0) (repeat NO_OF_ENTITIES ;***CHANGE STYLE*** (setq ENTITY_NAME (ssname ENTITIES SSPOSITION)) (setq OLD_ENTLIST (entget ENTITY_NAME)) (setq OLD_STYLE (assoc 3 OLD_ENTLIST)) (setq NEW_STYLE (cons 3 "BCR 11x17")) (setq NEW_ENTLIST (subst NEW_STYLE OLD_STYLE OLD_ENTLIST)) (entmod NEW_ENTLIST) ;***CHANGE LAYER*** (setq OLD_ENTLIST (entget ENTITY_NAME)) (setq OLD_STYLE (assoc 8 OLD_ENTLIST)) (setq NEW_STYLE (cons 8 "DIM")) (setq NEW_ENTLIST (subst NEW_STYLE OLD_STYLE OLD_ENTLIST)) (entmod NEW_ENTLIST) (setq SSPOSITION (1+ SSPOSITION)) ) (command ".CHPROP" ENTITIES "" "C" "BYLAYER" "LT" "BYLAYER" "") (princ (strcat "\n..." (rtos NO_OF_ENTITIES 2 0) " Dimension(s) changed...")) (setvar "CMDECHO" 1) (princ) ) dimstylechange.LSP
  25. Basically, I want to select two objects, and have them displaced the same amount in opposite directions from a set point without having to do the offset command in the case that the distance may be an odd or unknown value. To summarize, I have two polylines and want to offset them away from eachother using either a typed in distance or a "point-to-point" distance like the current offset command.
×
×
  • Create New...