STAAD.Pro Help

I. To create a code snippet

To create a custom code snippet using a sample as a template, do the following:

Some familiarity with editing XML files (e.g., HTML) is helpful to create snippet files, but not necessary. Further, no special tools or software are required, but a plain text editor which can validate XML is recommended.

  1. In Windows Explorer, navigate to the …/STAAD/Editor/Snippets/Std/ folder in your STAAD.Pro installation folder.
  2. Make a copy of one of the existing snippet files (file extension .snippet). You can place snippets in the same folder or create a new folder within …/STAAD/Editor/Snippets/ to orgnanize snippet files as needed.
  3. Rename this copy to something meaningful.
  4. Open the reanmed file in a plain text editor.
  5. Change the header information:
    1. Type a new title within the <Title> element.
    2. (Optional) Type a your name or your organization's name within the <Author> element.
    3. Type a tool tip description within the <Description> element.
    4. Type a shortcut string within the <Shortcut> element.
    Note: Do not edit any of the XML tags or attibutes. Only change the plain text inside elements.
  6. (Optional) If you want to add replacement strings in the snippet, create a <Literal> element inside the <Declarations> section for each.
  7. Type or paste the actual snippet STAAD input code into the CDATA section, between the inner-most square brackets.


    <![CDATA[snippet contents here]]>

    The contents here will be copied directly when the snippet is used (except for variables), including line breaks and commented lines.

    Tip: There is no syntax checking in the snippet file itself, so it is best practice to copy and paste the STAAD input snippet code from a STAAD input file you have checked for errors.
  8. Save and close the snippet file.