Friday, August 15, 2014

Create and Add Extended Help to a custom AutoCAD Command

The extended help information provided for commands through the CUI can be a very handy way to help users understand the functionality of a command. Several of the AutoCAD provided commands have nice extended help files. For example the Scale command:
 
Just to clarify what extended help is, if you hover over a command in an AutoCAD ribbon you will first see the Tooltip.
  
Hover for a bit longer and the Extended Help will display.
 
The extended help file is managed in an XAML (Extensible Application Markup Language) file. This is very similar to XML in format and can be worked with in a text editor.
Here are some points to make:
  • You can manage just one XAML file for your environment as it is structured to define extended help information for multiple commands.
  • Each command will have its own unique ID (defined in the XAML file) and then linked to the appropriate command using the AutoCAD CUI Editor
  • The XAML file is fairly easy to work with, especially if you are just wanting to add text and images
To create an XAML file you can paste the below structure into a blank file in Notepad (or other text editor) and save as a .XAML file type.
 

<ResourceDictionary
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 xmlns:src="clr-namespace:Autodesk.Windows;assembly=AdWindows">
 
  <src:RibbonToolTip x:Key="SLD_TOOLS_CMD_0001">
    <src:RibbonToolTip.ExpandedContent>
      <StackPanel>
        <TextBlock Background="AntiqueWhite" TextAlignment="Left">
        Shades an area in light blue by single clicking within a closed boundary. 
        </TextBlock>
        <Image Source="images/SLDtool0001.png" Width="Auto" Height="Auto">
        </Image>
      </StackPanel>
    </src:RibbonToolTip.ExpandedContent>
  </src:RibbonToolTip>

</ResourceDictionary>

The ID is important (RibbonToolTip x:Key). This will be used to connect each RibbonToolTip to a Ribbon button in AutoCAD.
Multiple RibbonToolTips can be defined in this single file. Just copy the entire RibbonToolTip section:

<src:RibbonToolTip x:Key="SLD_TOOLS_CMD_0001">
...
</src:RibbonToolTip>


and make sure to use a unique ID. (Note, whether you have 1 or multiple RibbonToolTip definitions they will all be wrapped inside the
<ResourceDictionary...>
...
</ResourceDictionary>

To add this extended help RibbonToolTip to a command in AutoCAD:

Open AutoCAD and the CUI Editor and locate the command that you want to add extended help information to. (Refer to this post on how to create a CUI ribbon element). Click the browse button to locate the XAML file created above.

Once you select the XAML file a dialog box will display showing all of the extended help IDs that are defined in the XAML file. Select the appropriate ID for the command you are working with and click OK.

 
Notice after doing this you will see the XAML file defined in the Extended Help field and the Help ID separated by a ':'

 
Now add the command to a Ribbon Panel (if it is not already) and save the CUI changes. When you hover over the ribbon button you should first see the Description

 
And then the extended help defined by the XAML file.

Using extended help is a streamlined method to provide user documentation to project teams as it does not require browsing to a different location. The functionality of the command can be explained in quite a bit of detail with this additional text and image.
 



4 comments:

  1. Want to enter into core industry? Looking for Industrial #Automation Training + #Robotics Training with `N` No. of Interviews + 100% placement.Best PLC Training in Noida & Delhi NCR is organized byDIAC. We provide best PLC training in Delhi NCR at affordable course fees with 100% JOB assistance life time. We provides week day's classes, week end classes and fast track course. Call us 9953489987.

    ReplyDelete
    Replies
    1. Streamlined Design: Create And Add Extended Help To A Custom Autocad Command >>>>> Download Now

      >>>>> Download Full

      Streamlined Design: Create And Add Extended Help To A Custom Autocad Command >>>>> Download LINK

      >>>>> Download Now

      Streamlined Design: Create And Add Extended Help To A Custom Autocad Command >>>>> Download Full

      >>>>> Download LINK 2V

      Delete
  2. Thank you for this tutorial. This is really helpful, butI do have a question: are you able to load a *.gif file instead of *.jpeg file?
    I've done a little bit of research and I have some info here: : https://github.com/XamlAnimatedGif/WpfAnimatedGif.
    The good part is that the image is displaying, but not as a gif file.
    I added a los tis bit of code at the beginning xmlns:gif="http://wpfanimatedgif.codeplex.com" , but youtno result.

    To be more practical the file that I'm trying to load is:













    With great power comes great responsibility











    ReplyDelete
    Replies
    1. Hmm strange,it doesn't paste the code, I'll try it again, sorry for the inconvenient:
      Thank you for this tutorial. This is really helpful, butI do have a question: are you able to load a *.gif file instead of *.jpeg file?
      I've done a little bit of research and I have some info here: : https://github.com/XamlAnimatedGif/WpfAnimatedGif.
      The good part is that the image is displaying, but not as a gif file.
      I added a los tis bit of code at the beginning xmlns:gif="http://wpfanimatedgif.codeplex.com" , but youtno result.

      To be more practical the file that I'm trying to load is:













      With great power comes great responsibility











      Delete