Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. It works, but the fence must pass on each side of the middle of the segment to be extended.
  3. Today
  4. I just did a quick look in AutoCAD, this may be a bit tricky for me. Let me get my paid to do work done and I'll do more looking.
  5. Tsuky

    Break Polyline at different depth

    Try the code modified. If equal starting and ending widths or global width is define, the global width is individual set otherwise is ignored. Also takes into account the last segment if the polyline is closed as well as the generation of the linetype as well as the UCS of the original entity (defun c:break_lw ( / js i ent dxf_obj dxf_43 dxf_38 dxf_39 dxf_10 dxf_40 dxf_41 dxf_42 dxf_39 dxf_210 n) (initget "All Select") (if (eq (getkword "\nLWPolylines to break at each vertex? [All/Select] <Select>: ") "All") (setq js (ssget "_X" (list (cons 0 "LWPOLYLINE") (cons 67 (if (eq (getvar "CVPORT") 2) 0 1)) (cons 410 (if (eq (getvar "CVPORT") 2) "Model" (getvar "CTAB"))) ) ) i -1 ) (setq js (ssget (list (cons 0 "LWPOLYLINE") (cons 67 (if (eq (getvar "CVPORT") 2) 0 1)) (cons 410 (if (eq (getvar "CVPORT") 2) "Model" (getvar "CTAB"))) ) ) i -1 ) ) (cond (js (repeat (sslength js) (setq dxf_obj (entget (setq ent (ssname js (setq i (1+ i)))))) (if (cdr (assoc 43 dxf_obj)) (setq dxf_43 (cdr (assoc 43 dxf_obj))) (setq dxf_43 nil) ) (if (cdr (assoc 38 dxf_obj)) (setq dxf_38 (cdr (assoc 38 dxf_obj))) (setq dxf_38 0.0) ) (if (cdr (assoc 39 dxf_obj)) (setq dxf_39 (cdr (assoc 39 dxf_obj))) (setq dxf_39 0.0) ) (setq dxf_10 (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) dxf_obj)) dxf_40 (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 40)) dxf_obj)) dxf_41 (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 41)) dxf_obj)) dxf_42 (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 42)) dxf_obj)) dxf_210 (cdr (assoc 210 dxf_obj)) ) (if (not (zerop (boole 1 (cdr (assoc 70 dxf_obj)) 1))) (setq dxf_10 (append dxf_10 (list (car dxf_10))) dxf_40 (append dxf_40 (list (car dxf_40))) dxf_41 (append dxf_41 (list (car dxf_41))) dxf_42 (append dxf_42 (list (car dxf_42))) n (cdr (assoc 90 dxf_obj)) ) (setq n (1- (cdr (assoc 90 dxf_obj)))) ) (repeat n (entmake (append (list (cons 0 "LWPOLYLINE") (cons 100 "AcDbEntity") (assoc 67 dxf_obj) (assoc 410 dxf_obj) (assoc 8 dxf_obj) (if (assoc 62 dxf_obj) (assoc 62 dxf_obj) (cons 62 256)) (if (assoc 6 dxf_obj) (assoc 6 dxf_obj) (cons 6 "BYLAYER")) (if (assoc 370 dxf_obj) (assoc 370 dxf_obj) (cons 370 -1)) (cons 100 "AcDbPolyline") (cons 90 2) (cons 70 (boole 1 (cdr (assoc 70 dxf_obj)) 128)) (cons 38 dxf_38) (cons 39 dxf_39) (cons 10 (car dxf_10)) ) (cond (dxf_43 (list (cons 43 dxf_43) (cons 40 dxf_43) (cons 41 dxf_43) ) ) ((equal (car dxf_40) (car dxf_41)) (list (cons 43 (car dxf_40)) (cons 40 (car dxf_40)) (cons 41 (car dxf_41)) ) ) (T (list (cons 40 (car dxf_40)) (cons 41 (car dxf_41)) ) ) ) (list (cons 42 (car dxf_42)) (cons 10 (cadr dxf_10)) ) (cond (dxf_43 (list (cons 43 dxf_43) (cons 40 dxf_43) (cons 41 dxf_43) ) ) ((equal (car dxf_40) (car dxf_41)) (list (cons 43 (car dxf_40)) (cons 40 (car dxf_40)) (cons 41 (car dxf_41)) ) ) (T (list (cons 40 (car dxf_40)) (cons 41 (car dxf_41)) ) ) ) (list (cons 42 (cadr dxf_42)) (assoc 210 dxf_obj) ) ) ) (setq dxf_10 (cdr dxf_10) dxf_40 (cdr dxf_40) dxf_41 (cdr dxf_41) dxf_42 (cdr dxf_42)) ) (entdel ent) ) (print (sslength js)) (princ " LWpolyline(s) breaked at its vertexs.") ) ) (prin1) )
  6. Nikon

    Break Polyline at different depth

    If a polyline consists of several segments and they have different widths, then the global width is not defined in the properties. If a polyline from the same segment has different starting and ending widths, then the global width is also not defined in the properties. The global width in the properties is displayed only for a polyline of several segments of the same width or a polyline of the same segment with the same starting and ending widths. If you want to set the same global width of the polylines, simply select all the polylines and set the desired width in the properties. Or did I misunderstand what you want to do?..
  7. @devitg Yours seams to not work for me at all @BIGAL I can't quite go through this routine to see final result. nothing happens after i daw a line. Also I already have a polyline that goes though all blocks that I need, so the part in lisp that tells me to draw line over blocks is unnecessary To be more precise. Lisp CopyBlockstocurve works great, the only part i want to change is that I dont want to click on each block to copy it to straight line. I want them to be copied automaticlly acording to pline that is existing
  8. Mohamed Haytham

    Break Polyline at different depth

    Thanks all for providing different lisps. All worked perfect in terms of breaking the poly, but I have one small issue, the global width is remained undefined. Is there a way even with a different lisp to assign the Global width from the start / End segment width?
  9. Another give it a try. ; https://www.cadtutor.net/forum/topic/98615-copy-blocks-to-curve-according-to-another-curve/ ; get blocks along a pline at any XY then redo as a straight line. ; By AlanH July 2025 (defun c:wow ( / bname co-ord ent obj plent pt spac ss x) (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) (setq plent (car (entsel "\pick pline joining blocks "))) (setq obj (vlax-ename->vla-object (car (entsel "\nPick block object ")))) (setq pt (getpoint "\nPick left point ")) (setq spac (getreal "\Enter spacing ")) (setq bname (vlax-get obj 'effectivename)) (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget plent)))) (setq ss (ssget "F" co-ord '((0 . "INSERT")))) (command "line" pt (mapcar '+ pt (list (* (- (sslength ss) 1) spac) 0.0 0.0)) "") (repeat (setq x (sslength ss)) (setq ent (ssname ss (setq x (- x 1)))) (setq obj (vlax-ename->vla-object ent)) (if (= (vlax-get obj 'effectivename) bname) (progn (command "copy" ent "" (vlax-get obj 'Insertionpoint) pt) (setq pt (mapcar '+ pt (list spac 0.0 0.0))) ) ) ) (princ) )
  10. If you have a reference point X&Y in metres and in feet then you can move the dwg to that point and apply a scale factor. 1 foot = 0.3048 m. There may be a conversion program for where you are in the world, feet to metres converting a point XY. It is easy to do a direct conversion but often with Geo stuff scale factors, world zones and so forth creep in. X=259975.41 Y=5129431.27 Z=0.00 : (/ 259975.41 0.3048) 852937.696850394
  11. @HypnoS Please give it a try cpy-blk-2-poly.lsp
  12. Yesterday
  13. As the drawing has Geomap, it is not converting from M to Ft. Can't use scale, -dwgunits, Classicinsert too. Is there an y lisp to convert without changing position? as layout and Geomap is there. HM25E - Permit & Design 1.dwg
  14. I know he uses BricsCAD and I used it for the last 5 years when I was still working in CAD. liked it a lot more the AutoCAD. there are differences but mostly for the better like double extend.
  15. amhere

    Annotative troubles

    Dear irneb, pBe, Your code is excellent, but I have an issue that I need help with. The code works fine when selecting only annotative objects. However, when selecting multiple objects for the code to automatically detect and process, it doesn’t completely remove all the excess annotation scales. Could you please help me revise the code to fix this?
  16. To summarize a recent discussion in a forum, User A mentioned the usefulness of TEXTALLCAPS in AutoCAD, and User B said they didn’t know about that command. The pedantic tips guy (me) chimed in and explained that it was actually a system variable. Always looking for subject matter for this space, I thought I’d explore the world of AutoCAD system variables, looking for diamonds in the rough. And I had plenty to choose from. I have no idea what the actual number is, but I counted 897. I’ll present some here today and label them (according to me) as either Cool, Useful, or Interesting. As always, your mileage may vary. The list will be presented in alphabetical order. Before we dive in, a little bit about AutoCAD system variables as all fall into a few categories. Their values are either saved in the drawing, the registry, or not at all. Most values are integers, but some are real numbers or even strings. I’ll label each accordingly for you. ATTIPE Integer | Registry | Interesting This controls whether or not the text formatting toolbar is displayed with the in-place editor when modifying multiline text. Are you looking for the same functionality for regular Mtext? You can find it in the ribbon, but the variable is called MTEXTTOOLBAR. MAXSORT Integer | Registry | Useful Have you ever called up a large drawing, maybe with a lot of Xrefs, and the layer list doesn’t sort alphabetically? That’s what MAXSORT does – it sets the maximum number for sorting these named items. It defaults to 1000, so set it to something higher, but beware, 32767 is the limit (which is, of course, the maximum value of a 16-bit signed integer.) MIRRHATCH Integer | Registry | Useful When we learned AUTOCAD, we were all taught about MIRRTEXT, but did you know it has a close cousin called MIRRHATCH? Since you know what the former does, I won’t explain the latter, but now you know. MTJIGSTRING String | Registry | Cool Our first “cool” entry is MTJIGSTRING. You know that little piece of preview text that appears in the corner of your box as you’re creating Mtext? That’s called the Jig String. And with this variable, you can change it to whatever you want, limited to 10 characters or under. NOMUTT Short | Not Saved | Cool Another cool entry and a card-carrying member of the AutoCAD All Name Team, NOMUTT, just had to be included here. But unless you’re a hardcore programmer, you’ll never use it. It was internal to Autodesk only for years and was finally made public sometime around 2006. It turns off Muttering, which is the normal command line messaging that is displayed. PEDITACCEPT Integer | Registry | Useful Do you convert lines or other objects into Polylines a lot? Do you get tired of AutoCAD asking you if you want to turn your selection into a Polyline? Set PEDITACCEPT to 1 to automatically convert it without the prompt. Now that’s useful. REPORTERROR Integer | Registry | Interesting This variable will suppress the display (and, therefore, submission of) the Customer Error Report (CER) if AutoCAD closes unexpectedly. I wasn’t aware of this one until I started researching this post. Let’s just say I immediately put it to good use for a client. TEXTALLCAPS Switch | Registry | Useful Ah, the variable that started it all. For many of us, it was drilled into us at an early age that lettering (now typing) was to be done in all caps. For the most part, that drafting standard has continued into today, with a few outliers choosing sentence case – which is generally what we use outside of AutoCAD. Better yet, it’s a registry variable, so turn it on once, and you’re good to go without having to remember to use that pesky Caps Lock key. TEXTGAPSELECTION Integer | Registry | Useful I recently trained a new user and quickly realized he was having problems selecting text. In a word, he often missed, thinking he was hovering over a text element when he actually wasn’t. Setting TEXTGAPSELECTION to 1 (on) solves that problem. With it enabled, you can select the text object by selecting the gaps or spaces between characters. Definitely useful. USER USERR USERS 12345 Integer, Real, String | Drawing | Cool If you’re a veteran AutoLISP coder, you probably know that AutoCAD gives you 15 blank variables that you can use for yourself. There are 5 of each type. USER holds integers, USERR gets real numbers, and USERS takes strings. These are all saved in the drawing, so they’re only valid while you’re still in your drawing session. VTENABLE Integer | Registry | Useful If you’re like me, and you may want your zoom to just happen and not use the cool, animated transition between views, set VTENABLE to zero and save some valuable milliseconds. It’s actually a true integer variable, as there are eight total settings you can choose from. Here is a link to the help file to assist you in making a wise choice. But, if you like the transitions, you’d like them to happen either faster or slower. Set VTDURATION to something other than its default 750 milliseconds. Please note that valid entries are between 0 and 5000 – and zero would also effectively turn VTENABLE off. And In The End How interesting. If you noticed, I listed two other SysVar types; “Short” and “Switch” to be exact. The learning never ends with AutoCAD, does it? If you want to further explore AutoCAD’s world of System Variables, the best place is from the System Variables tool found in the Tools panel of the Express Tools ribbon tab. There are 897 in there, and surely you’ll find your own little diamond. Happy hunting! More Tuesday Tips Check out our whole Tuesday Tips series for ideas on how to make AutoCAD work for you. The post AutoCAD System Variables List: Tuesday Tips With Frank appeared first on AutoCAD Blog. View the full article
  17. As time allows, I am still working at this. I have a conveyor screw to completely design and detail this week. I made a few tries messing with @Lee Mac's Offset Section LISP using some of those functions, but, I might try a new route.
  18. Even with AutoCAD probably still pretty fast for fence, but a LISP would help. I tried several things and I can't get AutoCAD 2026 to double extend as per @BIGAL's example.
  19. For future reference, in the supplied .dwg, it's LWPolyline shapes not 2D Polyline shapes as in the title, there is a difference. LWPOLYLINE Layer: "A_Dai_Coc_S_02" Space: Model space Color: BYLAYER Linetype: "Continuous" Handle = 167 Closed Constant width 0'-0" area 5418979.86 square in. (37631.8046 square ft.) perimeter 791'-11 9/32" at point X=22622'-6 5/16" Y=176'-5 5/8" Z= 0'-0" at point X=22784'-3 15/32" Y=141'-6 27/32" Z= 0'-0" at point X=22907'-5 13/32" Y=279'-3 15/16" Z= 0'-0" at point X=22708'-11 1/16" Y=378'-6 5/32" Z= 0'-0" 2D Polyline POLYLINE Layer: "KCS_DIM" Space: Model space Color: BYLAYER Linetype: "Continuous" Handle = 179 Open starting width 0'-0" ending width 0'-0" area 0.00 sq in (0.0000 sq ft) length 2566'-5 17/32" VERTEX Layer: "KCS_DIM" Space: Model space Color: BYLAYER Linetype: "Continuous" Handle = 17b at point, X=23794'-4 1/8" Y=-362'-5 9/32" Z= 0'-0" starting width 0'-0" ending width 0'-0" VERTEX Layer: "KCS_DIM" Space: Model space Color: BYLAYER Linetype: "Continuous" Handle = 17c at point, X=21227'-10 19/32" Y=-362'-5 9/32" Z= 0'-0" starting width 0'-0" ending width 0'-0" END SEQUENCE Layer: "KCS_DIM" Space: Model space Color: BYLAYER Linetype: "Continuous" Handle = 17a If I have time, I'll see what I can come up with.
  20. okay so these are dynamic blocks with attributes, thats why i use numpol to change attribute values acording to polyline i drew over them. Now I want to use something like copyblockstocurve (wich works also with polylines) to align my blocks to new straight line in the same order numpol did the numering. So that I could use them to draw a scheme. Example.dwg
  21. That's not a drawing, just images. I don't see a curve. Is the text part of the block? Really need the drawing.
  22. Can you post a before and after drawing?
  23. Tsuky

    Break Polyline at different depth

    Yet another... (defun c:break_lw ( / js i ent dxf_obj dxf_43 dxf_38 dxf_39 dxf_10 dxf_40 dxf_41 dxf_42 dxf_39 dxf_210 n) (initget "All Select") (if (eq (getkword "\nLWPolylines to break at each vertex? [All/Select] <Select>: ") "All") (setq js (ssget "_X" (list (cons 0 "LWPOLYLINE") (cons 67 (if (eq (getvar "CVPORT") 2) 0 1)) (cons 410 (if (eq (getvar "CVPORT") 2) "Model" (getvar "CTAB"))) ) ) i -1 ) (setq js (ssget (list (cons 0 "LWPOLYLINE") (cons 67 (if (eq (getvar "CVPORT") 2) 0 1)) (cons 410 (if (eq (getvar "CVPORT") 2) "Model" (getvar "CTAB"))) ) ) i -1 ) ) (cond (js (repeat (sslength js) (setq dxf_obj (entget (setq ent (ssname js (setq i (1+ i)))))) (if (cdr (assoc 43 dxf_obj)) (setq dxf_43 (cdr (assoc 43 dxf_obj))) (setq dxf_43 0.0) ) (if (cdr (assoc 38 dxf_obj)) (setq dxf_38 (cdr (assoc 38 dxf_obj))) (setq dxf_38 0.0) ) (if (cdr (assoc 39 dxf_obj)) (setq dxf_39 (cdr (assoc 39 dxf_obj))) (setq dxf_39 0.0) ) (setq dxf_10 (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) dxf_obj)) dxf_40 (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 40)) dxf_obj)) dxf_41 (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 41)) dxf_obj)) dxf_42 (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 42)) dxf_obj)) dxf_210 (cdr (assoc 210 dxf_obj)) ) (if (not (zerop (boole 1 (cdr (assoc 70 dxf_obj)) 1))) (setq dxf_10 (append dxf_10 (list (car dxf_10))) dxf_40 (append dxf_40 (list (car dxf_40))) dxf_41 (append dxf_41 (list (car dxf_41))) dxf_42 (append dxf_42 (list (car dxf_42))) n (cdr (assoc 90 dxf_obj)) ) (setq n (1- (cdr (assoc 90 dxf_obj)))) ) (repeat n (entmake (list (cons 0 "LWPOLYLINE") (cons 100 "AcDbEntity") (assoc 67 dxf_obj) (assoc 410 dxf_obj) (assoc 8 dxf_obj) (if (assoc 62 dxf_obj) (assoc 62 dxf_obj) (cons 62 256)) (if (assoc 6 dxf_obj) (assoc 6 dxf_obj) (cons 6 "BYLAYER")) (if (assoc 370 dxf_obj) (assoc 370 dxf_obj) (cons 370 -1)) (cons 100 "AcDbPolyline") (cons 90 2) (cons 70 (boole 1 (cdr (assoc 70 dxf_obj)) 128)) (cons 38 dxf_38) (cons 39 dxf_39) (cons 10 (car dxf_10)) (cons 40 (car dxf_40)) (cons 41 (car dxf_41)) (cons 42 (car dxf_42)) (cons 10 (cadr dxf_10)) (cons 40 (cadr dxf_40)) (cons 41 (cadr dxf_41)) (cons 42 (cadr dxf_42)) (assoc 210 dxf_obj) ) ) (setq dxf_10 (cdr dxf_10) dxf_40 (cdr dxf_40) dxf_41 (cdr dxf_41) dxf_42 (cdr dxf_42)) ) (entdel ent) ) (print (sslength js)) (princ " LWpolyline(s) breaked at its vertexs.") ) ) (prin1) )
  24. oddssatisfy

    Autocad 2010 Fuzz distance ?

    The error means your mesh likely has self-intersections or is not watertight. Fuzz distance won’t fix this. You need to clean up the mesh, close any gaps, and remove overlapping geometry before converting it to a solid. Use a mesh repair tool to fix these issues.
  25. Hi all, I was wondering if someone could help me with a lisp modyfication. I need to modify CopyBlockStoCurve lisp so I don't need to select each block individually co copy it to the curve. I thought why not copy a function from numpol, which numbers blocks according to a polyline. So I need the new CopyBlockStoCurve to arrange blocks on a curve, but in accordance with how the blocks are positioned on another polyline basiclly. Can anyone help? numpol.lspCopyBlocksToCurve.lsp
  26. Emmanuel Delay

    Break Polyline at different depth

    Exploding polylines makes lines. Lines have no width. The question is to "explode", but keep all edges as polyline with the original width
  27. marko_ribar

    Break Polyline at different depth

    I might be wrong, but can this be achieved just by using EXPLODE command? [EDIT : I see it now... EXPLODE command converts segments into LINE and ARC entities, so widths are lost...]
  1. Load more activity
×
×
  • Create New...