Jump to content

Leaderboard

Popular Content

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

  1. I noticed a small mistake in the existLineType function. It only returns true if the last found linetype is the one you are looking for, but if you change it to this it should work as expected: (defun existLinetype (doc LineTypeName / item loaded) (vlax-for item (vla-get-linetypes doc) (if (= (strcase (vla-get-name item)) (strcase LineTypeName)) (setq loaded T) ) ) loaded )
    1 point
  2. (defun WhichDimension () (setq DimStyleOverrider (cond ((= OldFactor 5) "Change5") ((= OldFactor 10) "Change10") (defun example () (WhichDimension) (while (< i (sslength selectie)) (setq ent (ssname selectie i)) ; (setq data (entget ent)) (if (= (cdr (assoc 0 data)) "DIMENSION") ; (progn (setq newData (subst (cons 3 DimStyleOverrider) (assoc 3 data) data)) ; Changes DIMSTYLE (entmod newData) (entupd ent) ) ) (setq i (+ i 1)) ) ) I hope this is clear enough. Had to change some names. This code works for me but after changing the DIMSTYLE it doesn't update everything that should. I created another post about that because I haven't been able to find a solution in days.
    1 point
  3. See this page. You can open your list of aliases on the Manage ribbon or with the ai_editcustfile command, which allows you to edit your acad.pgp file. Or you can open the file directly. I thought there was an option on the customization menu to edit the aliases, but apparently not. Let us know if you need more help.
    1 point
  4. (rtos sum 2 0) will return an integer answer (rtos sum 2 2) will return a real answer with 2 decimal places So second number controls decimal places.
    1 point
  5. Please find at the end of the program a call to RTOS function. Replace (rtos sum) with (rtos sum 2)
    1 point
  6. @Nickvnlr Here I am with the Lisp. It also can handle that case you mentioned, when the real number starts with a dot. Change the text height to suit your needs -see the 2nd program line. (defun c:GPM( / ss textHeight i b1 b1l sum) (setq textHeight 1) (setq ss (ssget "_:L" '((0 . "INSERT")(2 . "PLANT")(66 . 1))) sum 0) (repeat (setq i (sslength ss)) (setq b1 (ssname ss (setq i (1- i)))) (while (and (/= (cdr (assoc 0 (setq b1l (entget b1)))) "SEQEND") (/= (cdr (assoc 2 b1l)) "PLANTGPM")) (setq b1 (entnext b1)) ) (setq sum (+ sum (atof (cdr (assoc 1 b1l))))) ) (entmake (list '(0 . "TEXT") (cons 1 (strcat "Total GPM = " (rtos sum))) (cons 10 (getpoint "Pick text position")) (cons 40 textHeight))) )
    1 point
  7. Hello, I am interested in a LISP able to make overlapping sheets as layouts following a road alignment and overlap a fraction. Each sheet will have its own UCS or view orientation. You can see it from these videos: anyone knows one? Best regards, Daniel
    1 point
  8. Two or three leader points with MText annotation prompt: (defun c:Test (/ p1 p2 p3) (if (and (setq p1 (getpoint "\nSpecify leader starting point: ")) (setq p2 (getpoint p1 "\nSpecify next point: ")) ) (progn (grdraw p1 p2 7 1) (setq p3 (getpoint p2 "\nSpecify next point <Annotation>: ")) (redraw) (initdia) (if p3 (command "_.leader" "_non" p1 "_non" p2 "_non" p3 "_A" "" "_M" "") (command "_.leader" "_non" p1 "_non" p2 "_A" "" "_M" "") ) ) ) (princ) )
    1 point
×
×
  • Create New...