Image command reverting to modeless xref dialog

Image command reverting to modeless xref dialog

JamesMaeding
Advisor Advisor
999 Views
18 Replies
Message 1 of 19

Image command reverting to modeless xref dialog

JamesMaeding
Advisor
Advisor

I have done this for years in acad startup:

(COMMAND-S "UNDEFINE" "IMAGE")
(DEFUN C:IMAGE ()(INITDIA)(COMMAND-S "CLASSICIMAGE"))

 

but in acad 2019, the IMAGE command is reverting to the ".xref" modeless dialog.

I can rerun the startup to redefine back to classicimage, but has anyone else ran into this?

thanks


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
1,000 Views
18 Replies
Replies (18)
Message 2 of 19

CodeDing
Advisor
Advisor

@JamesMaeding ,

 

I cannot answer as to why the command is not being defined / running incorrectly.. But as a heads-up, the Documentation says that CLASSICIMAGE "...will be removed in future releases". Something to keep in mind.

 

Best,

~DD

0 Likes
Message 3 of 19

JamesMaeding
Advisor
Advisor

@CodeDing 

thanks for heads up. I always like to know ahead of time what I will have to reprogram back into acad 🙂


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Message 4 of 19

Moshe-A
Mentor
Mentor

@CodeDing  hi,

 

it says the IMAGE command will be removed but it did not said the CLASSICIMAGE will, at least Not specifically

 

moshe

 

0 Likes
Message 5 of 19

JamesMaeding
Advisor
Advisor

@CodeDing 

Yah, let's not give them any ideas!

If adesk added two commands to the web version, for every command it removes from real version, they might have a decent product some day.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 6 of 19

CodeDing
Advisor
Advisor

@Moshe-A ,

 

From the link I posted, the "Note:" is in reference to the "CLASSICIMAGE" command, not the "IMAGE" command. The IMAGE command is merely referenced in the previous line as the most-current version of the "CLASSICIMAGE" command.

 

The current IMAGE documentation does not hint, in any fashion, that it will be removed  in future releases.

 

Hope this clears things up! Just don't want to spread the wrong impression to anybody else.

 

Best,

~DD

0 Likes
Message 7 of 19

Moshe-A
Mentor
Mentor

@JamesMaeding  hi,

 

i'm sorry from what i understand they says: the IMAGE command now is actually invoking the XREF command and in future they will remove the IMAGE command but we are not going to 'fight' on that?!

 

moshe

 

0 Likes
Message 8 of 19

JamesMaeding
Advisor
Advisor

@Moshe-A 

The funny thing is they are going to remove the command I am trying to redefine to CLASSICIMAGE.

If they did that, there would be nothing to overwrite my IMAGE command so it would all be solved!

Either way, I have never had something I redefined revert back to original. That is called hijacking.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 9 of 19

Moshe-A
Mentor
Mentor

@CodeDing,

 

Autodesk is committed to full compatibility of autocad since it's first day (that in totally the opposite  what they did on Revit) and that's include the database and commands. i do not knows from what version you joined to AutoCAD but from starting says there was a TRACE command. when they introduce PLINE command the trace was totally useless but the command stays (even up to the current versions). the only thing they did is to undefine it.

 

so i do not think they will remove the CLASSICIMAGE. by the way i likes more the old interface, it's a good dialog box, no reason to remove it Smiley LOL

 

moshe

 

 

moshe

 

Message 10 of 19

ВeekeeCZ
Consultant
Consultant

@JamesMaeding wrote:

I have done this for years in acad startup:

(COMMAND-S "UNDEFINE" "IMAGE")
(DEFUN C:IMAGE ()(INITDIA)(COMMAND-S "CLASSICIMAGE"))

 

but in acad 2019, the IMAGE command is reverting to the ".xref" modeless dialog.

I can rerun the startup to redefine back to classicimage, but has anyone else ran into this?

thanks


 

I tried your ugly code add to acaddoc.lsp and run 2020, worked as expected.

Also found that the IMAGE command is weird one because you undefine the command for good. Run with .prefix won't launch the original command. 

0 Likes
Message 11 of 19

JamesMaeding
Advisor
Advisor

@ВeekeeCZ 

Deal with it. I do lisp as all caps, not anything else.

I am meticulous with indentation though, so my code looks as pretty as can be.

You did not comment on if 2020 seems to revert IMAGE back to .xref though, so I might call your reply ugly Smiley Surprised

LISPWARS


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 12 of 19

ВeekeeCZ
Consultant
Consultant

@JamesMaeding wrote:

@ВeekeeCZ 

Deal with it.


 

I obviously did and called it ugly. But you're the one who feels a need to explain yourself...

 


@JamesMaeding wrote:

@ВeekeeCZ 

...

You did not comment on if 2020 seems to revert IMAGE back to .xref though, so I might call your reply ugly ...


 

I did. Or maybe I have different expectations from that... who knows.

0 Likes
Message 13 of 19

