Keyword dropdown list

Keyword dropdown list

SRSDS
Advisor Advisor
1,740 Views
7 Replies
Message 1 of 8

Keyword dropdown list

SRSDS
Advisor
Advisor

Is there a way to force enable the PromptKeywordOptions dropdown list that appears in the drawing pane of newer versions of AutoCAD?

 

For some reason it appears on some cases and not others. Exactly the same code and I can't figure out why it dosn't.

 

Also, some of our computers don't seem display the dropdown list at all. Not the right forum but is there a manual setting to enable that?

0 Likes
1,741 Views
7 Replies
Replies (7)
Message 2 of 8

Hallex
Advisor
Advisor
Check displaymode variables in there,
just from the top of head, sorry
_____________________________________
C6309D9E0751D165D0934D0621DFF27919
0 Likes
Message 3 of 8

SRSDS
Advisor
Advisor

I think I've worked out the issue.

 

It isn't displaying the list is when it is triggered within a reactor and within a transaction.

It seems to work within a reactor but outside a transaction. I'll have to stop and start the transaction each side of the prompts.

 

If there is a fix to this it would be great though.

0 Likes
Message 4 of 8

Hallex
Advisor
Advisor

I have an idea about

Declare variable outside of you command scope,say as member of your class, then use:

ed.PromptedForKeyword

to set value of this variable

Not tested just from the top of my head

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
0 Likes
Message 5 of 8

DiningPhilosopher
Collaborator
Collaborator
What is the purpose of prompting for input from within a reactor callback (which is quite dangerous, and really should be avoided). ?
0 Likes
Message 6 of 8

SRSDS
Advisor
Advisor

I've discovered that you can't have transactions in some reactors like ObjectErased, ObjectAppeneded .

 

CommandStarted, CommandEnded, ImpliedSelectionChanged InitializeActive Document is fine.

It would be  handy if someone could list which ones to avoid.

 

Doesn't seem like it's dangerous. 

 

The problem of missing dropdown lists is also happening within control reactors within palette containers.

So it's a problem with reactors in general.

0 Likes
Message 7 of 8

SRSDS
Advisor
Advisor

Sorry..It's not the transactions within a reactor that are a problem. It's the e.GlobalCommandName = "GRIP_STRETCH" reactor.

 

The dropdown list is there because it flashes for a split second after a response is made but for some reason it's being hidden.

 

 

0 Likes
Message 8 of 8

DiningPhilosopher
Collaborator
Collaborator

@SRSDS wrote:

I've discovered that you can't have transactions in some reactors like ObjectErased, ObjectAppeneded .

 

CommandStarted, CommandEnded, ImpliedSelectionChanged InitializeActive Document is fine.

It would be  handy if someone could list which ones to avoid.

 

Doesn't seem like it's dangerous. 

 


 

That's only because you haven't bothered to test your code with those things that it can affect.  The wishful-thinking approach where you don't really test your code at all, or thorougly, will only lead to you having to throw it all out and start over from scratch.  Handling all of those events and doing things in them that take significant time will cause AutoCAD to run like a snail, and you've obviously not realized that yet.

 

Try undoing/redoing things after your event handlers kick in, and you might find that you've disabled REDO or otherwise caused the undo mechanism to not behave correctly.

 

The StartOpenCloseTransaction() method returns a transaction that can be used from events, but opening objects and doing things like getting user input from those events is going to ultimately fail.

 

Maybe I should't be telling you this, as the best lessons are the ones that come with some pain.

 

 

 

0 Likes