Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/04/2019 in all areas

  1. My original Double Offset application was designed to precisely emulate the prompts & options offered by the standard AutoCAD OFFSET command, however with the offset being performed to both sides rather than a selected side. Here's a quickly written alternative to permit multiple object selection: (defun c:mdoff ( / d i o s ) (initget 6) (if (and (setq d (getdist "\nSpecify offset distance: ")) (setq s (ssget "_:L" '( (0 . "ARC,CIRCLE,ELLIPSE,*LINE") (-4 . "<NOT") (-4 . "<AND") (0 . "POLYLINE") (-4 . "&") (70 . 80) (-4 . "AND>") (-4 . "NOT>") ) ) ) ) (repeat (setq i (sslength s)) (setq i (1- i) o (vlax-ename->vla-object (ssname s i)) ) (foreach x (list d (- d)) (vl-catch-all-apply 'vlax-invoke (list o 'offset x)) ) ) ) (princ) ) (vl-load-com) (princ)
    1 point
  2. Too bad this wasn't available 25 years ago! I could have used it. Nice job.
    1 point
  3. @BIGAL Nice and easy to use! I think all you need to do to fix the order of selection restriction is to replace the if statement: (if (<= 0.0 ht) (setq ht (+ txt1 ht)) (setq ht (- txt1 ht)) ) with (setq ht (- txt1 ht)) and you can pick the two points in any order without regard to which is lower.
    1 point
  4. I thought I posted this earlier today, pick lowest level 1st needs a swap routines for random pick hi/lo. (defun c:intlev ( / num txt1 txt2 c1 c2 dist1 dist2 diff ht ) (setvar "textstyle" "Punto Nivel") (setq num (getint "\nPick how many each time eg 1 2 ")) (while (setq txt1 (atof (cdr (assoc 1 (entget (car (entsel "\nPick text 1"))))))) (setq c1 (cdr (assoc 10 (entget (car (entsel "\nPick circle 1")))))) (setq txt2 (atof (cdr (assoc 1 (entget (car (entsel "\nPick text 2"))))))) (setq c2 (cdr (assoc 10 (entget (car (entsel "\nPick circle 2")))))) (setq diff (- txt1 txt2)) (setq dist1 (distance c1 c2)) (repeat num (setvar 'osmode 4) (setq c3 (cdr (assoc 10 (entget (car (entsel "\nPick circle")))))) (setq dist2 (distance c1 c3)) (setq ht (* (/ dist2 dist1) diff)) (if (<= 0.0 ht) (setq ht (+ txt1 ht)) (setq ht (- txt1 ht)) ) (setvar 'osmode 0) (command "text" (mapcar '+ c3 '(0.5 0.0 0.)) 0.0 (rtos ht 2 3) ) ) (setvar 'osmode 512) ) (princ) )
    1 point
  5. You can use the following simple vlisp program with your 2D drawing. You are prompted to specify two points and their elevation then a thrid for which you want the elevation. (defun c:elbetween (/) ; determine the elevation of a point given two points ; and their elevations. (setq p1 (getpoint "\nSpecify elevation point #1.")) (setq el1 (getreal "\nEnter the elevation at point #1.")) (setq p2 (getpoint "\nSpecify elevation point #2.")) (setq el2 (getreal "\nEnter the elevation at point #2.")) (setq p (getpoint "\nSpecify point for interpolation.")) (setq d (distance p1 p2)) (setq s (distance p1 p)) (setq el (+ el1 (* (/ s d) (- el2 el1)))) (setq el (rtos el)) (princ "\nInterpolated point elevation = ") (princ el) (princ) )
    1 point
  6. Like attached: example.dwg Here is code to place that text although it's not how I'd approach it. (setq p1 (getpoint "\nPunto Inicial:")) (setq p2 (polar p1 (* 1.5 pi) 0.5)) (entmakex (list '(0 . "line") (cons 10 p1) (cons 11 p2) '(62 . 2))) (entmakex (list '(0 . "TEXT") '(100 . "AcDbEntity") '(8 . "YourTextLayer") '(100 . "AcDbText") (cons 10 (mapcar '+ p1 '(0.17 0.29 0.))) '(40 . 0.1) '(1 . "%%UVIGA V-SS01 (.25X.50)") '(50 . 0.) '(41 . 1.) '(51 . 0.) '(11 0. 0. 0.) ) )
    1 point
×
×
  • Create New...