Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/06/2024 in all areas

  1. I too deal with a lot of files each day where the radii are broken into many small straight lines. I think one of my clients creates the Rads in their Cad environment using splines, and then converts them into polylines which makes them change to these small line segments. Please keep up the great work Steven P, this appears to have been progressing nicely, and I can't wit to see the final result
    1 point
  2. I like this thread.. Good question, I too have had to do this and great answers as usual by the talent on this website, my solution was a lot more long winded than tsukys elegant work.
    1 point
  3. A start with this? (defun def_bulg_pl (ls lb / l_rad) (setq ls (append ls (list (car ls)))) (while (cadr ls) (if (zerop (car lb)) (setq l_rad (cons (car lb) l_rad)) (setq l_rad (cons (/ (distance (car ls) (cadr ls)) (sin (* 2.0 (atan (abs (car lb))))) 2.0) l_rad)) ) (setq ls (cdr ls) lb (cdr lb)) ) l_rad ) (defun c:test ( / sspl typent lst l_bulg e_next dxf_next rad) (while (null (setq sspl (ssget "_+.:E:S" '((0 . "*POLYLINE") (-4 . "<AND") (-4 . "&") (70 . 1) (-4 . "<NOT") (-4 . "&") (70 . 124) (-4 . "NOT>") (-4 . "AND>"))))) (princ "\nInvalid object") ) (setq typent (cdr (assoc 0 (setq dxf_ent (entget (setq ent (ssname sspl 0))))))) (cond ((eq typent "LWPOLYLINE") (setq lst (mapcar '(lambda (x) (trans x ent 1)) (mapcar 'cdr (vl-remove-if '(lambda (x) (/= (car x) 10)) dxf_ent))) l_bulg (mapcar 'cdr (vl-remove-if '(lambda (x) (/= (car x) 42)) dxf_ent)) lst (def_bulg_pl lst l_bulg) ) ) ((eq typent "POLYLINE") (setq e_next (entnext ent)) (while (= "VERTEX" (cdr (assoc 0 (setq dxf_next (entget e_next))))) (if (zerop (boole 1 223 (cdr (assoc 70 dxf_next)))) (setq lst (cons (trans (cdr (assoc 10 dxf_next)) ent 1) lst) l_bulg (cons (cdr (assoc 42 dxf_next)) l_bulg) ) ) (setq e_next (entnext e_next)) ) (setq lst (reverse lst) l_bulg (reverse l_bulg) lst (def_bulg_pl lst l_bulg) ) ) ) (if (setq rad (car (vl-remove 0.0 (vl-sort lst '<)))) (princ (strcat "\nMinor radius found " (rtos rad 2))) (princ "\nNo radius found in this polyline") ) (prin1) )
    1 point
  4. all tho it doesn't say it here i think the bulge is stored in group 42 You can use that to calculate the radius. https://www.lee-mac.com/bulgeconversion.html#addition output polyline dxf info https://www.cadtutor.net/forum/topic/74613-dxf-fields/?do=findComment&comment=590936
    1 point
  5. It may have something to do with "ai" function by ElpanovEvgeniy? I don't know what that might be. Perhaps we should try and change that function to LeeMac's Increment function. I tested this in AutoCAD and it works. (defun c:TabSort (/ cnt doc lay) (vl-load-com) (setq cnt 1 doc (vla-get-activedocument (vlax-get-acad-object)) ) (foreach lay (acad_strlsort (vl-remove "Model" (layoutlist))) (vla-put-taborder (vla-item (vla-get-layouts doc) lay) cnt) (setq cnt (1+ cnt)) ) (princ) ) (defun c:cLO (/ cnt ctb prf n) (setvar "tilemode" 0) (if (and (= 0 (getvar 'tilemode)) (setq str (getstring "\nEnter Starting Layout Letter: ")) (setq ctb (substr (getvar 'ctab) 1 (- (strlen (getvar 'ctab)) 1))) (setq prf (getstring (strcat "\nLayout Prefix <" ctb ">: ")) prf (if (/= prf "") prf ctb) ) (setq n (getint "\nHow many copies of this tab: ")) ) (progn (setq cnt 1) (initget "Yes No") (if (= (getkword "\nRename Current Layout? [Yes/No] <No>: ") "Yes") (progn (command "._Layout" "_Rename" (getvar 'ctab) (strcat prf str)) (setq cnt (1+ cnt) n (1- n)) ) ) (repeat n (command "._layout" "_copy" (getvar 'ctab) (strcat prf (if (> cnt 1)(setq str (numinc:incrementalpha str 1)) str)) ) (setq cnt (1+ cnt)) ) ) ) (c:TabSort) ) ;; Extracted from Lee Mac's Increment Numbering Suite: ;; https://www.lee-mac.com/numinc.html (defun numinc:incrementalpha ( str inc / _incrementalpha a ) (defun _incrementalpha ( a b / c d e ) (cond ( (cond ( (< 47 (setq c (car a)) 58) (setq d 48 e 10 ) ) ( (< 64 c 91) (setq d 65 e 26 ) ) ( (< 96 c 123) (setq d 97 e 26 ) ) ) (setq c (+ (- c d) b) b (/ c e) ) (cons (+ d (rem c e)) (if (zerop b) (cdr a) (if (cdr a) (_incrementalpha (cdr a) b) (_incrementalpha (list d) (if (= 10 e) b (1- b))) ) ) ) ) ( (cons c (if (cdr a) (_incrementalpha (cdr a) b) (_incrementalpha (list 65) (1- b)) ) ) ) ) ) (vl-list->string (reverse (if (setq a (reverse (vl-string->list str))) (_incrementalpha a inc) (_incrementalpha '(65) (1- inc)) ) ) ) )
    1 point
  6. Interesting and thanks, this is one I am going to keep for myself so worth me taking the time over it, I should have time this week to look at the very small lines and small gaps. Having a quick look, some of the circles are not -quite- identical (overlaid one on top of another, overkill, and there are some lines left from both) which might explain that.
    1 point
  7. This will select/highlight any text that starts with "Area" or ends with "m2". (defun C:seltxt (/ SS) (setq SS (ssget "_X" (list '(0 . "*TEXT") '(1 . "Area*,*m2") (cons 410 (getvar 'ctab))))) (sssetfirst nil ss) (princ) )
    1 point
  8. " If you want to quickly open the disk folder containing your current AutoCAD drawing, right-click on its tab and choose "Open File Location" from the context menu. The folder will open in Windows Explorer. " (https://www.cadforum.cz/cadforum_en/how-to-open-the-folder-with-your-current-dwg-drawing-tip9639)
    1 point
×
×
  • Create New...