Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/09/2022 in all areas

  1. Welcome to CadTutor Mory. In OPTIONS on the DISPLAY tab look at hover tips. Or TOOL TIPS, you can set how you want it, delay times and such.
    1 point
  2. They are contour lines correct ? So do you want say contour labels done by dragging a line across would make more sense the same way CIV3D does it. This will give a neat pattern, if you do at 150 spacing the labels will be all over the place. If you use (ssget "F" (list pt1 pt2)) you can get a selection of the crossing 3dpolys using getcoordinates you can look a the 3rd item in the list that is the Z value. Ok so before say I or others do something is that ok draw lines for contour points.
    1 point
  3. And this version put the text in the middle of the polyline and makes the width the same as the counter. (defun c:numberpolylines ( / txthght sspolylines acount ssent txtpt ) (vl-load-com) ;;https://autocadtips1.com/2011/10/21/autolisp-mid-point-of-entire-polyline/ (defun MidPoly ( ename / entl en oname param hLen MidPt ) (setq entl (entget ename) en (cdr (assoc 0 entl)) ) ;end setq (setq oname (vlax-ename->vla-object ename) param (vlax-curve-getEndParam oname) hlen (* (vlax-curve-getDistAtParam oname param) 0.5) MidPt (vlax-curve-getPointAtDist oname hLen) ) ;end setq (vlax-release-object oname) MidPt ) ;end defun (defun createtext ( MyText TextPoint textheight / ) ;; a sub routine to create text. (entmake (list '(0 . "TEXT") '(100 . "AcDbEntity") '(8 . "0") '(100 . "AcDbText") (cons 10 TextPoint) (cons 40 textheight) (cons 1 MyText) '(50 . 0.0) '(41 . 1.0) '(51 . 0.0) ;; (cons 7 font) '(71 . 0) '(72 . 0) '(11 0.0 0.0 0.0) '(210 0.0 0.0 1.0) '(100 . "AcDbText") '(73 . 0) ));end list, entmake ) ;;end sub routine (setq txthght 2.5) ;; text height - can calculate this later if needed to make it relative to polyline lengths and so on (setq sspolylines (ssget '((0 . "LWPOLYLINE")) )) ;get selection set, filter it to only LWPolyline types (setq acount 0) ;;just a counter (while (< acount (sslength sspolylines)) ;; do a loop for the length of the selection set (sslength) (setq ssent (ssname sspolylines acount )) ;;get the nth entity details in the selection set (setq TxtPt (MidPoly ssent)) ;;calls MidPoly routine and gets the point result as TxtPt (setq txtpt (mapcar '+ (list 0 (/ (+ acount txthght) 2) 0) txtpt )) ;; offset txtpt for text position by x:0, y: half text height + line width, z:0 (setq acount (+ acount 1)) ;;increase count by 1. Increased here to make the displayed text start at 1 (command "pedit" ssent "w" acount "") ;;adjusts line width to the count (createtext (rtos acount) txtpt txthght) ;; run subroutine to create text ) (princ) ;; exit silently ) So over to you now, how you want to use this or amend to suit what you want
    1 point
  4. (defun AT:NumFix (s n) ;; Fix number string with leading zeros ;; s - Number string to fix ;; n - Number of characters for final string ;; Alan J. Thompson, 10.29.09 (if (< (strlen s) n) (AT:NumFix (strcat "0" s) n) s ) ) (AT:NumFix "3" 4) -> "0003"
    1 point
×
×
  • Create New...