cadmaster1004 Posted July 20, 2022 Posted July 20, 2022 (edited) hello everyone. I found a lesson that automatically changes the name of layout through the attribute block value. However, this lisp works only with the value written in paper space in layout. Is it possible to make the drawing written in model space work in layout? I attached the reference drawing that I want to fill out, and I will upload the link for the lesson. Please reply. Have a nice day. lisp link https://www.cadforum.cz/en/how-to-rename-layouts-by-a-specific-attribute-of-the-title-block-tip11780 reference dwg. Layout.dwg Edited July 20, 2022 by cadmaster1004 Quote
mhupp Posted July 20, 2022 Posted July 20, 2022 (edited) Damn must be getting old! that website is using like what font size 2 had to blow it up 180% just to read it. Its possible just have to change the ssget in the vl-getattributevalue function. to use WP instead of X build coords off the viewport to select things in model space. (setq ss (ssget "_X" (list (cons 0 "INSERT")(cons 2 _LOAblkname)(cons 410 lname)))) changes to (setq ss (ssget "_WP" coords (list (cons 0 "INSERT")(cons 2 _LOAblkname)))) Example here cen = center of view port c40 = width of view port c41 = height of view port Edited July 20, 2022 by mhupp 1 Quote
cadmaster1004 Posted July 20, 2022 Author Posted July 20, 2022 Thank you for your kindly help. Actually, it's not going well, but I'll study it. Quote
BIGAL Posted July 20, 2022 Posted July 20, 2022 (edited) Sounds more like go into mspace pick attribute get Text string then rename layout. Use nentsel on attribute. A quick attempt. (defun c:renlay ( / txt ) (command "mspace") (setq txt (cdr (assoc 1 (entget (car (nentsel "\nPick attribute text")))))) (command "layout" "R" (getvar 'ctab) txt) (princ) ) (c:renlay) Did not bother to work out what is going on with test dwg. Edited July 20, 2022 by BIGAL Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.