Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello people.
Is it possible to rename an annotative scale using lisp?.
Thank you.
Solved! Go to Solution.
Hello people.
Is it possible to rename an annotative scale using lisp?.
Thank you.
Solved! Go to Solution.
check this function
enjoy
moshe
; return elist of the renamed annotation scale or nil if it fails
(defun rename_annoscale (oldsym newsym / isexist table)
(defun isexist ()
(vl-some
(function
(lambda (item)
(and
(= (car item) 350)
(eq (strcase (cdr (assoc '300 (entget (cdr item))))) (strcase newsym))
)
); lambda
); function
table
); vl-some
); isexist
(cond
((not (setq table (entget (cdadr (member '(3 . "ACAD_SCALELIST") (entget (namedobjdict))))))))
((isexist)
(prompt (strcat "\nAnnotation scale " newsym " is already exist."))
); case
((vl-some
(function
(lambda (item / elist)
(if (and
(= (car item) 350)
(setq elist (entget (cdr item)))
(eq (strcase (cdr (assoc '300 elist))) (strcase oldsym))
)
(entmod (subst (cons '300 newsym) (assoc '300 elist) elist)) ; rename
); if
); lambda
); function
table
); vl-some
); case
); cond
); rename_annoscale
Perfect, thank you very much.
You appear to have a good grasp on annotativity (?).
Got any clues on how to use entmake to create an annotative object (if it can be)?
Let's say we're confining our goal to use the current scale (1" = 10', 1" = 20', etc.)
John F. Uhden
@john.uhden wrote:You appear to have a good grasp on annotativity (?).
Got any clues on how to use entmake to create an annotative object (if it can be)?
Let's say we're confining our goal to use the current scale (1" = 10', 1" = 20', etc.)
form where did you take that?! i do not give my self that creadit 😀 but anyhow thank you very much.
to the matter...i doubt if you can do that with classic autolisp maybe with (vla-copy) ??? but as far as we know (vla-copy) does not do deep cloning. if (vla-copy) tries to add the new object to database then it may fail because of dublicate names??? do not know 🤣
Moshe