.NET

Reply
Mentor
SRSDS
Posts: 247
Registered: ‎04-15-2011
Message 1 of 8 (285 Views)

Keyword dropdown list

285 Views, 7 Replies
05-17-2013 10:09 AM

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?

*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 2 of 8 (268 Views)

Re: Keyword dropdown list

05-17-2013 02:11 PM in reply to: SRSDS
Check displaymode variables in there,
just from the top of head, sorry
_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Mentor
SRSDS
Posts: 247
Registered: ‎04-15-2011
Message 3 of 8 (246 Views)

Re: Keyword dropdown list

05-19-2013 06:24 AM in reply to: Hallex

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.

*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 4 of 8 (218 Views)

Re: Keyword dropdown list

05-20-2013 02:09 PM in reply to: SRSDS

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
Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 5 of 8 (217 Views)

Re: Keyword dropdown list

05-20-2013 02:17 PM in reply to: SRSDS
What is the purpose of prompting for input from within a reactor callback (which is quite dangerous, and really should be avoided). ?
Mentor
SRSDS
Posts: 247
Registered: ‎04-15-2011
Message 6 of 8 (209 Views)

Re: Keyword dropdown list

05-20-2013 02:42 PM in reply to: DiningPhilosopher

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.

Mentor
SRSDS
Posts: 247
Registered: ‎04-15-2011
Message 7 of 8 (183 Views)

Re: Keyword dropdown list

05-22-2013 07:25 AM in reply to: SRSDS

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.

 

 

Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 8 of 8 (174 Views)

Re: Keyword dropdown list

05-22-2013 02:09 PM in reply to: SRSDS

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.

 

 

 

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.