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
)
(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.
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.
@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)))
)
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