Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/24/2025 in Posts

  1. Another ; make table example ; By Alan H 2018 ; updated for post https://www.cadtutor.net/forum/topic/98664-tables/ Aug 2025 (defun c:maketableXY (/ colwidth numcolumns numrows objtable rowheight sp vgad vgao vgms) (vl-load-com) (setvar "osmode" 0) (setq bm (ssget '((0 . "LINE")))) (if bm (progn (setq num (sslength bm)) (setq i 0) (setq point_list '()) (repeat num (setq obj (ssname bm i)) ; Get entity name (setq db (entget obj)) ; Get entity data (setq p1 (cdr (assoc 10 db))) ; Start point (setq p2 (cdr (assoc 11 db))) ; End point (setq midpt (mapcar '/ (mapcar '+ p1 p2) '(2 2 2))) (setq point_list (cons (list p1 p2 midpt) point_list)) (setq i (1+ i)) ) ) ) (setq sp (vlax-3d-point (getpoint "pick a point for table"))) (Setq vgms (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)))) (setq numrows (+ (length point_list))) (setq numcolumns 4) (setq rowheight 9) (setq colwidth 70) (setq objtable (vla-addtable vgms sp numrows numcolumns rowheight colwidth)) (vla-settext objtable 0 0 "Line details") (vla-settext objtable 1 0 "Sr No.") (vla-settext objtable 1 1 "Start point") (vla-settext objtable 1 2 "End point") (vla-settext objtable 1 3 "Mid point") (vla-setcolumnwidth objtable 0 21) (vla-setalignment objTable acTitleRow acMiddleCenter) (vla-setalignment objTable acHeaderRow acMiddleCenter) (vla-setalignment objTable acDataRow acMiddleCenter) (vla-setrowheight objTable acDataRow 9.0) (setq row 2 x 1) (foreach val point_list (vla-settext objtable row 0 (rtos x 2 0)) (setq val1 (strcat (rtos (car (nth 0 val)) 2 3) "," (rtos (cadr (nth 0 val)) 2 3))) (vla-settext objtable row 1 val1) (setq val2 (strcat (rtos (car (nth 1 val)) 2 3) "," (rtos (cadr (nth 1 val)) 2 3))) (vla-settext objtable row 2 val2) (setq val3 (strcat (rtos (car (nth 2 val)) 2 3) "," (rtos (cadr (nth 2 val)) 2 3))) (vla-settext objtable row 3 val3) (setq row (1+ row) x (1+ x)) ) (princ) )
    1 point
  2. A viewport has a custom scale you can see it when you click on it and using Property. So rescale the viewport then change the custom scale value to suit. Play with some standard scales and look at what Custom scale value is, metric makes it easy. You may also want to pick a point in model space (setq pt (getpoint "\nPick ")) once you have this you can use Zoom C pt scale, this will re center your view, then set your custom scale. A ps Zoom valueXP eg Zoom 0.25XP, sets the scale also. Lastly it's always a good idea to lock a viewport so you don't accidently zoom inside it.
    1 point
  3. How about this. Draw a polyline around the border of the viewport. Use the CHSPACE command to move it from paper space (the key viewport) to model space. You now have a visual guide for aligning the viewport with the area you want to show. When you're done, erase the guide.
    1 point
×
×
  • Create New...