Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/08/2025 in all areas

  1. It turns out that the blocks did not need to be given other names. I tried again and the code worked great, thanks a lot... good luck...
    1 point
  2. And.... of course: the blocks must always be "*U3" and "*U4"
    1 point
  3. Hi Try it (defun c:MarkElevOff1 (/ cj cj1 e cotabas cota n #etq etq dmzAnt) (setq dmzAnt (getvar "DIMZIN")) (setvar "DIMZIN" 0) (princ "\nSelect all blocks... ") (if (setq cj (ssget '((0 . "INSERT")))) (progn (while (setq e (ssname cj (setq n (if n (1+ n) 0)))) (if (= (cdr (assoc 2 (entget e))) "*U3") (progn (entmakex (list (cons 0 "TEXT") (cons 10 (list (car (setq cotabas (cdr (assoc 10 (entget e))))) (+ (cadr cotabas) 600))) (cons 40 250) (cons 1 "0.000") (cons 50 0.0) (cons 7 (getvar "TEXTSTYLE")) (cons 8 (getvar "CLAYER")) ) ) ) ) ) (setq n nil) (while (setq e (ssname cj (setq n (if n (1+ n) 0)))) (if (= (cdr (assoc 2 (entget e))) "*U4") (progn (setq cota (cdr (assoc 10 (entget e))) etq (if (minusp (setq #etq (/ (- (cadr cota) (cadr cotabas)) 1000.0))) (rtos #etq 2 3) (strcat "+" (rtos #etq 2 3)) ) ) (entmakex (list (cons 0 "TEXT") (cons 10 (list (car cota) (+ (cadr cota) 600))) (cons 40 250) (cons 1 etq) (cons 50 0.0) (cons 7 (getvar "TEXTSTYLE")) (cons 8 (getvar "CLAYER")) ) ) ) ) ) (setvar "DIMZIN" dmzAnt) ) ) (princ) )
    1 point
  4. This will find points along a line. But note finds points also at start and end of line as they touch another object. There are ways to remove the end points. If dwgs are say horizontally inclined then could sort on X so dont use 1st and last. (defun c:wow ( / ) (setq obj (vlax-ename->vla-object (car (entsel "\nPick line ")))) (setq hand (vlax-get obj 'handle)) (setq pts (list (vlax-curve-getstartPoint obj) (vlax-curve-getendPoint obj)) ) (setq ss (ssget "F" pts (list (cons 0 "*line")))) (setq ptsint '()) (repeat (setq x (sslength ss)) (setq obj2 (vlax-ename->vla-object (ssname ss (setq x (1- x))))) (if (= (vlax-get obj2 'handle) hand) (princ "skip") (progn (setq intpts (vlax-invoke obj 'intersectwith obj2 acextendnone)) (command "point" intpts) (setq ptsint (cons intpts ptsint)) ) ) ) (setq ptsint (reverse ptints)) (princ ptsint) (princ) ) (c:wow) Like others need what is end goal.
    1 point
  5. Making a "pop" menu is easy you can make them using notepad. here is some sample code. You have a header section which names the menu, followed by menu options, you can have sub menus and image menus, also toolbar menu's. If you provide a list of lisp program names and the command name I can attempt to make you a mnu file. eg lispname = MYDOCIRC.lsp command DOCIRC ***MENUGROUP=STDS ***POP20 **CADLIB [->LISP1 A-B] [1/4 POINTS]^C^C(LOAD "1-4 POINTS") [Add 2 Level]^C^C(LOAD "add-to-levels") [Add-pits-drain]^C^C(LOAD"Add-pits-drain") [Allbylayer]^C^C(LOAD "Allbylayer") [Apndtext]^C^C^p(LOAD "apndtext") [Apparent int]^C^C^p(LOAD "apparent int") [Area-label]^C^C^p(LOAD "area-label")
    1 point
  6. (alert "MAAHEE: Insufficient arguments: Please try again....")
    1 point
×
×
  • Create New...