Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/07/2023 in all areas

  1. Please test it for lines notch-lines.LSP
    2 points
  2. Works for lines I think. -EDITED FROM HERE- This appears to work for Polylines - I haven't tested it fully and no error catching such as polyline segments shorter than the chamfer distance, or a full range of line angles. Could be made to work more like a regular chamfer, and perhaps could be called notchchamer as a LISP name, test wi;l do for now.... Should be able to be modified later to do lines and polylines (defun c:test ( / chdist coords1 coords2 pline NL1 NL2 NL3 NL3PtA NL3 PtB int ptsa) (defun MakeLine ( con10 con11 / ) (entmakex (append (list (cons 0 "LINE") (cons 100 "AcDbEntity") (cons 100 "AcDbLine") (cons 10 con10) (cons 11 con11) )) ) ) ;;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-polyline-segment/td-p/1758253 (defun test ( / elst ename pt param preparam postparam) (setq elst (entsel "\nSelect pline segment: ")) (setq ename (car elst)) (setq pt (cadr elst)) (setq pt (vlax-curve-getClosestPointTo ename pt)) (print (setq param (vlax-curve-getParamAtPoint ename pt)) ) (print (setq preparam (fix param)) ) (print (setq postparam (1+ preparam)) ) (list (vlax-curve-getPointAtParam ename preparam) (vlax-curve-getPointAtParam ename postparam) elst ) ) (defun trimlinetopt ( MyLine TrimPt1 TrimPt2 / MyLineDef MyLineEndA MyLineEndB Pt1Dist Pt2Dist TempPT MyLineA MyLineB) (command "zoom" "Object" MyLine "") (command "zoom" "0.95x") (setq MyLineDef (entget MyLine)) (setq MyLineEndA (cdr (assoc 10 MyLineDef))) (if (= (cdr (assoc 0 MyLineDef)) "LINE") (setq MyLineEndB (cdr (assoc 11 MyLineDef))) (setq MyLineEndB (cdr (assoc 10 (reverse MyLineDef)))) ) ;;sort trimpts according to distance from end A (setq Pt1Dist (vlax-curve-getdistatpoint MyLine (osnap TrimPt1 "nea")) ) (setq Pt2Dist (vlax-curve-getdistatpoint MyLine (osnap TrimPt2 "nea")) ) (if ( > Pt1Dist Pt2Dist) (progn (setq TempPt TrimPt1) (setq TrimPt1 TrimPt2) (setq TrimPt2 TempPt) ) ;end progn ) ;end if (command "breakatpoint" MyLine TrimPt1) (setq MyLineA (entlast)) (command "breakatpoint" MyLineA TrimPt2) (setq MyLineB (entlast)) (entdel MyLineA) (command "zoom" "Previous") (command "zoom" "Previous") MyLineA ) ;; add here something nice like "select lines or [option]" ;; Also add here something nice to remember value from last time (setq chdist (getreal "Enter Chamfer Distance: ")) (setq coords1 (test)) (setq coords2 (test)) (setq pline (car (last coords1))) (setq NL1 (makeline (car coords1) (cadr coords1)) ); templine 1 (setq NL2 (makeline (car coords2) (cadr coords2)) ); templine 2 ; (setq chdist 25) (command "chamfer" NL1 "Distance" chdist chdist NL2) (setq NL3 (entlast)) (setq NL3PtA (cdr (assoc 10 (entget NL3))) ) (setq NL3PtB (cdr (assoc 11 (entget NL3))) ) (command "move" NL1 "" NL3PtA NL3PtB ) (command "move" NL2 "" NL3PtB NL3PtA ) (setq int (vLa-intersectwith (vLax-ename->vLa-Object NL1) (vLax-ename->vLa-Object NL2) acextendnone) ) (setq ptsa (vLax-safearray->List (vLax-variant-vaLue int))) (entdel NL1) (entdel NL2) (setq NL1 (makeline ptsa NL3PtA) ); templine 3 (setq NL2 (makeline ptsa NL3PtB) ); templine 4 (entdel NL3) (trimlinetopt pline NL3PtA NL3PtB) (command "join" pline (entlast) NL1 NL2 "") )
    1 point
  3. Wrong more than right does have it's consequences... Banned on StackOverflow
    1 point
  4. You could also -INSERT it into a blank drawing applying the scale either in the -INSERT command or by picking the block and modifying the scale in Properties. If this is something you'll be doing a lot get familiar with the INSUNITS, INSUNITSDEFSOURCE and INSUNITSDEFTARGET System Variables. There's at least three ways to do anything in AutoCAD.
    1 point
  5. Select what you want to scale https://www.youtube.com/watch?v=ZP4ciCeS4R8
    1 point
  6. Use the Scale Command. Trex dxf_01_SCALED.dwg
    1 point
  7. Change the Layout Regen Options in AutoCAD. Go to Options > System tab > Layout Regen Options and select Cache model tab and all layouts Set the UPDATETHUMBNAIL (System Variable) to 0 (default is 15) to avoid capturing layout thumbnails when switching between layouts. Might be this might not (setvar LAYOUTREGENCTL 2) ;Runs regen 1 time only (setvar UPDATETHUMBNAIL 0) ;updates thumbnail when switching between layouts Also maybe "clean" the drawing by running purge and audit.
    1 point
×
×
  • Create New...