Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/11/2024 in all areas

  1. I got it working with some help. The solution was very simple! (defun c:SetRole (/ ss) (setq MRole ((lambda ( input ) (if (eq "" input) MRole input))(getstring (strcat "\nEnter Model Role: <" (setq MRole (cond ( MRole ) ( "Column" ))) "> or ?: "))) );setq (if(eq MRole "?") (progn (startapp "explorer" (findfile "AST Roles.xlsx")) );progn (progn ;else (setq ss (ssget) nn (sslength ss) i 0 );setq (while (< i nn) (progn (setq ee (cdr (car (entget (ssname ss i))))) (hype_setBeamEntity ee) (hype_getBeamData) (if (= 0 (hype_getError)) (progn (hype_setBeamRole MRole) (hype_modifybeam) );progn (progn (hype_setPlateEntity ee) (hype_getPlateData) (if (= 0 (hype_getError)) (progn (hype_setPlateRole MRole) (hype_modifyplate) );progn );if );progn );if (setq i (1+ i)) ) ;progn ) ;while ) ;progn else ) ;if (princ) )
    1 point
  2. Just basic trouble shooting - CAD is off for the evening here - you might want to localise the variables that you can. If a variable that you are using is only used in this LISP copy its name in the defun line something like: defun C:FLATCALC ( / COVERSTYLE MWIDTH MPROJ ..... after the / for any variables used only here. It might be that the LISP is picking up something left over from another LISP. Second thing to look for do you refer to a variable earlier in the LISP before you asign a value to it? Without local variables then when you first run the LISP it might set a value which is remembered for the subsequent times you run it: For example: (defun c:example ( / ) (setq A_Length New_Length) ;; this value depends on another set later in the lisp (setq New_length 5) ;; set the new value (setq Another_Length (* 2 A_Length)) ;; do something with the frst value that is 'nil' the first time the LISP runs )
    1 point
  3. Thanks a lot. It works as I wanted. I see it was very simple, but not for me I used "strcat" incorrectly. Have a nice holiday.
    1 point
  4. @thekiki Try This version: (defun c:Selpline (/ p1 p2 ss) (if (and (setq p1 (getpoint "\nSelect 1st corn of cossing window: ")) (setq p2 (getcorner p1 "\nSelect 2nd point of crossing window: ")) (setq ss (ssget "C" p1 p2 '((0 . "*POLYLINE")))) ) (sssetfirst nil ss) ) ss ) (defun c:Seltext (/ p1 p2 ss) (if (and (setq p1 (getpoint "\nSelect 1st corn of cossing window: ")) (setq p2 (getcorner p1 "\nSelect 2nd point of crossing window: ")) (setq ss (ssget "C" p1 p2 '((0 . "*TEXT")))) ) (sssetfirst nil ss) ) ss ) (defun c:Selblock (/ p1 p2 ss) (if (and (setq p1 (getpoint "\nSelect 1st corn of cossing window: ")) (setq p2 (getcorner p1 "\nSelect 2nd point of crossing window: ")) (setq ss (ssget "C" p1 p2 '((0 . "INSERT")))) ) (sssetfirst nil ss) ) ss )
    1 point
  5. Here is a quick one: (defun c:z2t() (setq l (entget (car (entsel)))) (entmod (subst (cons 1 (rtos (car (reverse (assoc 10 l))))) (assoc 1 l) l)) ) It will overwrite the content of the text with it's Z coord. The program assumes that you select a text and it makes no checks. Enter the correct data if you wish correct output!
    1 point
×
×
  • Create New...