CommandMethod CommandFlags default

CommandMethod CommandFlags default

pfluegge30167
Participant Participant
521 Views
3 Replies
Message 1 of 4

CommandMethod CommandFlags default

pfluegge30167
Participant
Participant

Do you know the default CommandFlags of this simple command [CommandMethod("myCommandName")] ?

 

I want to extend commands with helpfile, so I need to specify CommandFlags like this

[CommandMethod(null, "myCommand", null, commandFlags, null, "myHelpFile.chm", "")]. 

 

0 Likes
Accepted solutions (1)
522 Views
3 Replies
Replies (3)
Message 2 of 4

_gile
Consultant
Consultant
Accepted solution

Hi,

As far as I know The CommandFlags default is 0 (i.e. CommandFlags.Modal).

See the docs for CommandFlags Enumeration (.NET) and AcEdCommand::commandFlags (C++).



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 3 of 4

kerry_w_brown
Advisor
Advisor

 

 

[AttributeUsage(AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
public sealed class CommandMethodAttribute : Attribute, ICommandLineCallable
{
    // Methods
    public CommandMethodAttribute(string globalName);
    public CommandMethodAttribute(string globalName, CommandFlags flags);
    public CommandMethodAttribute(string groupName, string globalName, CommandFlags flags);
    public CommandMethodAttribute(string groupName, string globalName, string localizedNameId, CommandFlags flags);
    public CommandMethodAttribute(string groupName, string globalName, string localizedNameId, CommandFlags flags, string helpTopic);
    public CommandMethodAttribute(string groupName, string globalName, string localizedNameId, CommandFlags flags, Type contextMenuExtensionType);
    public CommandMethodAttribute(string groupName, string globalName, string localizedNameId, CommandFlags flags, Type contextMenuExtensionType, string helpFileName, string helpTopic);

    // Properties
    public virtual string HelpTopic { get; }
    public virtual string HelpFileName { get; }
    public virtual Type ContextMenuExtensionType { get; }
    public virtual CommandFlags Flags { get; }
    public virtual string GroupName { get; }
    public virtual string LocalizedNameId { get; }
    public virtual string GlobalName { get; }
}

 

 

These are the attribute signatures ( from reflection )

and the main method 

 

public CommandMethodAttribute(string groupName, string globalName, string localizedNameId, CommandFlags flags, Type contextMenuExtensionType, string helpFileName, string helpTopic)
    {
        this.m_groupName = groupName;
        this.m_globalName = globalName;
        this.m_localizedNameId = localizedNameId;
        this.m_flags = flags;
        this.m_contextMenuExtensionType = contextMenuExtensionType;
        this.m_helpFileName = helpFileName;
        this.m_helpTopic = helpTopic;
    }

 

 

 

added:

@_gile  beat me 🙂

 

Regards


// Called Kerry or kdub in my other life.

Everything will work just as you expect it to, unless your expectations are incorrect. ~ kdub
Sometimes the question is more important than the answer. ~ kdub

NZST UTC+12 : class keyThumper<T> : Lazy<T>;      another  Swamper
0 Likes
Message 4 of 4

pfluegge30167
Participant
Participant

rtfm 🙂

Many thanks.

0 Likes