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.
-
In Windows Explorer, navigate to the …/STAAD/Editor/Snippets/Std/
folder in your STAAD.Pro installation folder.
-
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.
-
Rename this copy to something meaningful.
-
Open the reanmed file in a plain text editor.
-
Change the header information:
-
Type a new title within the
<Title>
element.
-
Type a your name or your organization's name within the
<Author>
element.
-
Type a tool tip description within the
<Description>
element.
-
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.
- Optional:
If you want to add replacement strings in the snippet, create a
<Literal>
element inside the <Declarations>
section for each.
-
Type or paste the actual snippet STAAD input code into the CDATA section, between the inner-most square brackets.
Example:
<![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.
-
Save and close the snippet file.