Search the Community
Showing results for tags 'length'.
-
Version 1.7.0
3,303 downloads
This program will calculate the total length of Lines/Polylines/LWPolylines/Arcs/Ellipses/Circles/Splines with an optional filter. The Filter may be used to select only those lines that are on a certain layer, or perhaps have a certain linetype or colour. The results of the calculation can be displayed in an ACAD Table within the drawing, or written to either a CSV or TXT File. The Table-Style may be selected from the drop-down in the main dialog. Main interface The main dialogue box allows the user to filter lines by layer, linetype or colour and select the table style. Multiple selected items can filtered. A filter string may be entered to help the user quickly find the filter items that he/she requires. Options The options dialogue box allows the user to specify which object types should be included and the type of output, table in the drawing, CSV file or TXT file. Demo Function Syntax: LenCal For instructions on how to run the program see here. Any comments, criticism and suggestions are welcome. Either PM me directly, or reply to the original thread. -
Draw Polyline with Specified Max. Length & Insert Text For Length
JCYK posted a topic in AutoLISP, Visual LISP & DCL
Hi all, I would like to ask for your help to create a lisp to facilitate the following task (FYI I'm not versed in creating lisp). Sometimes we need to check floor plans to ensure all areas are within the max. fire escape travel distance (TD). I'll need to draw polylines (consists of few segments) from exit staircase entrance and see the max. TD can covers up to where. Each time I have to estimate the length as I draw the polyline, followed by go to properties to check the length, then adjust the polyline length, then check the length and keep repeating these steps until the polyline reached exactly the max. TD. And I have many of these polylines that I need to draw and is very time consuming. Fyi the max. TD can varies depending on the space usage. As such it would be very helpful if there's a lisp to create polyline with the following function: 1. User defined max. distance that I can draw; 2. While drawing the polyline, as the mouse cursor moves there's a live display of the total distance next to the cursor. This is to help us to know it has so far reached how much distance; 3. Once reached the final click where the max. distance has reached, polyline command ended and will ask for placement of text to display the distance (eg. 60m). As different projects/ plans will have different scale there needs to have an option for user to specify text height before placement. When drawing subsequent polylines the last specified text height will remain as default. Meaning when prompted for text height it will shows the last specified height as default, user just need to press enter if they don't wish to change the text height. Appearance of Polyline/ Text: 4. Linetype: DASHED2 (acadiso.lin) 5. Polyline width: 50mm 6. Linetype Scale: 0.2 7. Layer: Use current 8. A circle of 200mm diameter to mark the start point of polyline; an arrow head to mark end of polyline (Refer to screenshot below and attachment). 9. Text Style: Arial Any help on the above would be very much appreciated. Many thanks in advance! Polyline with Defined Distance.dwg -
Change to get result of text to Excel Workbook cell. Pls Help
minejash posted a topic in AutoLISP, Visual LISP & DCL
Hai, i need a help. I have a working lisp routine which gives me distance(chainage) of polyline when clicked on the pline i selected. It will add a text there showing chainage. Only thing i want is i need the chainage also in an external Excel Workbook cell. Like when i click and get the chainage there i want to get that chainage in excel workbook cell which is open (like Click to Xls lisp). Pls reply if its possible... thanks Attaching the lisp file and also adding same lisp code below. ;-- PIPE CHAINAGE abhi- CAA -- (defun c:CAA (/ s p c tp sch f) (setvar "cmdecho" 0) (setq sch (getstring "\nSpecify start chainage : <0>")) ;"0" is set as the default value (if (= sch "")(setq sch "0")) (if (and (setq s (car (entsel "\nPick a polyline :"))) (or (= (cdr (assoc 0 (entget s))) "LWPOLYLINE") (alert "Invalid object! Please pick a polyline only.") ) ) (while (and (setq p (getpoint "\nSpecify point :") ) (setq c (vlax-curve-getclosestpointto s p)) (setq tp (getpoint "\nSpecify Point for Text : ")) ) (setq di (vlax-curve-getdistatpoint s c)) (setq f (fix (/ di 1000.0))) (setq di (- di (* f 1000.0))) (command "_.LEADER" c tp "" (strcat "FF-LINE 01" ) (strcat "CH=" (itoa (+ (atoi sch) f)) "+" (rtos di 2 3)) "" ) (vlax-put-property (vlax-ename->vla-object (entlast)) 'height 3.50);;; Text Height 3.50 ) ) (setvar "cmdecho" 1) (princ) ) (vl-load-com) LINE CHAIN & CORDS - CAA.LSP -
To get length of polyline from start to upto where i click
minejash posted a topic in AutoLISP, Visual LISP & DCL
Hai, i need a help in editing a lisp code. I have a working lisp routine which gives me perpendicular distance to main pline when clicked on a place perpendicular to the pline i selected. Only thing i want to change is i dont need perpendicular distance from main pline but i need same main pline distance(chainage) where i click. Pls reply if its possible... thanks:) Attaching the lisp file and also adding same lisp code below, (defun c:CE (/ s p c a d tp sch) (setvar "cmdecho" 0) (setq sch (getstring "\nSpecify start chainage : <0>")) ;"0" is set as the default value (if (= sch "")(setq sch "0")) (if (and (setq s (car (entsel "\nPick a polyline :"))) (or (= (cdr (assoc 0 (entget s))) "LWPOLYLINE") (alert "Invalid object! Please pick a polyline only.") ) ) (while (and (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. <!>" ) ) (setq tp (getpoint "\nSpecify Point for Text : ")) ) (command "_.LEADER" p tp "" (strcat "CH=" sch "+" (rtos (vlax-curve-getdistatpoint s c) 2 3)) (strcat "E=" (rtos (car p) 2 3)) (strcat "N=" (rtos (cadr p) 2 3)) "" ) (vlax-put-property (vlax-ename->vla-object (entlast)) 'height 0.60);;; Text Height 0.60 ) ) (setvar "cmdecho" 1) (princ) ) (vl-load-com) COORD & CHAIN - FINAL AB.LSP -
Line / polyline length to clipboard after selection
MP7 posted a topic in AutoLISP, Visual LISP & DCL
Hello guys, anyone knows if there is a lisp that copies a line or polyline length automatically to clipboard after selecting it? I have A LOT of polylines and I have to insert their lengths into a table, it's a bit of a pain in the ass having to write every single length, just select paste select paste seems faster right? :) Thx. -
Hello, I'm using a nice LISP which lists the segments length of a polyline you select, but I would just like to add shortest, longest and average below the text "total polyline length is..." like MIN: xx MAX: yy AVG: zz (defun c:Test (/ T_Entity T_Object T_Start T_End T_SegmentLengths T_Count) (if (and (setq T_Entity (car (entsel "\nSelect polyline: "))) (= (vla-get-ObjectName (setq T_Object (vlax-ename->vla-object T_Entity))) "AcDbPolyline") ) (progn (setq T_Start (vlax-curve-getStartParam T_Object)) (setq T_End (vlax-curve-getEndParam T_Object)) (while (< T_Start T_End) (setq T_SegmentLengths (append T_SegmentLengths (list (- (vlax-curve-getDistAtParam T_Object (setq T_Start (1+ T_Start))) (vlax-curve-getDistAtParam T_Object (1- T_Start)))))) ) (setq T_Count 0) (foreach T_Item T_SegmentLengths (princ (strcat "\nSegment " (itoa (setq T_Count (1+ T_Count))) ": " (rtos T_Item (getvar "LUNITS") 6))) ) (princ (strcat "\n\n ** Total polyline length is " (rtos (vla-get-Length T_Object) (getvar "LUNITS") 6))) ) (princ "\n ** Nothing selected or not a polyline.") ) (princ) ) Thx MINMAXLENGHTS.lsp
-
Hai all, i have a lisp that gives me Length and Width of Rectangles that i select into a Table in cad. the table gives me the length and width as per incremental in size (eg:{ 1x2, 1.2x2, 2.1x3 } like wise) i have attached a screenshot of this, and also joins same size rectangle in one cell and shows number as 2. What i need help is to get the table not as incremental values but as i select (1st selection in first cell, 2nd in second cell like that). Please check the Screen shot. i don't know how to change the codes, the lisp is from a friend i got. so please help if possible , thanks in advance.. Please check the image ive uploaded too. the lisp code: (defun rectangle_dims (e / l a b) (setq l (mapcar 'cdr (vl-remove-if '(lambda (x) (/= (car x) 10)) e))) (if (and (or (= 1 (logand (cdr (assoc 70 e)) 1)) (equal (car l) (last l) 1e-8) ) (equal (distance (car l) (caddr l)) (distance (cadr l) (cadddr l)) 1e-8) (equal (mapcar '- (cadr l) (car l)) (mapcar '- (caddr l) (cadddr l)) 1e-8) (equal (mapcar '- (caddr l) (cadr l)) (mapcar '- (cadddr l) (car l)) 1e-8) ) (vl-sort (list (distance (car l) (cadr l)) (distance (cadr l) (caddr l))) '<) ) ) (defun C:RECDIMS (/ acObj acDoc space *error* ss e old r p1) (vl-load-com) (setq acObj (vlax-get-acad-object) acDoc (vla-get-activedocument acObj) space (vlax-get acDoc (if (= 1 (getvar 'cvport)) 'PaperSpace 'ModelSpace)) ) (vla-startundomark acDoc) ;;;;;; Error function ;;;;;;;;; (defun *error* (msg) (and msg (not (wcmatch (strcase msg) "*CANCEL*,*QUIT*,*BREAK*")) (princ (strcat "\nError: " msg)) ) (vla-endundomark acDoc) (princ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (if (setq ss (ssget '((0 . "LWPOLYLINE") (-4 . "<OR") (90 . 4) (90 . 5) (-4 . "OR>")))) (progn (repeat (setq i (sslength ss)) (setq e (ssname ss (setq i (1- i)))) (if (setq dims (rectangle_dims (entget e))) (if (setq old (vl-some '(lambda (d) (if (equal (list (cadr d) (caddr d)) dims 1e-8) d)) r)) (setq r (subst (cons (1+ (car old)) dims) old r)) (setq r (cons (cons 1 dims) r)) ) ) ) (if (and r (setq p1 (getpoint "\nSpecify table insert point: "))) (insert_table (mapcar '(lambda (a) (list (cadr a) (caddr a) (car a)) ) (vl-sort (vl-sort r '(lambda (a b) (< (caddr a) (caddr b)))) '(lambda (a b) (< (cadr a) (cadr b)))) ) p1 ) ) ) ) (princ) ) ;;The textheight in table depends on cannonscale (defun insert_table (lst pct / tab row col ht i n) (setq ht (/ 2.5 (getvar 'cannoscalevalue)) pct (trans pct 1 0) n (trans '(1 0 0) 1 0 T) tab (setq tab (vla-addtable space (vlax-3d-point pct) (+ 2 (length lst)) (length (car lst)) (* 2.5 ht) ht)) ) (vlax-put tab 'direction n) (mapcar (function (lambda (rowType) (vla-SetTextStyle tab rowType (getvar 'textstyle)) (vla-SetTextHeight tab rowType ht) ) ) '(2 4 1) ) (vla-put-HorzCellMargin tab (* 0.14 ht)) (vla-put-VertCellMargin tab (* 0.14 ht)) (setq lst (cons '("Width" "Length" "Pcs.") lst)) (setq i 0) (foreach col (apply 'mapcar (cons 'list lst)) (vla-SetColumnWidth tab i (apply 'max (mapcar '(lambda (x) ((lambda (txb) (+ (abs (- (caadr txb) (caar txb))) (* 2.0 ht))) (textbox (list (cons 1 (vl-princ-to-string x)) (cons 7 (getvar 'textstyle)) (cons 40 ht))) ) ) col ) ) ) (setq i (1+ i)) ) (setq lst (cons '("RECTANGLES") lst)) (setq row 0) (foreach r lst (setq col 0) (vla-SetRowHeight tab row (* 1.5 ht)) (foreach c r (vla-SetText tab row col (vl-princ-to-string c)) (setq col (1+ col)) ) (setq row (1+ row)) ) ) (princ "\nType RECDIMS to start the command")
-
-
Hello, I am new in coding lisp files. I worked with vb.net so this is very strange for me at this moment . I want to to select two points with different coordinates and to calculate difference between Z. I want to label that difference and to draw line with specific length under text. I did some coding which I pasted below but it wont draw line. I think that somehow I can not create pt2 and use it. Please help me because my head will blow... Code is below... THANKS (defun c:raz ( / p textloc p1 p2) (vl-load-com) (setq mspace (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)))) (setq p (getpoint "Odaberite tacku terena: ")) (setq zt (rtos (caddr p))) (setq pomocni 1) (setq p5 (getpoint "Odaberite tacku toplovoda: ")) (setq zc (rtos (caddr p5))) (setq p1 (getpoint "\nOdaberi poziciju teksta.")) (setq y (rtos (car p1))) (setq x (rtos (cadr p1))) (setq z (rtos (caddr p1))) (setq thetext (vla-AddText mspace zt (vlax-3d-point (car p1) (cadr p1) [lz] ) "0.65")) (setq TTT (atof(cadr p1))) (setq p2 (list (+ TTT 2.24) (cadr p1) (caddr p1))) (setq YY (- x pomocni)) (command "Line" p1 p2 "") )
- 15 replies
-
- length
- help with lisp
-
(and 2 more)
Tagged with:
-
Hello to all!... I'm again needing a help, are there a LISP that's possible get a length path from a polyline disposed over other lines? As a exemple attached has a drawing showing what exactly is this thread. The colored lines are the possible paths, each one has two texts (Name and Length) of possible path, over there has 3 lines showing the examples, using a "polyline" (I guess), I'll dispose over the path that I'm asking for the length, eg: Path 1, get 2 names and 2 lengths: PATH1 = 1010.1818 + 540.1862 => Total length =1550.368 Path 2, get 3 names and 3 lengths: PATH2 = 1010.1818 + 552.4334 + 379.7464 => Total length = 1942.3616 Path 3, get 5 names and 5 lengths: PATH3 = 1010.1818 + 552.4334 + 355.2488 + 548.7819 + 1333.2688 => Total length = 3769.9147 Is possible to create a table for each path with the names and length? Or one other way to get this informations using a polyline (I guess the best way) or selecting the path names? Is possible to link that 2 text as a feature of a polyline for each part and then get these informations? Thanks in advance!!!... Path length.dwg
-
A line from point A at a known length to a known plain but unknown angle - HELP :)
macbaydn posted a topic in AutoCAD Beginners' Area
Hi, I want to draw a line on an angle from a known start point at a known length to a known finished plane (but not a known finish point or angle). Hopefully the attached pdf explains it better than I have here. I have turned on OSNAP to get the start point of my line then turned it off again to enable me to select the end point of my line without it snapping to the end or midpoint while it shows the length of my line on screen but this isn't completely accurate. Any ideas would be greatly appreciated? AutoCAD Line Drawing question.pdf -
Calculate the Dip (angle) of a 3D Polyline
toxicsquall posted a topic in AutoLISP, Visual LISP & DCL
Hi, I would like to know: are there any lisp that can calculate the DIP and the length of a 3d Polyline, in Front View or any other view? -
Wants to select the same block having exactly same dimensions?
tipu_sultane posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
I got a some type of network and wants to count the block having the exactly same dimensions. This is because to make their division with respect to length. Example say there is total 27 number of blocks having the length 7 meter etc. But I am facing the problems, when I select the blocks, all have been selected. Find below the attached images of my method which I apply. I just first used the explode command then select the block select similar object and move to somewhere else. I need some help to solve this problem. I have used the command like list and area but I believe its time consuming and hope there is a simpler method to do this job. -
Hello guys, well i have a homework for the exams and i have no time, so i need your help. The question is, how i can measure the exact length of an arc (or a polyline) ? See the pic.
-
Hi, I don't know if it's good place to post it but finally there's a plugin in Autodesk exchange to count total length of elements. It names 'Tlen' and I've found it very handy. Cheers adam
-
Dears, Someone knows how I can get a length of one arc or object (more than one) and construct a line after it with all lenghts separated for a specific space between each one. Thanks
- 18 replies
-
- length
- creating line
-
(and 1 more)
Tagged with:
-
Hello Now that the problem with OS, XP, W7, 16bit, ... is solved with this little lisproutine, which I'm very happy for it, I discover another small limitation. I noticed that it only measures arc's and no lines. Is it possible to fix this problem? It would be great if it also can measures lines (at the same time time) Does anybody can help me with? Thx in advance Gr ARCRLVOOR_DimVoorSnijden.lsp
-
Is it possibel to link all lengths to unit QTY in bom, and partlist, i know frame Generator is using G_L for length, i've tried using it in other parts but no result. also when doing multi body parts, how is it possibel to use parameter in assembly parts. i'm interrested in this because i do alot af cutlists, and it is quit tedious, doing it manual. so to sum up, general length parameter to use in assembly's and in multi body parts. some exsamples on how ypu do. i am a newbi. so sorry if this is a no brainer
-
- multi body
- length
-
(and 2 more)
Tagged with:
-
Long Length Line = jumpy cursor?
LClough posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
(AutoCAD LT 2013) If I draw a lengthy line across the screen, whatever scale I am drawing, the cursor seems to jump a few inches even when I am trying to be extra smooth with the mouse, I have updated my graphics card recently and no real change, what else can I do? Cheers, Lloyd -
extract of length of polyline connected to block
guigol posted a topic in AutoLISP, Visual LISP & DCL
Hi, I'm a french user of AutoCad, so I hope my english will be great. I work in public work. For a new project, our client gives us : *___a large amount of plan representing *____________"pull box" (burried in the ground) *____________section of cables connected to the pull box. *___for each plan, we have an excel table which give us for each section *____________the start pull box *____________the finish pull box But we don't have the length of section in this table. We have a lot of plans and for each plan, there are lot of section. Pull box are block with attributes section are polyline. We are looking for a code who can extract the length of all section of a plan Is there someone here who can help me? a lisp code that is almost the same that i'm looking for ? something i can adapt ? Thank you in advance. If you have question, don't hesitate. -
I receive drawings from others and do material take-offs. I need to learn how to make real measurements electronically in a drawing so I can stop having them plotted so I can use a scale. thanks! gsf
- 11 replies
-
- scaled area
- real dimensions
-
(and 3 more)
Tagged with:
-
Hey all, i was wondering if it is possible to automatically add letters/numbers after i type something? Say I have a table full of cups, i count these cups and i find i have 9. "9 cups" is what i want to see after i type "9" and hit 'Enter' Because "9" is shorter in horizontal length than "10" i want this text to automattically add itself in after ive typed in my information, otherwise i could have had another line of text placed after it, but because the infomation changes in horizontal length, it is easier to automatically fill in another word following.. I hope this is easy enough to understand, please if you have ANY ideas, please mention them!
-
Hello all, I want to put a text about the polyline. Now I do the steps listed below. 1. polyline with Len2Fld.lsp read. 2. edit text for the street, material and diameter. 3. text-align with DTCurveV2 9.lsp. (Thank you very much Mr. Lee McDonnell.) It is a procedure if a large enough clusters with 50,000 inhabitants. The above-mentioned wish to edit in a single pass. -polyline-read length, choose the material and diameter (from a list) and finally to have an open field where you enter the street name or other (can be 2 to 3 fields to fill). Attach to a water network example I apologize for my English. I'm use Acad2008. Best Regards. Sample Water Network 3.dwg
-
I am trying to dimension some of my house plans in inches to clarify some details for a subcontractor but am having some trouble. Attached is an example of what I am having difficulty with. I am running LDD AutoCAD 2002. I set the project and drawing to draw in Ft but when I use the Architectural dimensioning to get some ft and inches they do not match the length displayed in the properties. When I dimension using Decimal it shows it correctly unitless. As you can see in the attached the line is dimensioned as 40' 0" but the properties for the line indicates it as being 480 - apparently 480". How can I make the drawing units be feet so when I dimension in Architectural this particular drawing will show 480' 0" and the properties will also display a unitless 480. I have checked drawing settings, project settings, everything I can find to open and everything is set to Ft. I have found forum discussions about changing the scale, but that still isn't giving me a matching property length with the architectural dimension. I can of course just set a dimstyle to unitless and put the ' suffix, but I would like inches - everything has been drawn in respect to Ft. Any help would be greatly appreciated, thanks for everyone's time.