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

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 433 results

  1. I was trying to change the shade plot of a view port by lisp but I didn't see any way to do that through the change properties or through the dxf codes. (progn (setq ss1 (ssget "x" '((0 . "VIEWPORT")))) (command "change" ss1 "" "p") )
  2. Hi all: I like using Lisps, but don't know how to write code for them. I like this particular lisp created by Mosad Elewa and posted on Cadalyst.com. When trying the lisp on a polyline, it did not work. Seems to only work on a "line". Here's the code: ---------------------------------------------------------------------------------------------------- ;;;CADALYST 02/07 Tip 2180: DIV.LSP Modify Divide © 2007 Mosad Elewa ;DIV.LSP BY MOSAD H. ELEWA (1996) (defun C:DIV () (setq ent (entget (car (entsel "\nSelect object to divide")))) (setq etype (cdr (assoc 0 ent))) (if (eq etype "LINE") (progn (cond ( (setq m (getint "\nNumber of segments")) (setq pt1 (cdr (assoc 10 ent))) (setq pt2 (cdr (assoc 11 ent))) (setq ang (angle pt1 pt2)) (setq dist (distance pt1 pt2)) (setq dd (/ dist m)) (setq pt3 (polar pt1 ang dd)) (setq ang2 (+ ang 1.5708)) (setq pt4 (polar pt3 ang2 (/ dd 4))) (setq ds (distance pt1 pt3)) (command "line" pt3 pt4 "") (setq pt5 (polar pt3 ang2 (/ dd )) (command "move" "l" "" pt4 pt5) (setq d 0) ; (setvar "cmdecho" 0) (command "copy" "l" "" "m" pt1) (repeat (- m 2) (command (polar pt1 ang (setq d (+ d ds))))) (command ""))) )) (if (eq etype "ARC") (progn (setq n (getint "\Number of segments")) (setq ang (cdr (assoc 50 ent))) (setq ang2 (cdr (assoc 51 ent))) (setq ang3 (- ang2 ang)) (setq ang4 (/ (* ang3 180.0) pi)) (setq cp (cdr (assoc 10 ent))) (setq r (cdr (assoc 40 ent))) (setq pt1 (polar cp ang r)) (setq pt2 (polar cp ang (/ r 4))) (setq pt3 (polar cp ang (/ r )) (command "line" cp pt2 "") (command "move" "l" "" pt3 pt1) (command "array" "l" "" "p" cp (+ n 1) ang4 "y") )) (if (eq etype "CIRCLE") (progn (setq n (getint "\Number of segments")) (setq cp (cdr (assoc 10 ent))) (setq r (cdr (assoc 40 ent))) (setq pt1 (polar cp 0 r)) (setq pt2 (polar cp 0 (/ r 4))) (setq pt3 (polar cp 0 (/ r )) (command "line" cp pt2 "") (command "move" "l" "" pt3 pt1) (command "array" "l" "" "p" cp n "360" "y") )) (princ) )[/CODE] -----------------------------------------------------------------------------------------------------
  3. Hello, i have a problem that i hope you guys can help me. As attach i have a lsp file, some things on that code i made myself some others took from the web, because i'm not that savvy with autocad lisp. Basically what this lsp do is, measure all elements in an dwg and makes a xls file with the Layer; linetype, color and length for all lines, polylines and arcs. All work well, but i need one simple thing that i can't manage to understand the way to do it, i need to divide this lisp in to different commands like "medzm" and "medzmm". In "medzm" i need that the result equal as is is now, in the "medzmm" i need that the length is divided by 1000. Thanks for is advance for any help you can give. MedZ v3.lsp
  4. Below is a breakdown of the tab, items in bold refer to the column headers on that tab. The number of entries on each tab will vary from project to project, so the code should loop accordingly. ACAD_PlansetNotes These are text blocks that should be created and inserted into the planset on different pages and locations We will only work on "standalone" items (Type), which are individual, floating pieces of text. For items on this tab you will need to: Write the text into AutoCAD in a visible layer (Text_Visible) onto the correct sheet (Sheet) Just above the visible text, write the hidden text on the "No Plot" layer (Text_Hidden) Set the width of the text block (Width_In) Text should be placed in the specified location based on x-y coordinates to the top-left corner (Location_AbsX_In & Location_AbsY_In) e.g. if Location_AbsX_In = 2 and Location_AbsY_In = 4, the top-left corner of the text should be 2 inches over and 4 inches down from the top-left corner of the page.
  5. 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
  6. benhubel

    Extrim Multiple

    I love Extrim, but it only does one trim at a time. I am looking to trim everything that is selected at once. The pseudocode goes like this: 1. Get selection 2. Filter out everything but closed polylines 3. Ask user if they want to just trim crossing lines, or to delete everything 4. selected on that side of the line. 5. Get a point as the side to extrim on. If inside any selected polyline, get the inside point of each polyline and then trim inside each one (or inside the boundary of any crossing ones). Likewise, if outside of all selected polylines, trim the outside of each one (or outside the boundary of any crossing ones). My main problem is that I have no clue what I'm doing when it comes to dealing with Extrim. The syntax keeps throwing me around. I thought it would be super simple when I started, but because Extrim is a LISP rather than a command, it's got me really confused. I was planning to make use of alanjt's SelectWithinCurve routine to help with deleting non-crossing geometry.
  7. Hi there! I am exploring lisp and dcl at the same time. I have this DCL as shown below. Whenever the command is done and doing the same command again, values reset (pic2). I want the values to remain whenever I used the dcl again after I press "Ok" to edit particular inputs instead of typing the whole data again. How could I possibly do that? Here is the dcl code I used. CHECKING : dialog { label = "CHECKING"; : row { :boxed_row { label = "PARAMETERS"; : edit_box { key = "a"; label = "Wind Pressure (kPa)"; edit_width = 8;} : edit_box {key = "b"; label = "Tributary Width (mm)"; edit_width = 8;} : edit_box {key = "c"; label = "Unsupported Length (mm)"; edit_width = 8;} } } : row { :boxed_column { label = "SECTION PROPERTIES (ALUMINUM)"; : edit_box { key = "d"; label = "Moment of Inertia (mm^4)"; edit_width = 8;} : edit_box {key = "e"; label = "Area (mm^2)"; edit_width = 8;} : edit_box {key = "f"; label = "Extreme Fiber (mm)"; edit_width = 8;} : edit_box {key = "g"; label = "Allowable Stress (MPa)"; edit_width = 8;} } :boxed_column { label = "SECTION PROPERTIES (STEEL)"; : edit_box { key = "h"; label = "Moment of Inertia (mm^4)"; edit_width = 8;} : edit_box {key = "i"; label = "Area (mm^2)"; edit_width = 8;} : edit_box {key = "j"; label = "Extreme Fiber (mm)"; edit_width = 8;} : edit_box {key = "k"; label = "Allowable Stress (MPa)"; edit_width = 8;} } } : button { key = "accept"; label = " &OK "; is_default = true; mnemonic = "S"; } : button { key = "cancel"; label = " Cancel "; is_default = false; is_cancel = true; } } and here is the lisp code: (defun saveVars() (setq wp(distof(get_tile "a"))) (setq tw(distof(get_tile "b"))) (setq L(distof(get_tile "c"))) (setq Im(distof(get_tile "d"))) (setq Am(distof(get_tile "e"))) (setq cm(distof(get_tile "f"))) (setq Fbm(distof(get_tile "g"))) (setq Is(distof(get_tile "h"))) (setq As(distof(get_tile "i"))) (setq cs(distof(get_tile "j"))) (setq Fbs(distof(get_tile "k"))) ) (defun C:CC() (if(not(setq dcl_id (load_dialog "CHECKING.dcl"))) (progn (alert "The DCL file could not be loaded!") (exit) ) (progn (if (not(new_dialog "CHECKING" dcl_id)) (progn (alert "CHECKING.DCL file could not be loaded!") (exit) ) (progn (action_tile "accept" "(saveVars)(done_dialog 2)") (action_tile "cancel" "(done_dialog 1)") (setq ddiag(start_dialog)) (unload_dialog dcl_id) (if(= ddiag 1) (princ "\n END") ) (if(= ddiag 2) (progn (setq IT(+ Im (* 2.87 Is))) (setq moment(/ (* wp tw L L) 8000)) (setq stress(/ (* moment cm) Im)) (setq stressratio(/ stress Fbm)) (setq deflection(/ (* 5 wp tw L L L L) (* 384000 69600 IT))) (setq allowdeflection(/ L 175)) (setq defratio(/ deflection allowdeflection)) (setq pt1 (getpoint)) (setq pt2 (getpoint)) (command "_mtext" pt1 pt2 "\n Actual Bending Stress =" (rtos stress 2 2) "\n Allowable Bending Stress =" (rtos Fbm 2 2) "\n Stress Ratio =" (rtos stressratio 2 2) "\n Actual Deflection =" (rtos deflection 2 2) "\n Allowable Deflection =" (rtos allowdeflection 2 2) "\n Deflection Ratio =" (rtos defratio 2 2) "" ) ) ) ) ) ) ) ) One more thing. About the mtext output. The output is this. Numerical results always appear on the next line. and I want the result to be like this with units as text (MPa, mm, etc) Does someone has a thing about this? Thank you in advance. :)
  8. 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!
  9. Hi All, I am experimenting with contextual ribbon menus based on some drawing properties and I am trying to find if it is possible to setup a reactor that will detect when you change drawings either using Switch Windows or clicking on the drawing tab. Any and all input on this issue greatly appreciated :-) Colin Holloway Brisbane, Queensland, Australia.
  10. fuccaro

    Caliper fun

    Hello people! Today I realized that AutoCAD is just waiting on my hard disc, so I started it and I wrote a short Lisp program. If someone wants to play: load the lisp and start it by typing TESTME in the command line. Probable you will have to double click with the wheel to get the zoom to the right place. You should see a caliper open at a random dimension. All you have to do is to read the caliper and enter the value. The command line should show at least 3 lines to see the result. Want to play again? Press enter. While AutoCAD waits for your input, you may use the mouse to zoom/pan. Or if you want to cheat, you can measure the opening of the caliper and enter the measured value. Have fun! (defun c:TestMe() (if (not (tblsearch "BLOCK" "SublerA")) (MakeBlockA)) (if (not (tblsearch "BLOCK" "SublerB")) (MakeBlockB)) (if (not (ssget "X" (list '(0 . "INSERT") '(2 . "SublerA")))) (entmake (list '(0 . "INSERT") '(2 . "SublerA") '(10 0 0 0)))) (if (not (ssget "X" (list '(0 . "INSERT") '(2 . "SublerB")))) (entmake (list '(0 . "INSERT") '(2 . "SublerB") '(10 0 0 0)))) (setq measured (/ (rem (getvar "millisecs") 1500) 10.0)) (setq entl (entget (entlast))) (setq entl (subst (list 10 measured 0 0) (assoc 10 entl) entl)) (entmod entl) (setq entered (getreal "Enter measured value ")) (princ (if (= measured entered) "Ok " (strcat " Not Ok! The answer is " (rtos measured) ))) (princ) ) (defun MakeBlockA() (entmake (list '(0 . "BLOCK") '(2 . "SublerA") '(10 0.0 0.0 0.0)'(70 . 0))) (setq i 0) (repeat 151 (cond ((= (* 5 (/ i 5)) i) (progn (setq m 0.5) (entmake (list '(0 . "text") (list 10 i 2.6 0) (cons 1 (itoa i)) '(40 . 1.4) (cons 50 0.7))) ) ) ) (entmake (list '(0 . "LINE") (list 10 i 0 0) (list 11 i (+ 1.5 m) 0))) (setq i (1+ i) m 0) ) (setq points (list '(-3 0 0) '(170 0 0) '(170 8 0) '(-10 8 0) '(-10 -15 0) '(-5 -25 0) '(-5 -30 0) '(-3 -30 0))) (setq p1 (list -3 -30 0)) (foreach p points (entmake (list '(0 . "LINE") (cons 10 p1) (cons 11 p))) (setq p1 p) ) (entmake (list '(0 . "ENDBLK"))) ) (defun MakeBlockB() (entmake (list '(0 . "BLOCK") (cons 2 "SublerB") (list 10 0.0 0.0 0.0)'(70 . 0))) (setq i 0) (repeat 11 (cond ((= i (* 5 (/ i 5))) (progn (setq n -0.5) (entmake (list '(0 . "text") (list 10 (- (* 0.9 i) 0.5) -5 0) (cons 1 (itoa i)) '(40 . 1.4) (cons 50 0)(cons 62 1))) ))) (entmake (list '(0 . "LINE") (list 10 (* 0.9 i) 0 0) (list 11 (* 0.9 i) (+ -2 n) 0)(cons 62 1))) (setq i (1+ i) n 0) ) (setq p1 '(-3 -30 0)) (setq points (list '(-3 0 0) '(15 0 0) '(15 -7 0) '(4 -7 0) '(4 -15 0) '(-1 -25 0) '(-1 -30 0) '(-3 -30 0))) (foreach p points (entmake (list '(0 . "LINE") (cons 10 p1) (cons 11 p))) (setq p1 p) ) (entmake (list '(0 . "ENDBLK"))) )
  11. 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
  12. hi, my problem is that i want to get the information of a several number of Autocad files into an Excel file that i´ve already made previously(becouse in that Excel file, i have excel´s macros to work easier) , and the code that i´m going to show now, opens a new Excel and that´s what i don´t want to. I have the excel file that i want to work with, in a route like "C:\Users\Desktop\actualiza.xlsm" Thanks beforehand (if (and Dwg$lst (apply 'or (apply 'append (mapcar 'cadr Dwg$Lst)))) (progn (setq xlApp (vlax-get-or-create-object "Excel.Application") xlCells (vlax-get-property (vlax-get-property (vlax-get-property (vlax-invoke-method (vlax-get-property xlApp "Workbooks") "Add" ) "Sheets" ) "Item" 1 ) "Cells" ) )
  13. volkansahin

    Hello everybody,

    I need a complicated lisp for take information to attributes and choose blocks in cad file. So, I am working about Building Automation Systems, I am preparing "point list" and " connection diagram" for a project. My manager wants a lisp from me for choose blocks and insert data from excel point list automatic. Can anybody help me for it? I have not any idea about lisp language.( I am searching some solutions last 2 days. if possible, a lisp will look to point list, choose module type (there are 3 type modules, so 3 blocks.) and draw modules as example and will write module no, cable no (C1-xxx), equipment name and description to attributes. I attached point list and example blocks to here. Thanks for your helps. diagram_example.dwg point list.xlsx
  14. Good morning! I have not had any luck in finding much that my novice LISP skills can fix up to suit my needs. Perhaps someone here has something laying around? I am looking to have a LISP that does the following: allows the user to select one or more dimensions Allows user to pick from 3-4 options with the underlined letter being what the command needs: (XHM), (THR), (YJM), and (CPA) Then add the user selected string as a dimension suffix to the selected dimension. We add suffixes to dimensions often, and there are several different ones we use daily. Just looking to save time by having a command that will add the selected string to the suffix. Does anyone have anything similar? I am able to do some editing to suit my needs, but I don't even know where to start with editing a dimension suffix via LISP. Thanks in advance!
  15. Anyone has a code to accomplish this? I am dealing with bunch of poorly converted lines from PDF that used to be AutoCAD text in the drawing. Greatly appreciated!
  16. hai, i need a small help.i have a working lisp routine which gives perpendicular line distance to main line when clicked on a place perpendicular, only thing i want to try and add is to remove the leader that adds and only add text without leader in position where i can click. pls reply if its possible... thanks:) (defun c:Test ( / s p c a d) (if (and (setq s (car (entsel "\nPick a polyline :"))) (or (= (cdr (assoc 0 (entget s))) "LWPOLYLINE") (alert "Invalid object! Please pick a polyline only.") ) (setq p (getpoint "\nSpecify point perpendicular to polyline :")) (setq c (vlax-curve-getclosestpointto s p)) (setq a (angle p c)) (not (grdraw p c 1 -1)) ;; rubber line in red colour. (setq d (angle '(0. 0. 0.) (vlax-curve-getfirstderiv s (vlax-curve-getparamatpoint s c)))) (or (or (equal (rem (+ d (* pi 0.5)) (+ pi pi)) a 1e-4) (equal (rem (+ d (* pi 1.5)) (+ pi pi)) a 1e-4) ) (alert "Picked point is not a perpendicular to picked polyline. <!>") ) ) (command "_.leader" "_non" p "\\" "" (strcat "CHAINAGE=3+0" (rtos (vlax-curve-getdistatpoint s c) 2 4)) "") ) (princ) ) (vl-load-com)
  17. Hello Anybody Help. I need to get point from spline with use lisp function in autocad vba vlax-curve-getPointAtDist Could somebody can help me? Best Regard Joe
  18. Could anyone help me with it?? I am trying to install Global Attribute Extractor & Editor (http://www.lee-mac.com/macatt.html) on a colleague's computer which has Windows 10 inside. When I run extractor or editor, Autocad let me to state all the blocks and the files. However, when i press ok button it send me a error with automatisation problem. Did you have something similar?
  19. Goal: To select all the the objects I want to manipulate at once using a selection window, then the lisp program modifies the properties of just the Circle Entities in that selection. Below I am currently just changing the color property. After modifying the circles, I would like to modify all polyline & LWpolylines with a separate color change. I do not want to have to select the objects twice. Hopefully if this is possible I would like to followup saving Mtext or Text entites in another list. Below is where I have landed after two days of searching for solution. I am not a novice to programming but am with the lisp language. My assumption is that the ssget "_P" command can only be used once. The lisp runs and works for changes the circle entities, but not he polylines.( Command Output shown after the lisp script below) (defun c:FGT (/ ss sf1 sf2 ) (princ "\nSelect objects to export: ") (setq ss (ssget '((-4 . "<or") (0 . "CIRCLE") (0 . "MTEXT") (0 . "TEXT") (0 . "LWPOLYLINE") (0 . "POLYLINE") (-4 . "or>")))) (setq sf1 (ssget "_P" '((0 . "CIRCLE")))) (command "_chprop" sf1 "" "c" "150" "" ) (setq sf2 (ssget "_P" '((-4 . "<or") (0 . "POLYLINE") (0 . "LWPOLYLINE") (-4 . "or>")))) (command "_chprop" sf2 "" "c" "green" "" ) ) COMMAND: Command: FGT Select objects to export: Select objects: Specify opposite corner: 107 found Select objects: _chprop Select objects: 104 found Select objects: Enter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness/TRansparency/Material/Annotative]: c New color [Truecolor/COlorbook] : 150 Enter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness/TRansparency/Material/Annotative]: Command: _chprop Select objects: Command: FGT Unknown command "FGT". Press F1 for help. Command: c Unknown command "C". Press F1 for help. Command: green Unknown command "GREEN". Press F1 for help. Command: FGT Unknown command "FGT". Press F1 for help. Command: nil Command: Automatic save to C:\Users\Wesley\appdata\local\temp\Test_1_6214_5330.sv$ ... Command: Command: 'VLIDE Command: Command: Specify opposite corner or [Fence/WPolygon/CPolygon]:
  20. Dani_Nadir

    Coordinates LISP

    Hello, I am looking for the next lisp. I need to create a plline (for example a rectangle) wherever I want inside the model. Then, the routine will ask me about the distance between coordinate tic marks (x) , the plot scale (1/500 for example) and the height text. Then I will click the rectangle and finally it will create all the coordinate tick marks inside the rectangle as an editable objects (block for example) with its coordinates N (vertical) and E (horizontal). I am attaching a dwg Thanks, Best regards, Daniel. 1.dwg
  21. hhhhhhhanna3

    LISP Sq.Ft

    Hi All, Could anyone help me please?... I have been looking for a LISP file that calculates sq.ft. of a closed polyline and generates a sq.ft. text inside the polyline. Unit of the file that I am working on is metric, but I want sq.ft. instead of sq.mm.. Thank you so much in advance!
  22. Hello guys .... is there is any Lisp Routine for each layouts to separate dwg files ..... with bind all the xrefs thanx guyzz:roll::roll:
  23. bogeymen77

    simple area

    i'm looking for a simple area routine base on the dimension not the line. i want to be able to click on 2 cotation that i got from the dimlinear command and have the area "print" in a text format where i want to. I know a routine with a lot of visual lisp routine in it, but i'm looking a version with a standard/ basic lisp. thank you.
  24. 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.
  25. I made below lisp code to have field code copied to text,dim etc. but not work on ATT thing anyone could help me with this how to make it happen that copy field code to ATT? :) (defun c:ffd () (progn (setvar "cmdecho" 0) (setvar "blipmode" 0) (vl-load-com) (progn (setq ent (entsel "select text to be copied:")) (setq egg (cdr (assoc 0 (entget (car ent))))) (setq entx (vlax-ename->vla-object (car ent))) (cond ((= egg "INSERT") (setq entp (entget (car (nentselp (cadr ent))))) (setq entr (cdr (assoc -1 entp))) (setq objid (vla-get-objectid (vlax-ename->vla-object entr))) (setq field (strcat "%<\\AcObjProp Object(%<\\_ObjId " (itoa objid) ">%).TextString>%")) ; %<\AcObjProp Object(%<\_ObjId 8796059764128>%).TextString>% ; %<\AcObjProp Object(%<\_ObjId 8796083319744>%).TextString>% ) ((= egg "DIMENSION") (setq objid (vla-get-objectid entx)) (setq field (strcat "%<\\AcObjProp Object(%<\\_ObjId " (itoa objid) ">%).Measurement \\f \"%lu2\">%")) ) ) ;%<\AcObjProp Object(%<\_ObjId 8796059773904>%).Measurement \f "%lu2">% (setq ent1 (entsel "copy to:")) (setq egg1 (cdr (assoc 0 (entget (car ent1))))) (setq entx1 (vlax-ename->vla-object (car ent1))) (cond ((= egg1 "INSERT") (setq entp (entget (car (nentselp (cadr ent1))))) (setq entr (cdr (assoc -1 entp))) (vla-put-TextString (vlax-ename->vla-object entr) field) ) ((OR (= egg1 "TEXT") (= egg1 "MTEXT")) (vla-put-textstring entx1 field) ) ((= egg1 "DIMENSION") (vla-put-TextOverride entx1 field) ) ) ) ) )
×