Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/07/2024 in all areas

  1. Maybe something like this as a starting point.Multi GETVALS.lsp save Multi getvals in a support path as its auto loaded. ; 4 holes in rectang ; By AlanH Feb 2022 ; Modified for row and columns July 2024 (defun c:recholes ( / oldsnap obj ss len ht ans voff hoff rad rows cols ) (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) (if (not AH:getvalsm)(load "Multi Getvals.lsp")) (setq ans (AH:getvalsm (list "Enter values" "length" 5 4 "20" "height" 5 4 "10" "vertical offset" 5 4 "1.5" "Horizontal offset" 5 4 "2.5" "Radius" 5 4 "0.25" "Hor columns" 5 4 "4" "Ver rows" 5 4 "3" "Angle " 5 4 "0.0"))) (setq len (atof (nth 0 ans)) ht (atof (nth 1 ans)) voff (atof (nth 2 ans)) hoff (atof (nth 3 ans)) rad (atof (nth 4 ans)) cols (atoi (nth 5 ans)) rows (atoi (nth 6 ans)) ang (atof (nth 7 ans)) ) (setq pt (getpoint "\nPick lower left point")) (command "Rectang" pt (mapcar '+ pt (list len ht 0.0))) (setq rent (entlast)) (setq ss (ssadd)) (setq pt1 (mapcar '+ pt (list hoff voff 0.0))) (command "circle" pt1 rad) (setq ss (ssadd (entlast) ss)) (setq pt3 pt1) (setq d1 (/ (- len (* 2.0 hoff))(- cols 1))) (repeat (- cols 1) (setq pt2 (mapcar '+ pt3 (list d1 0.0 0.0))) (command "circle" pt2 rad) (setq pt3 pt2) (setq ss (ssadd (entlast) ss)) ) (setq d2 (/ (- ht (* 2.0 voff))(- rows 1))) (setq x 1.0) (repeat (- rows 1) (setq pt2 (mapcar '+ pt1 (list 0.0 (* x d2) 0.0))) (command "copy" ss "" pt1 pt2) (setq x (1+ x)) ) ; top dims (setq pt1 (mapcar '+ pt (list 0.0 ht 0.0))) (setq pt2 (mapcar '+ pt (list len ht 0.0))) (setq pt3 (mapcar '+ pt1 (list 0.0 5.0 0.0))) (command "dim" "Hor" pt1 pt2 pt3 "" "exit") (setq pt2 (mapcar '+ pt1 (list hoff (- voff) 0.0))) (setq pt3 (mapcar '+ pt1 (list 0.0 2.5 0.0))) (command "dim" "Hor" pt1 pt2 pt3 "" "exit") (repeat (- cols 1) (setq pt1 pt2) (setq pt2 (mapcar '+ pt1 (list d1 0.0 0.0))) (command "dim" "Hor" pt1 pt2 pt3 "" "exit") ) (setq pt1 pt2) (setq pt2 (mapcar '+ pt1 (list hoff 0.0 0.0))) (command "dim" "Hor" pt1 pt2 pt3 "" "exit") ;left dims (setq pt2 (mapcar '+ pt (list 0.0 ht 0.0))) (setq pt3 (mapcar '+ pt (list (- 5) 0.0 0.0))) (command "dim" "Ver" pt pt2 pt3 "" "exit") (setq pt2 (mapcar '+ pt (list hoff voff 0.0))) (setq pt3 (mapcar '+ pt (list (- 2.5) 0.0 0.0))) (command "dim" "Ver" pt pt2 pt3 "" "exit") (repeat (- rows 1) (setq pt1 pt2) (setq pt2 (mapcar '+ pt1 (list 0.0 d2 0.0))) (command "dim" "Ver" pt1 pt2 pt3 "" "exit") ) (setq pt1 pt2) (setq pt2 (mapcar '+ pt1 (list 0.0 voff 0.0))) (command "dim" "Ver" pt1 pt2 pt3 "" "exit") (if (= ang 0.0) (princ) (progn (setq ss (ssget "CP" (list pt (mapcar '+ pt (list len ht 0.0))))) (setvar 'aunits 1) (command "rotate" ss "" pt ang) ) ) (setvar 'osmode oldsnap) (princ) ) (c:recholes)
    1 point
  2. How are your abilities with LISP or programming? If we give you hint of what to do would that be enough for you to make a start? For the circle numbers, what is the logic behind their numbering in each rectangle? Rectangles - I assume are closed polylines, but will the drawing have any other 4 sided closed polylines that are not to be assessed? Perhaps upload a sample drawing if you can? How often will you be doing this? (daily, weekly, monthly, once a year) If it was me I'd go back a few steps and have the user to select the circles in the order they want them numbered and put in the text from there - much easier to program
    1 point
  3. Create solid objects that can be subtracted from the full solid of the terrain. Start by creating closed polylines for the base of the main building and the garage and extrdue them upwards such that they penetrate the terrain surface. Subtract these solids from the terrain solid. The next goal is to create a solid that defines the void of the tunnel connecting the buildng and the garage. Start by creating two 3dpolys (shown in yellow) and loft a surface between them. Do the same for the two green 3dpolys. This wil yield surfaces for the ceiling and floor of the tunnel. Create a single closed 3dpoly for the floor of the tunnel (yellow lines but conected at their ends) and extrude it upwards. Use surfsculpt to create a solid for the tunnel from these surfaces that define a watertight volume.
    1 point
  4. Yes, but I would recommend a separate routine for it: (defun c:TextCol (/ c cl e i l o ss x) (vl-load-com) (vla-startundomark (vla-get-activedocument (vlax-get-acad-object))) (if (and (setq ss (ssget '((0 . "*TEXT")))) (setq cl 5 cl (acad_colordlg cl T)) ) (repeat (setq i (sslength ss)) (setq e (ssname ss (setq i (1- i))) l (entget e) o (vlax-ename->vla-object e) x (vla-get-textstring o) c (vla-get-truecolor o) ) (vla-put-colorindex c cl) (vla-put-truecolor o c) (if (= (cdr (assoc 0 l)) "MTEXT") (progn (while (wcmatch x "*\\C*;*") (setq n 0) (repeat 257 (setq x (vl-string-subst "" (strcat "\\C" (itoa n) ";") x) n (1+ n) ) ) ) (vla-put-textstring o x) ) ) ) ) (vla-endundomark (vla-get-activedocument (vlax-get-acad-object))) (princ) )
    1 point
×
×
  • Create New...