Jump to content

Search the Community

Showing results for tags 'polyline'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • 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


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

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...

Found 110 results

  1. Hi to all, Please someone knows one lisp to get length of a PL (polyline) and write it above this PL in associative and dynamics form? As the Picture. If the length is changed the text follow these data. Thanks in advance.
  2. Hi everybody, this is my first post. I need a Lisp to generate a polyline from existing points. The polyline should be created from all the points at the edge of the cloud of points generated by a 3d scanner. The points are in 3 dimensions, but they could be flatted to zero. The polyline can be close or open: it does not matter. Any idea? Thank you folks in advance. dave:acad:
  3. Hey guys, I'm trying to get the four corners of a rectangle in modelspace set to variables and I'm having a hard time with it. I'm able to get the four corners into a list, but I'm having a hard time setting each coordinate to a variable. The issue I'm having at this point is that the second variable duplicates the coordinate values. The first variable Here's what I got so far... (defun c:test (/ ptlist x y) (setq ptlist (massoc 10 (entget(car(entsel))))) (defun c:massoc (key alist / x nlist) (foreach x alist (if (eq key (car x)) (setq nlist (cons (cdr x) nlist)) ) ) (reverse nlist) ) ;end (princ ptlist) (setq x (car ptlist)) (setq y (cadr ptlist)) (princ) (princ x) (Princ) (princ y) ) I got part of this code from here When I draw in a rectangle in modelspace and I use this code, this is what I'm getting. Command: TEST Select object: ((18.2488 -11.0958) (23.6419 -11.0958) (23.6419 -5.32136) (18.2488 -5.32136))(18.2488 -11.0958)(23.6419 -11.0958)(23.6419 -11.0958) So it builds the list and sets the first variable right, but it duplicates the second. Thanks in advance! e: I haven't added in error trapping yet, just trying to figure this out first.
  4. Does anyone know of a field expression or lisp routine that will allow me to display a count of the number of polylines on any specified layer? I would like the number displayed to be able to update as I add polylines to the layer, just as an area field expression would update on regen. Thanks very much
  5. Hi I am using AutoCAD 2014 'Architecture workspace' and I use the Properties palette a lot to change the attributes of linework to display linetypes/global thickness/scale etc. However, when I click on the model item (eg. polyline) the Properties palette doesn't change to inform me what the properties are of that item. Instead, it stays the same as the default properties type. Also, things like Global Width/Length/Area etc do not show in the Properties box - is there a way of loading or changing this as I believe I might have the wrong Palette loaded etc ?? Is there a way to load a new palette? Please help? Cheers Paul
  6. Evening All I work as a design assistant for a West End Set Designer who loves working in forced perspective & vanishing points. My question is how do I slice/trim a 3d polyline that runs through a solid. I basically want to cut the line once it touches the face of the solid. I would be also happy to add a node. Attached is a small example of the working file. Look forward to your responses Cheers James EXAMPLE.dwg
  7. Hello, I am working on a tunnel alignment. I have to draw multiple closed 3d polylines from AutoCAD Points (which form the tunnel sections from the excavation). I use the 3POLY command and then the option "PN. Is it possible to write a script (or a lisp routine) that repeats this process? For example, I wrote this script 3POLY 'PN 1-10,1 (1 row blank) 3POLY 'PN 11-20,11 It draws the first closed 3dpoly (from point numbers 1 to 10 and closes to 1) but it not continues to second 3poly. Thank you in advance
  8. I have been searching for a very long time and i hope you can help me this way cause i found nothing. The thing is, i have a polyline and set its thickness but i need something like 3DFACE which can cover those open areas on the bottom and top. Nothing ever worked, except for dividing it into million pieces and applying 3dface/loft for each, lol
  9. I need a lisp routine that can take a long polyline and delete all the arc segments, thus leaving multiple shorter polylines (all consisting only of straight segments). Can anyone help me with this please?
  10. Hello. I have a drawing with a few layers, and in two of them i would like to know if it is possible to move one vertice of a polyline (in layer AR_COLECTOR_GR_200), and automatically move vertices of the polylines (in layer AR_RAMAL_LIGACAO_PVC_125) snaped to the other polyline in layer AR_COLECTOR_GR_200. The same happens when i have to move objects in layer AR_CAMARA_VISITA_NORMAL and then, i have to manually move objects connected to them in layer AR_COLECTOR_GR_200. This happens because i have gps points and i have to move objects in layer AR_CAMARA_VISITA_NORMAL to those points, and then update the position of AR_COLECTOR_GR_200 and AR_RAMAL_LIGACAO_PVC_125. Check the attached file to better understand my problem. The doubt is to know if there is any method available to go from step 1 to step 4 without having to make those updates manually Thanks for any help TestFile.dwg
  11. 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.
  12. Hi guys For some reason I can't extrude this polyline. I'd drawn it as a bunch of splines at first, but then I found out that they weren't joined together. I traced over all the individual splines with one spline, and then deleted everything underneath. It still won't extrude. Can anyone tell me why? I tried a bunch of things--pedit, joining, etc. Nothing. When I click 'extrude,' the command thing says 'select objects to extrude or [MOde]:'. I clicked my spline and it highlighted, and then I hit enter. The message doesn't change. Any suggestions?
  13. Hi there all, I am new here so forgive me if my question is vague or likewise is a bit over the top. I have been sent a client's construction drawing for a care home where i need to design the sprinkler installation. The majority of the rooms have got the same head positions within them, but they have all got a slightly different angle as the building is shaped like a banana. Unfortunately its not a uniform radius that i can tell as the one side is larger than the other. So my question is this. Normally, on a square building, I drop in construction lines along the bedrooms so that i know my sprinkler heads are all the same distance off a wall, and I only need to line up one side. However, with this building being a curve, and the wall angle being slightly different on each room, how do I place an angled construction line or polyline to act as my set out line for my heads. Ive been looking at the drawing and various forums now for the past 2-3 hours and still haven't seen an answer that helps greatly. Thanks in advance, Richard
  14. Is there any way to find out the Maximum vertical distance between two polylines?
  15. Does any body have any idea how can we find out the Text and Polyline intersection location using Autolisp? It will be better if we can mark error circles on a perticular layer on the intersection. Thanks in advance
  16. Hi, Earlier today I was joining some polylines and during the command AutoCAD temporarily froze. After a short time it resumed and I completed the task. However, after this some other polylines which have a thickness applied took on a 'wire-framed' appearance (see attached image where one of these lines has been selected). Now, I've had this happen before, but always been able to easily fix it with a regen or re-launch of the file or AutoCAD itself, but now that is not working. I even rebooted my PC but this did not help. It seems this only affects the file I was working on, an older copy of the file displays the same lines as normal. So, has anyone encountered this and is there a 'fix'?
  17. Hi all, I have a small question here. Is it possible in autoCAD (or via lisp) that when I draw a polyline and when I reach the first point again (from where I have started), the command terminates and give me a closed polyline. And if I dont reach to the first point, it automatically closes to the first point. This is just me make sure I'm not keeping the loop open for hatching? Any help is appriciated.
  18. Hello everyone, in order to obtain a seabed profile for a school project, I need to get the Y coordinate of a polyline on several Kilometers with a fxed X step of 2m between each point. For the moment, the only manual solution I have found is to create a vertical line every 2m and to get the distance between the intersection of this line with my polyline and an horizontal line representing the mean sea level. Is there any way to automatize it because it is very long to do manually and I don't have enough time ? I did not succeed in doing this with dataExtraction. I also found on the internet a LISP file which extract the coordinates of points contained in the window. Nevertheless, I was told it is not possible to create automatically points on a curved polyline with a fixed x step. What I need at the end is an excel file of this type to use it in another software: X(m) Water Depth (m) 0 15.121 2 15.134 4 15.147 ... ... I precise I am a beginner in autocad, I have started today. Have you got any idea to solve this problem ? Thank you in advance
  19. Hi, As the thread title suggests, I want to create a segmented polyline with known angles / lengths, but I want to do this in 1 operation without having to copy/rotate/chamfer etc. I think I'm gonna kick myself when I receive an answer to this as it seems to be something I should know. I'm sure it has something to do with UCS, but I've not used it in quite some time, I am stumped and everything I have tried so far has failed.
  20. Dear Lisp Masters, I need help to do this: 1 - Insert a Multileader with a user defined block - OK, no problem. 2 - Pick to place block - OK, no problem. 3 - Pick to place arrow - OK, no problem. So far so good, then a lisp capable of: 4 - Pick to select a polyline. 5 - Collect some info from polyline such as width, lenght, layer, vertices coodinates (x,y,z) etc. 6 - Pick to select a Multileader 7 - Insert the collected info into the block attributes values. It's possible to do that? Greetings from Portugal!!!
  21. I made a very simple lisp to draw a line according to a requested slope ratio like 1:4, 1:10 ect it works fine for "normal" angles, but when it comes to ratio like 1:60 or 1:0.001 the result is inconsistent... I mean sometimes it will be displayed fine, or on the x axis (ie with no inclination at all) or will draw only a point with no length or will snap to another line (sitting very close) And all of that even if the values for the end point are correctly computed... Something else, if I draw a very long line like (1700 m) then it's always displayed correctly... If someone has an idea/ explanation I'll be very thankfull here is the code (defun C:slp( / refpt dirpt x_ratio seglen xref yref dirangle reqangle xend yend) (setq refpt (getpoint "\nPick a reference point")) (setq dirpt (getpoint "\nPick a direction point")) (setq x_ratio (getreal "\nSlope ratio 1:")) (setq seglen (distance refpt dirpt)) (setq xref (car refpt)) (setq yref (car (cdr refpt))) ;zref=0 (setq dirangle (angle refpt dirpt)) (setq reqangle (atan 1 x_ratio)) (princ (strcat "\ndirection angle: " (rtos dirangle) " requested angle: " (rtos reqangle))) (cond ( (and (> dirangle 0) (< dirangle (/ pi 2))) (setq xend (+ xref (* seglen (cos reqangle)))) (setq yend (+ yref (* seglen (sin reqangle)))) (setq endpt (list xend yend 0.00)) (command "pline" refpt endpt "") ) ( (and (> dirangle (/ pi 2)) (< dirangle pi)) (setq xend (- xref (* seglen (cos reqangle)))) (setq yend (+ yref (* seglen (sin reqangle)))) (setq endpt (list xend yend 0.00)) (command "pline" refpt endpt "") ) ( (and (> dirangle pi) (< dirangle (/ (* pi 3) 2))) (setq xend (- xref (* seglen (cos reqangle)))) (setq yend (- yref (* seglen (sin reqangle)))) (setq endpt (list xend yend 0.00)) (command "pline" refpt endpt "") ) ( (and (> dirangle (/ (* pi 3) 2)) (< (* pi 2))) (setq xend (+ xref (* seglen (cos reqangle)))) (setq yend (- yref (* seglen (sin reqangle)))) (setq endpt (list xend yend 0.00)) (command "pline" refpt endpt "") ) ) ) Thank you all
  22. Hi guys, There are a number of forum topics around the internet asking similar questions, each with good answers (e.g. Lee Mac here) but so far I haven't found an answer to my problem. What I would like to do is extract information from several long polylines (each on specific layers) and create a csv text file of the output, saved to the same directory and with the same name as the .dwg file. I need each row of the .csv file to contain the coordinates of one point on a polyline (X,Y,Z) but then additionally include a fourth 'label' column which would be in the format: [DrawingName]_[Layer] DrawingName = name of the .dwg file Layer = layer the polyline is on Example output: X,Y,Z,Dwg1_layer1 X,Y,Z,Dwg1_layer1 ;one row for each point on polyline X,Y,Z,Dwg1_layer1 .... X,Y,Z,Dwg1_layer2 ;this is the next polyline, on 'layer2' X,Y,Z,Dwg1_layer2 X,Y,Z,Dwg1_layer2 etc The label column is necessary as I need to combine information from many different files and the ability to identify and sort where the data came from is essential. I've attempted to modify existing 'extract XYZ' code that I've found around the internet but it seems to be beyond my current lisp skills . Any help you guys can give would be simply amazing!
  23. Hello Everyone! I am using vanilla AutoCad (R14-2012) and was wondering what the best solution would be for this problem (other than manually drawing each outline which I currently do!) I am looking to draw polylines along each point creating a polyline outline (perimeter) around the selected points. This in itself is quite difficult to do well(haven't found a great method yet) but there are multiple groups of points that I would like polylines around without selecting each individual group of points (in an ideal world). I realize that getting something 100% right is impossible and some manual editing (maybe a lot!) will be required. Attached is a sample of the points I usually have to work with. Test 05 2013.dwg I have done a bit of research and found some close solutions which I will post below. 1. Draw the polyline by point ID (can't remember author) (vl-load-com) ;;; to make a 3d polyline******************************************* (defun c:pol (/ adoc spc ss cnt plst 3dline) (setq adoc(vla-get-activedocument(vlax-get-acad-object))) (setq spc(vlax-get adoc (if (equal (getvar "cvport") 1) 'PaperSpace 'ModelSpace );_if ) );_setq (setq ss (ssget '((0 . "POINT"))));_select only point objects (if ss (progn (setq cnt 0);_loop counter (setq plst '());_empty list (while (< cnt (sslength ss)) (setq plst (cons(cdr(assoc 10(entget (ssname ss cnt))))plst));_make point list (setq cnt (1+ cnt));_incerase counter );_while (setq 3dline (vla-add3dpoly ;_make 3d polyline spc (vlax-safearray-fill (vlax-make-safearray vlax-vbDouble (cons 0 (1- (length (apply 'append plst))))) (apply 'append plst))) );_setq add 3dpoly );_progn );_if (princ) );_defun ;;; to make a 3d spline****************************************** (defun c:spl (/ adoc spc ss cnt plst 3dline stpt ept) (setq adoc(vla-get-activedocument(vlax-get-acad-object))) (setq spc(vlax-get adoc (if (equal (getvar "cvport") 1) 'PaperSpace 'ModelSpace );_if ) );_setq (setq ss (ssget '((0 . "POINT")))) (if ss (progn (setq cnt 0);_loop counter (setq plst '());_empty list (while (< cnt (sslength ss)) (setq plst (cons(cdr(assoc 10(entget (ssname ss cnt))))plst)) (setq cnt (1+ cnt));_incerase counter );_while (setq stpt (vlax-3d-point '(0.0 0.0 0.0)));_start pt for spline (setq ept (vlax-3d-point '(0.0 0.0 0.0)));_end pt for spline (setq cline (vla-addspline spc (vlax-safearray-fill (vlax-make-safearray vlax-vbDouble (cons 0 (1- (length (apply 'append plst))))) (apply 'append plst)) stpt ept ) );_setq add 3d spline );_progn );_if (princ) );_defun 2. Convex Hull (Lee Mac ftw) ;; Convex Hull - Lee Mac ;; Implements the Graham Scan Algorithm to return the ;; Convex Hull of a list of points. (defun LM:ConvexHull ( lst / hul p0 ) (cond ( (< (length lst) 4) lst ) ( t (setq p0 (car lst)) (foreach p1 (cdr lst) (if (or (< (cadr p1) (cadr p0)) (and (equal (cadr p1) (cadr p0) 1e- (< (car p1) (car p0))) ) (setq p0 p1) ) ) (setq lst (vl-sort lst (function (lambda ( a b / c d ) (if (equal (setq c (angle p0 a)) (setq d (angle p0 b)) 1e- (< (distance p0 a) (distance p0 b)) (< c d) ) ) ) ) ) (setq hul (list (caddr lst) (cadr lst) (car lst))) (foreach pt (cdddr lst) (setq hul (cons pt hul)) (while (and (caddr hul) (LM:Clockwise-p (caddr hul) (cadr hul) pt)) (setq hul (cons pt (cddr hul))) ) ) hul ) ) ) ;; Clockwise-p - Lee Mac ;; Returns T if p1,p2,p3 are clockwise oriented or collinear (defun LM:Clockwise-p ( p1 p2 p3 ) (< (- (* (- (car p2) (car p1)) (- (cadr p3) (cadr p1))) (* (- (cadr p2) (cadr p1)) (- (car p3) (car p1))) ) 1e-8 ) ) (defun c:test1 ( / i l s ) (if (setq s (ssget '((0 . "POINT")))) (progn (repeat (setq i (sslength s)) (setq l (cons (cdr (assoc 10 (entget (ssname s (setq i (1- i)))))) l)) ) (setq l (LM:ConvexHull l)) (entmakex (append (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") (cons 90 (length l)) '(70 . 1) ) (mapcar '(lambda ( x ) (cons 10 x)) l) ) ) ) ) (princ) ) 3. Create surfaces out of points using triangulation and limit the length of triangle then use bounding box to create polyline(hard to do in vanilla AutoCad). 4. Neat solution shown by Tyke (which I don't have the code for) 5. Possibly use multiple Bpoly commands, somehow getting the Bpoly command to recongnize points??? 6. Outsource? Anywho, if you guys have any ideas as to (too?) other methods/possible solutions/software programs/ANYTHING that could be of help that would be awesome! Thanks again for reading, Kablamtron
  24. I'm not a programmer. I'm looking for a function to extract from autocad all the coordinates of polyline vertex with autocad handle. I work with autocad map 2012 and 2013. Help in that regard would be appreciated.
  25. Good day, dear Forumers, just recently our company partially switched from AutoCAD to Inventor, my department however still works with AutoCAD. This however means that I am required to edit "2D" sketches made with inventor. After struggling a bit with converting the new format into something I can actually select, I've come across a new problem: once I dissolve the block which contains the main model I am unable to convert the resulting lines into Polylines. only 50% of the lines actually connect to their adjacent lines/arcs. This means I have to redraw half the model, which, as you may agree, is unacceptable. Quite lenghthy web-searches have not been fruitfull. FLATTEN was suggested but I don't have the expess tools installed and don't think I can convince the admin to do so. Also it seems that All lines/arcs in question already are on the same Z level, namely 0. Thanks in Advance, CP++
  • Create New...