Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Frequent Contributor
Posts: 126
Registered: ‎10-16-2015

Spatial Modeler SDK: set up path for plugins and dll's

[ Edited ]

Hi,

 

I'm new to the Spatial Modeler SDK and I'm trying to set up my developers environment.

 

Succesfull so far:

  • Installed the SDK
  • Installed Visual Studio 2013
  • Opened the solutions file from examples
  • Built all examples

My first question is:

How do I tell the Spatial Modeler Editor to look in the examples plugin also?

 

In Extending Spatial Modeler it says : "Another way to define the location of a plugin DLL is through an XML file located in Spatial Modeler’s path" but it doesn't say what the name of the file should be. And what is the Spatial Modeler's path?? 

 

 

Second question:

I was able to build the examples only from the examples directory. Moving the code to another directory didn't work, because lots of files could not be found. How do I set up everything in Visual Studio so I can use a custom path for my code?

 

Third question:

Do I really have to restart the Spatial Modeler Editor every time I compile again? Or is there a quicker developer cycle?

Technical Evangelist
Posts: 57
Registered: ‎09-16-2015

Re: Spatial Modeler SDK: set up path for plugins and dll's

Hi, haayman,

 

First answer:  The "Spatial Modeler's path" is the directories specified above the statement you quote (the bulletted list and the two paragraphs that surround it).

 

Second answer:  You can modify the .props file that accompanies each example (in the directory with the sources and .vcxproj).

 

Third answer:  Yes, you have to restart the Spatial Model Editor in order to compile and test your changes (assuming that your plugin has already been successfully loaded into memory).

 

Frequent Contributor
Posts: 126
Registered: ‎10-16-2015

Re: Spatial Modeler SDK: set up path for plugins and dll's

ad 1) ok, the path is clear. But what about 'an XML file located in Spatial Modeler’s path'. What should the name of the XML-file be?

 

ad 2) I notice in the props that there are references to $(SpatialModelerSDKHome) and $(SpatialModelerSDKExampleIntDir), etc. I did something yesterday that caused these variables to vanish. Where are they set?

Technical Evangelist
Posts: 57
Registered: ‎09-16-2015

Re: Spatial Modeler SDK: set up path for plugins and dll's

1.  The XML file can have any name as long as it has a .xml extension.  Spatial Modeler will pick up any .xml file in the path.

 

2.  Those variables are defined at the top of the .props file.  Below is the original contents of the .props file for Example 1 (smNDVIExanple) in case you've "corrupted" your .props files.

 

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ImportGroup Label="PropertySheets" />
  <PropertyGroup Label="UserMacros">
    <SpatialModelerSDKHome>..\..\..</SpatialModelerSDKHome>
    <SpatialModelerSDKExampleIntDir>$(Platform)$(Configuration)\</SpatialModelerSDKExampleIntDir>
  </PropertyGroup>
  <PropertyGroup />
  <ItemDefinitionGroup />
  <ItemGroup>
    <BuildMacro Include="SpatialModelerSDKHome">
      <Value>$(SpatialModelerSDKHome)</Value>
    </BuildMacro>
    <BuildMacro Include="SpatialModelerSDKExampleIntDir">
      <Value>$(SpatialModelerSDKExampleIntDir)</Value>
    </BuildMacro>
  </ItemGroup>
</Project>