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.
- 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.
- (Optional) 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.
- (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.
- Save and close the snippet file.