JamesMaeding
Advisor
Advisor

@ВeekeeCZ 

Welp, I guess all caps is pretty ugly. The code is solid though Smiley Happy

You said the code worked as expected, did you see 2020 "revert" image command to .xref?

I can generally make it happen by just running IMAGE twice. I did it just now in 2019.

Anyway, we will have to have a LISP beauty contest someday on this forum.

The funny thing is, we coiuld not use autodesk as the impartial judge, as all their good lispers I knew of are gone.

Good old Peter Funk left long ago. I wonder who is left that lived  LISP in the glory days of around 2006 when the forums were heavily participated in.

 


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 14 of 19

dbroad
Mentor
Mentor

@JamesMaeding , your code worked fine for me but you report it reverting.  In order to debug the problem, it would be important to know many commands later is it reverting and under what circumstances.  It might also be helfpul to  know how the code is run in each drawing (acaddoc.lsp, acad.lsp, appload, etc.)

 

I would have coded it this way but I doubt that would affect anything 99% of the time:

(COMMAND-S "_.UNDEFINE" "IMAGE")
(DEFUN c:image () (INITDIA) (COMMAND-S "_.ISM_GROUP.CLASSICIMAGE"))

 

@ВeekeeCZ : The reason that image can't be called by a . prefix is that it is an arx implemented command. In order to override the undefinition, you would need to call it like .ISM_GROUP.IMAGE.  Note the period before and after ISM_GROUP.

 

Architect, Registered NC, VA, SC, & GA.
Message 15 of 19

JamesMaeding
Advisor
Advisor

@dbroad 

I agree history is generally needed to catch what is causing the revert, but in this case the thing that seems to cause the revert is simply running the command IMAGE.

I literally type IMAGE twice and the second one is reverted.

I open a fresh session on blank drawing and can replicate this on first two commands I enter.

I don't have any reactors or special things going on that I know of. Its something though.

One thing I noticed just now is if I rerun the acaddoc.lsp once open, that reruns the undefine and so on and then it sticks. IMAGE stays classic no matter how many times I run.

This is really no big deal as I know how to work around, just curious why its happening.

BTW, I tried on generic profile just now with no customization. It happens the same, reverts first time I run IMAGE.

I would think others could replicate this too given how boring the circumstances are to reproduce it.

I have latest update for acad 2019 btw.

 


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 16 of 19

dbroad
Mentor
Mentor

I would guess that something is breaking in your acaddoc.lsp file before the undefine command. You might try temporarily putting an (alert "image undefined") or (princ "\nimage undefined") just after the undefine code.  You might also turn off the autocomplete. Could be that another command that starts with im is redefining stuff. Could you be accidentally reloading the arx modules that include the image command?

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 17 of 19

JamesMaeding
Advisor
Advisor

@dbroad 

Creative thinking, but the situation is too simple for any of that.

In the generic (ootb) profile session I tested, which has no acaddoc.lsp, I simply pasted the code to command line.

Then ran Image twice and it happened.

There is something happening with the running of classicimage command. Its fishy too, like adesk is trying to help us get to its preferred command.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 18 of 19

ВeekeeCZ
Consultant
Consultant

@JamesMaeding wrote:

@ВeekeeCZ 

Welp, I guess all caps is pretty ugly....

 


 

Just last note to this. It's not really about some beauty. The issue is readability. While reading low-caps code eyes literally fly over the code, but when reading all-caps I need to focus on every single word much more. The brain is simply not used to it, needs some time to recognize the shape. I'm sure you have no issues with that since you're used to it, but most people are not.

If the all-caps code is longer, the first thing I usually do is changing all the code to low-caps. I know it may cause some damage, but still...

And yes, your code works fine in 2020.

0 Likes
Message 19 of 19

JamesMaeding
Advisor
Advisor

@ВeekeeCZ 

I guess that is the joke, to coders all this text can be pretty or not, but to the average human, even average engineer, it looks like a bad dream in writing.

The readability thing is exactly what I shoot for in all kinds of coding, and I'm not sure why I do all caps in lisp.

I think its to remind me how archaic the language is, and how my day would be much funner if I was in VS doing C#.

Call it self chastisement 🙂

I meticulously control indentation though, and try to avoid multiple statements on one line like the:

(DEFUN C:IMAGE ()(INITDIA)(COMMAND-S "CLASSICIMAGE"))

That is only something I do for key-ins in our lisp file that  defines them as I have like 250 so need them compact.

On my larger projects, such as the one that draws 3D utilities from a combination of alignment, surface, and user picks, I may spend 20 minutes just learning what the tool did before so I can modify it. That is where I need readability bad, as I am lazy and I may have someone waiting for a bug fix to boot.

One last note, do try the bricscad BLADE lisp IDE. It has code folding and some nice things as it kind of catalogs functions in memory so you can do certain things. I have not switched to it yet though for a few reasons relating to projects with 60 lisp pieces and also its debugging feels weird to me.

 


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes