Attribute Edit

Attribute Edit

john.uhden
Mentor Mentor
1,580 Views
18 Replies
Message 1 of 19

Attribute Edit

john.uhden
Mentor
Mentor

I got sick of dealing with the attribute editor.  You can't just hit Enter to complete the edit. You have to hit the OK button (or Tab + Enter).

So, here's a little way to edit an attribute just like editing text (not mtext)...

(defun c:AE ( / e ent old new dummy)
  (defun *error* (err)
    (and dummy (entget dummy)(entdel dummy))
    (princ)
  )
  (while (setq e (car (nentsel "\nSelect attribute to modify: ")))
    (setq ent (entget e))
    (setq old (assoc 1 ent))
    (setq dummy
      (entmakex (list '(0 . "TEXT")'(10 0.0 0.0 0.0)'(11 0.0 0.0 0.0)
      '(7 . "STANDARD")'(40 . 1.0) old '(60 . 1)) ;; invisible
      )
    )
    (command "_.ddedit" dummy "")
    (setq new (assoc 1 (entget dummy)))
    (entmod (subst new old ent))
    (entupd e)
    (entdel dummy)
  )
  (*error* nil)
)

Yes, you might want to add cmdecho and undo control and embellish the *error* function, but I'll leave that to you and your style.

John F. Uhden

1,581 Views
18 Replies
Replies (18)
Message 2 of 19

Jonathan3891
Advisor
Advisor

I've tried your lisp on several attributes blocks and I keep getting this error

Select attribute to modify: Unknown command "DDEDIT".  Press F1 for help.
<Entity name: DFB79EA0>

Jonathan Norton
Blog | Linkedin
0 Likes
Message 3 of 19

SeeMSixty7
Advisor
Advisor

DDEDIT was discontinued at some point.

 

Swap out the DDEDIT with TEXTEDIT and it will work fine for you.

 

@john.uhden uses an older AutoCAD version and it works like a champ for him.

 

Nice work John!

0 Likes
Message 4 of 19

SeeMSixty7
Advisor
Advisor

@john.uhden I downloaded and ran this a few times using the TEXTEDIT command. It behaves a bit differently. There is TEXTEDITMODE Variable that you can set to single then eliminate the extra "" in the command line.

 

(setq tedmode (getvar "TEXTEDITMODE"))
(setvar "texteditmode" 1) ;Flag to disable multi edit (0 = multi; 1=single)
(command "_.textedit" dummy)

I was also thinking it might be nice to set the text insert to the center of the screen for what ever space is current. Don't you just love it when someone just says "Hey, you could do this or that?" GRIN!

 

Thanks,

0 Likes
Message 5 of 19

john.uhden
Mentor
Mentor
I try to use a version that befits my age, but they don't run R9 and MS-DOS
here anymore. But I am considering getting a new calculator with Nixie
tube display and one memory. I still remember the DMS to radian
conversion...
0.0174532925 * degrees
+ 0.0002908882 * minutes
+ 0.0000048481 * seconds

John F. Uhden

0 Likes
Message 6 of 19

SeeMSixty7
Advisor
Advisor

I think I have a copy of R10 for OS/2 still handy. LOL

 

You will need a 5.25 floppy drive though!

 

0 Likes
Message 7 of 19

ronjonp
Advisor
Advisor

Does CNTRL+DoubleLeftClick not work for you?

2019-10-23_9-49-35.gif

Message 8 of 19

SeeMSixty7
Advisor
Advisor

@ronjonp I don't think that works on R9 or R10. LOL!

 

Kidding aside, That is a new one for me. What release did that come out in? Thanks for sharing!

0 Likes
Message 9 of 19

ronjonp
Advisor
Advisor

I'm not exactly sure what release it was introduced in but I've been using it for at least 10 of my 20 years of CAD  🙂

 

Then again .. I don't remember what happened yesterday 😂

Message 10 of 19

john.uhden
Mentor
Mentor
LOL! I think its best use would be for pistol practice.

John F. Uhden

Message 11 of 19

SeeMSixty7
Advisor
Advisor

I'm saving it  to donate to the AutoCAD Museum some day. GRIN. 

0 Likes
Message 12 of 19

ronjonp
Advisor
Advisor

Here's a portion of my collection for the museum 🙂

image.png

Message 13 of 19

john.uhden
Mentor
Mentor
I wonder if I still have a SoftEngine disk or CD.
I think I still have my light blue "Auto Manager now has a mouse" T shirt
from Chicago 1988. Those were the days when I got paid to go to shows. :[

What I would love to find is the barb I had with Tony T way back in the
day. He called me a pea brain for some solution I proposed claiming that
no one could possibly figure out how to use it (or something like that).
To which I replied "well, if a pea brain like me can figure it out then
certainly anybody can."

John F. Uhden

Message 14 of 19

Sea-Haven
Mentor
Mentor

Yeah had a demo in AUS say 20 years ago by a Autodesk  re-spouting land desktop, showed grading tool asked does it do cut=fill balance 20 years later CIV3d still no. The 20+ years old other software still does it.

0 Likes
Message 15 of 19

john.uhden
Mentor
Mentor
AUS?
Do you know Laurie Comerford?

John F. Uhden

0 Likes
Message 16 of 19

Sea-Haven
Mentor
Mentor

Yes,  met him a couple of times.

 

Not sure where he is now can find out though.

0 Likes
Message 17 of 19

john.uhden
Mentor
Mentor

Laurie actually paid me a visit in 2001.

 
 

John Uhden and Laurie.jpg

We still hang the same plants every year from Barlow Flower Farm (just down the street).

My wife just makes everything grow big and beautiful.

John F. Uhden

0 Likes
Message 18 of 19

Sea-Haven
Mentor
Mentor

Type Rpncalc found this the other day.

 

HP 33 35 45 etc.

0 Likes
Message 19 of 19

john.uhden
Mentor
Mentor

That's too many keys to find, especially in the dark )mu ;ohjy just went ouy+

John F. Uhden

0 Likes