Subscribe to this thread
Home - General / All posts - Add-ins and Events in 9
KlausDE
6,013 post(s)
#12-Aug-17 10:01

It's a question for Mfd9. But may be RS prepares the ground: Will we get control over events in teh API?

adamw


7,129 post(s)
#12-Aug-17 14:03

You can make add-ins right now.

Here is how to create one:

Create a script, supply the code you want to run, test / run, etc. Then save the script to a file under ~\Bin, ~\Bin64 or ~\Shared. Use ~\Bin if you want the script to run only in 32-bit mode, ~\Bin64 if you want the script to run only in 64-bit mode, ~\Shared if you want it to run in any mode. Make sure the extension of the script file appropriately reflects its language (.CS for C#, .FS for F#, .JS for JScript.NET, .PL for Perl, .PY for IronPython, .RB for IronRuby, .VB for VB.NET, .VBS for VBScript). Then invoke Tools - Add-ins - Rescan, and your script file should appear in the Tools - Add-ins menu.

Try it with the attached file (put it into ~\Shared).

We will have events as well. What specific scenarios are you looking for? If we are talking about firing events when there are changes to data in component X, one can already do quite a lot with version numbers (ie, a script can record the version of a component in a service table / comment / wherever, and when it is ran again, it can check whether the component has changed since, and act appropriately).

Added: reuploaded the original attachment as a ZIP in a post below.

tjhb

7,387 post(s)
#13-Aug-17 00:00

1. Is anyone else having trouble sownloading the .cs attachment above? I get a 404 error.

2.

We will have events as well. What specific scenarios are you looking for?

I would most like to access events that fire on any right-click, with notification of the context object, along with the ability to add items into the resulting context menus. This is a mechanism that I would like to learn to program for since it would be immensely powerful. (Previously discussed during beta.)

jsperr47 post(s)
#13-Aug-17 02:47

1, Agreed -- 404 Error here as well

adamw


7,129 post(s)
#13-Aug-17 06:14

Oops, sorry, it's the forum security controls.

Reuploading as a ZIP.

Attachments:
List Components.zip

lionel94 post(s)
#13-Aug-17 02:59

Hi

I think the code must be custom ( add a few line of code ) when copy the code inside RS9 to external File addin ?

1) For all language supported by M8 & RS9 :

Does all scripts files

--inside RS9 M8 are only interpret ( no compiler) ?

--outside M8 RS9 for add in are compile ?

2) The "list component.cs" file on server is not available when i try to download it !!!

Could we have it again or a link to be able to undesrtand and test add in in RS9 ?

3) Do we need for IronPython extension *.PY or *.py ? .

4) So python and javascript are not supported ...since *.JS and .PY extension are already define/use/link for JScript and IronPython?

regard's

NB i think interpret mean every launch compile and run the code = JIT

..............compile mean compile step already done so launch mean run the already compile code

..............compile mean content be compatible for the runtime context/ env .

adamw


7,129 post(s)
#13-Aug-17 06:30

1 - Scripts are mostly interpreted, or, in the case of .NET compiled from scratch every time they run. There is an exception in that you can pre-compile a .NET script into a .DLL and use that either as an add-in or as a function / set of functions for a query (FUNCTION ... AS SCRIPT FILE ...).

2 - Sorry for that. I reuploaded the script as a ZIP above.

3 - The case of extensions does not matter.

4 - Yes, there is some competition for the extensions. We will likely allow specifying the exact scripting engine in the leading comments of a file in the future.

lionel94 post(s)
#13-Aug-17 23:26

adobe use *.jsx extension (ExtendScript) in their Adobe suite ( community now) .So many adobe software can use script but many ways to automate are available in adobe software ( one is macro recording like microsoft office ) .

general http://www.adobe.com/devnet/scripting.html

KlausDE
6,013 post(s)
#14-Aug-17 17:40

We will have events as well. What specific scenarios are you looking for?

I will have to rebuild my add-ins used with Mfd8.

The format-organizer copies all formats including layer opacity and stores original Mfd8 style.xml files. This is a job for Mfd9 and not RS9. I don't know about plans to ensure backwards compatibility.

More interesting and perhaps not a build-in standard feature (although I'd love it):

I use an add-in to store image position including direction reading and writing EXIF data. I use it for bat recordings as well. For manual input it captures a click event and then directs the click event handler to another function that calculates direction from the the next mouse click.

KlausDE
6,013 post(s)
#16-Aug-17 22:06

In an NET. environment what I need for my second scenario seems to be mainly a function to convert screen coordinates to the coordinates of the map.

Manifold User Community Use Agreement Copyright (C) 2007-2017 Manifold Software Limited. All rights reserved.