.NET

Reply
Valued Mentor
AubelecBE
Posts: 394
Registered: ‎01-27-2010
Message 1 of 6 (239 Views)
Accepted Solution

Looking for a best way for Get Selection of User

239 Views, 5 Replies
06-15-2012 03:10 AM

Hi all . i want to launche my DLL but i want to add a parameter with it.

 

example :

 

>GC A

 

I know when autocad see a space it transform the pace in a Enter

 

My DLL can manage 8 collections    so i want the user select on the command the number before launch my dll

and i want to selec the operation  (ex : add, del etc..)

 

I have created 2 commands  GSC for launch the config and GSG for the management

The two command launch the same DLL but how to add parameter ?

 

thx

 

 

It sounds like you have your dll set to demand load. Therefore, any command you have defined within it, will demand load the dll. So all you have to worry about is starting the correct command. You can use command macros, (part of the cui functionality) to specify keyword options of the command. Set up your command to use keywords. For example, you said you have 2 commands, GSC and GSG. When the user types in either one, the dll will demand load. If each command has options, then set up those options to be Keywords. For example when the user types GSC, they would be prompted:

 

Command: GSC

Command: Select an Option1, Option2 <Option1>:

 

Then you can create 2 menu macros in your cui, like the following:

CSC;Option1;

CSC;Option2;

*Expert Elite*
chiefbraincloud
Posts: 753
Registered: ‎02-13-2008
Message 2 of 6 (228 Views)

Re: Looking for a best way for Get Selection of User

06-15-2012 08:53 AM in reply to: AubelecBE

The only way to pass a parameter to a command is to use the LispFunction attribute, but LispFunctions can not be used to demand load your .dll (I'm pretty sure).  So, you could automatically load on AutoCAD startup, and use the LispFunction, otherwise you'll need to just prompt for the inputs after the command starts.

Dave O.                                                                  Sig-Logos32.png
Distinguished Contributor
eljobe
Posts: 704
Registered: ‎01-24-2003
Message 3 of 6 (223 Views)

Re: Looking for a best way for Get Selection of User

06-15-2012 09:37 AM in reply to: chiefbraincloud

It sounds like you have your dll set to demand load. Therefore, any command you have defined within it, will demand load the dll. So all you have to worry about is starting the correct command. You can use command macros, (part of the cui functionality) to specify keyword options of the command. Set up your command to use keywords. For example, you said you have 2 commands, GSC and GSG. When the user types in either one, the dll will demand load. If each command has options, then set up those options to be Keywords. For example when the user types GSC, they would be prompted:

 

Command: GSC

Command: Select an Option1, Option2 <Option1>:

 

Then you can create 2 menu macros in your cui, like the following:

CSC;Option1;

CSC;Option2;

Valued Mentor
AubelecBE
Posts: 394
Registered: ‎01-27-2010
Message 4 of 6 (201 Views)

Re: Looking for a best way for Get Selection of User

06-17-2012 07:32 AM in reply to: chiefbraincloud

so the best way is prompt for the inputs after the command starts

I don't want use macro. modifiy the cui is not very accurate. My dll is used on 6 pc. so i have to manage all the pc.

 

is mode accurate to copy the dll on each pc.

 

 

i dont know very well the command for deman the option from user but i have do to that.

 

thx all

 

 

Distinguished Contributor
eljobe
Posts: 704
Registered: ‎01-24-2003
Message 5 of 6 (166 Views)

Re: Looking for a best way for Get Selection of User

06-18-2012 08:34 AM in reply to: AubelecBE

You don't have to modify the cui. The users could do it themselves if they want to. Or you could just make multiple commands.

 

But as far as the cui goes, you should get used to it. I have 30 users. Don't modify their existing default cui, give them a partial cui just for your code. If you're going to create dll's with a bunch of commands, you should create a partial cui. It wouldn't be nice to expect the users to just remember what all your commands are and type them at the command line from memory. If you provide a partial cui, at least they could select it from a menu if they forgot what the command was called. If you can supply ribbon panels and toolbars, that's even better.

Valued Mentor
AubelecBE
Posts: 394
Registered: ‎01-27-2010
Message 6 of 6 (148 Views)

Re: Looking for a best way for Get Selection of User

06-19-2012 03:36 AM in reply to: eljobe

hi

 

i don't want use partial cui. My user are very not accurate with acad :smileytongue:

 

so i need to create a getselection with all my command when i launch the ddl. Is more accurate i think but now i dont know how ti create a such GetSelection with GetKeyword :smileytongue:

 

 

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

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