RP Photonics logo
RP Photonics
Modeling & Design Software
Technical consulting services on lasers, nonlinear optics, fiber optics etc.
Profit from the knowledge and experience of a top expert!
Powerful simulation and design software.
Make computer models in order to get a comprehensive understanding of your devices!
Success comes from understanding – be it in science or in industrial development.
The famous Encyclopedia of Laser Physics and Technology – available online for free!
The ideal place for finding suppliers for many photonics products.
Advertisers: Make sure to have your products displayed here!
powerful tools for efficient laser development and laser science
This page gives you an overview on our software products.
RP Fiber Calculator is a convenient tool for calculations on optical fibers.
RP Fiber Power is an extremely flexible tool for designing and optimizing fiber devices.
RP Resonator is a particularly flexible tool for laser resonator design.
RP ProPulse can simulate the pulse evolution e.g. in mode-locked lasers and sync-pumped OPOs.
RP Coating is a particularly flexible design tool for dielectric multilayer systems.
RP Q-switch can simulate the power evolution in Q-switched lasers.
Most of our software products support a powerful script language, which gives you an extraordinary degree of flexibility.
Here you learn about software license conditions, updates and upgrades, etc.
Competent technical support is a key quality associated with software from RP Photonics.
RP Photonics has distributors in various countries.
The RP Photonics Software News keep you updated on our developments and give the users additional interesting hints.
Here you can make inquiries e.g. concerning technical details, prices and quotations.

The RP Photonics Software News

New Feature: Code Snippets Library

Posted on 2016-06-21 in the RP Photonics Software News (available as e-mail newsletter!)

Permanent link: https://www.rp-photonics.com/software_news_2016_06_21.html

Author: Dr. Rüdiger Paschotta, RP Photonics Consulting GmbH

Abstract: A new feature has been implemented in our software products RP Fiber Power, RP Coating, RP ProPulse and RP Resonator: the code snippets library, where you can conveniently get snippets of script code for common purposes. Our customers can get this with a free update.

Dr. Rüdiger Paschotta

I have just implemented a nice new feature for the software RP Fiber Power, RP Coating, RP ProPulse and RP Resonator. There is now the so-called code snippets library. Its purpose is to conveniently provide certain parts (snippets) of script code, which you can directly insert in the script editor. You will normally find it quite easy to understand the snippets, which also contain some comments, and can adapt them to your application.

You can reach the code snippet library with the Edit menu or (more quickly) with a new item in the toolbar of the main window, and here is what you will see (in case of RP Fiber Power):

code snippets library

(In other programs, you will find a different set of specialized snippets.)

The library is very easy to handle. You just select a snippet in the list on the left side, and see its content on the right side. With the button “Copy to clipboard” you can copy it to the Windows clipboard; with “Insert into script editor” it is also inserted into the active script editor – just at the location of the cursor. (If you got the wrong position, press Ctrl-Z to redo, move the cursor to the correct location, and press Ctrl-V for pasting again.)

Using this feature is certainly easier than searching for some solution in the documentation, e.g. in the online help system, or in the demo files. When you find a command or function in the code which you do not know, just place the cursor on it in the script editor and press F2 to call the corresponding help page.

The software comes with some set of code snippets, and you can also add your own snippets quite easily. With the button at the bottom, you can open a file in a user folder where you can place your own snippets; these will be used in addition, and will not be lost if the original snippets file is changed due to a software update, for example.

I will probably add quite a few more snippets in the coming weeks, trying to provide useful things for a lot of common purposes.

As always, users of our software can have a free update in order to get this feature – just contact us. This holds even if you are using a quite old version. You know, many other software companies want you to regularly pay for maintenance subscriptions, while we are very generous to our customers.

This article is a posting of the RP Photonics Software News, authored by Dr. Rüdiger Paschotta. You may link to this page, because its location is permanent.

Note that you can also receive the articles in the form of a newsletter or with an RSS feed.

If you like this article, share it with your friends and colleagues, e.g. via social media: