<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Python bindings for my custom model]]></title><description><![CDATA[<p dir="auto">Dear all,</p>
<p dir="auto">I would like to have the possibility of using my custom model also when scripting in SAMSON. I haven't found any documentation for this, is it somewhere? If not, it is possible to also use pybind11 with our custom models/apps and what would be the best way to start?</p>
<p dir="auto">Thanks in advance and best regards,</p>
<p dir="auto">Elisa</p>
]]></description><link>https://forum.samson-connect.net/topic/76/python-bindings-for-my-custom-model</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Apr 2026 16:25:49 GMT</lastBuildDate><atom:link href="https://forum.samson-connect.net/topic/76.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 28 Nov 2018 12:32:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Python bindings for my custom model on Tue, 13 May 2025 08:55:48 GMT]]></title><description><![CDATA[<p dir="auto">To update the topic and for information:<br />
If you are looking for instructions on how to create Python bindings for your SAMSON Extension, please refer to the <a href="https://documentation.samson-connect.net/developers/latest/tutorials/python-bindings-for-extensions/" rel="nofollow ugc">Developer Guide: Creation of Python Bindings for SAMSON Extensions</a>.</p>
]]></description><link>https://forum.samson-connect.net/post/1165</link><guid isPermaLink="true">https://forum.samson-connect.net/post/1165</guid><dc:creator><![CDATA[DmitriyMarin]]></dc:creator><pubDate>Tue, 13 May 2025 08:55:48 GMT</pubDate></item><item><title><![CDATA[Reply to Python bindings for my custom model on Mon, 11 Feb 2019 14:55:58 GMT]]></title><description><![CDATA[<p dir="auto">I think it should be possible, it will be just an additional line in the launcher script. If we will be shipping Python Scripting with the Python environment, I think we might ship the environment with a bare SAMSON installation so that to use SAMSON Elements, that depend on this environment, the user won't need to install the Python Scripting Element.</p>
]]></description><link>https://forum.samson-connect.net/post/417</link><guid isPermaLink="true">https://forum.samson-connect.net/post/417</guid><dc:creator><![CDATA[DmitriyMarin]]></dc:creator><pubDate>Mon, 11 Feb 2019 14:55:58 GMT</pubDate></item><item><title><![CDATA[Reply to Python bindings for my custom model on Mon, 11 Feb 2019 14:48:03 GMT]]></title><description><![CDATA[<p dir="auto">Even though I develop this for Windows, I am more familiar with Linux too, so I don't know if it would be possible to incorporate on the launcher the activation of the venv, but it is done with a script created by virtualenv/venv as in Linux.</p>
]]></description><link>https://forum.samson-connect.net/post/415</link><guid isPermaLink="true">https://forum.samson-connect.net/post/415</guid><dc:creator><![CDATA[Elisa]]></dc:creator><pubDate>Mon, 11 Feb 2019 14:48:03 GMT</pubDate></item><item><title><![CDATA[Reply to Python bindings for my custom model on Mon, 11 Feb 2019 14:39:46 GMT]]></title><description><![CDATA[<p dir="auto">Ah, sorry, I see what you meant in the previous comment, I've misunderstood.<br />
I will check later the construction of a Python environment for Python Scripting so that users did not have to install Python. Activation of Python environment on Linux and Mac can be incorporated into the scripts that launch SAMSON, on Windows you can write a .bat file that will be first activating your Python env and then launching SAMSON.</p>
]]></description><link>https://forum.samson-connect.net/post/414</link><guid isPermaLink="true">https://forum.samson-connect.net/post/414</guid><dc:creator><![CDATA[DmitriyMarin]]></dc:creator><pubDate>Mon, 11 Feb 2019 14:39:46 GMT</pubDate></item><item><title><![CDATA[Reply to Python bindings for my custom model on Mon, 11 Feb 2019 14:29:51 GMT]]></title><description><![CDATA[<p dir="auto">The virtual environments doesn't really override existing modules, only once you have activated this environment, but once you exit it, the usual environment is back. It works like Anaconda environments. Once you activate the environment you can install any module you want, remove it or upgrade it, via pip as usual.</p>
]]></description><link>https://forum.samson-connect.net/post/413</link><guid isPermaLink="true">https://forum.samson-connect.net/post/413</guid><dc:creator><![CDATA[Elisa]]></dc:creator><pubDate>Mon, 11 Feb 2019 14:29:51 GMT</pubDate></item><item><title><![CDATA[Reply to Python bindings for my custom model on Mon, 11 Feb 2019 14:14:49 GMT]]></title><description><![CDATA[<p dir="auto">Yes,  if Python Scripting is shipped with a Python environment, other SAMSON Elements would not need their own, except if they use some quite specific one.</p>
<p dir="auto">Can the Python environment you are shipping with your module be extended by installing new modules?</p>
<p dir="auto">Overriding of existing modules in the user's environment is not suitable since users might need this particular environment, we should not modify a user's environment in any way.</p>
]]></description><link>https://forum.samson-connect.net/post/409</link><guid isPermaLink="true">https://forum.samson-connect.net/post/409</guid><dc:creator><![CDATA[DmitriyMarin]]></dc:creator><pubDate>Mon, 11 Feb 2019 14:14:49 GMT</pubDate></item><item><title><![CDATA[Reply to Python bindings for my custom model on Mon, 11 Feb 2019 14:09:08 GMT]]></title><description><![CDATA[<p dir="auto">Thanks!</p>
<p dir="auto">It would be only for the case that users don't have python or they need very specific Python requirements (exactly those python modules versions, for example).<br />
I think if you ship the Python Scripting Element with a virtual environment, probably other modules don't need to ship it.</p>
<p dir="auto">The virtual environment is 101MB, but I created it copying everything, maybe it could work if the user has a Python36 installation somewhere, and we just override the modules with the versions we need.</p>
]]></description><link>https://forum.samson-connect.net/post/407</link><guid isPermaLink="true">https://forum.samson-connect.net/post/407</guid><dc:creator><![CDATA[Elisa]]></dc:creator><pubDate>Mon, 11 Feb 2019 14:09:08 GMT</pubDate></item><item><title><![CDATA[Reply to Python bindings for my custom model on Mon, 11 Feb 2019 14:03:45 GMT]]></title><description><![CDATA[<p dir="auto">Thank you, <a class="plugin-mentions-user plugin-mentions-a" href="https://forum.samson-connect.net/uid/24">@Elisa</a> ! This looks great!</p>
<p dir="auto">Do you want users to use Python in your module or is it just for your module to be loaded in SAMSON if users do not have Python installed?</p>
<p dir="auto">What is the size of the resulting environment?</p>
<p dir="auto">I will try the same for the Python Scripting Element, since for the next release we are thinking about shipping it with a Python environment.</p>
]]></description><link>https://forum.samson-connect.net/post/404</link><guid isPermaLink="true">https://forum.samson-connect.net/post/404</guid><dc:creator><![CDATA[DmitriyMarin]]></dc:creator><pubDate>Mon, 11 Feb 2019 14:03:45 GMT</pubDate></item><item><title><![CDATA[Reply to Python bindings for my custom model on Mon, 11 Feb 2019 14:00:49 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for the new tutorial!!</p>
<p dir="auto">I was looking into shipping my module with a Python virtual environment, to avoid users having to install Anaconda3. So far this is what I got:</p>
<ul>
<li>
<p dir="auto">If I understood it alright, to develop and compile the module only the variables <em>PYTHON_INCLUDE_DIR</em> and <em>PYTHON_LIBRARY</em> matter, which should be Python 3.6's. I didn't check if they updated when upgrading the Anaconda installation, but it seems easy to keep an Anaconda 5.2 installation to access this in case it wouldn't work.</p>
</li>
<li>
<p dir="auto">To execute the Python Scripting (and any other depending on it) it is necessary to specify the variable <em>PYTHON_EXECUTABLE</em>. For this I think you can use a virtual environment. What I did was to use <code>pip freeze</code><br />
to get a list of modules installed in Anaconda 5.2, then I used the virtualenv module to create a virtual environment out of Anaconda 5.2 and install this modules there. I set the <em>PYTHON_EXECUTABLE</em> variable to this virtual environment <code>ENV_DIR\\Scripts\\python.exe</code> (which you can place on the data folder and then set this using the plugin installation folder, I guess). The only problem is, you have to activate the virtual environment. I tested this by going to the virtual environment folder, activating it from there in the command line, and calling <code>SAMSON-Core.exe</code> then. It worked. I didn't had Anaconda in my path, nor it worked without activating the virtual environment.</p>
</li>
</ul>
<p dir="auto">I have to update now my Anaconda3 installation for some unrelated work, so I will test if this keeps working in the developers case. Hopefully, I will be able to test if at least users can avoid installing Anaconda3 5.2 soon with a user of our module.</p>
<p dir="auto">This were the modules I installed in my virtual environment btw:</p>
<pre><code>backcall==0.1.0
colorama==0.3.9
decorator==4.3.0
ipykernel==4.8.2
ipython==6.4.0
ipython-genutils==0.2.0
jedi==0.12.0
jupyter-client==5.2.3
jupyter-console==5.2.0
jupyter-core==4.4.0
numpy==1.14.3
parso==0.2.0
pickleshare==0.7.4
prompt-toolkit==1.0.15
Pygments==2.2.0
python-dateutil==2.7.3
pyzmq==17.0.0
simplegeneric==0.8.1
six==1.11.0
tornado==5.0.2
traitlets==4.3.2
wcwidth==0.1.7
</code></pre>
<p dir="auto">Maybe you could do without numpy or with a more recent version. The virtual environment command was:</p>
<pre><code>python -m virtualenv VENV_DIR --always-copy
</code></pre>
<p dir="auto">I haven't understood yet how these specific versions of the modules are involved when compiling, but in principle the Include folder from my virtual environment, and the include folder from anaconda3 seem the same. Maybe for the Python Scripting module this is different, since it is the module actually creating the ipython console.</p>
]]></description><link>https://forum.samson-connect.net/post/403</link><guid isPermaLink="true">https://forum.samson-connect.net/post/403</guid><dc:creator><![CDATA[Elisa]]></dc:creator><pubDate>Mon, 11 Feb 2019 14:00:49 GMT</pubDate></item><item><title><![CDATA[Reply to Python bindings for my custom model on Tue, 29 Jan 2019 10:06:22 GMT]]></title><description><![CDATA[<p dir="auto">I have added a <a href="https://documentation.samson-connect.net/creation-of-python-bindings-for-samson-elements/" rel="nofollow ugc">tutorial on how to create Python bindings for functions that return or receive SAMSON physical quantities and types</a> (i.e., <code>SBQuantity</code>, <code>SBVector3</code>, etc). The code for the tutorial can be found in the <a href="https://github.com/1A-OneAngstrom/SAMSON-Developer-Tutorials" rel="nofollow ugc">sample PyBindTutorial SAMSON Element</a>.</p>
]]></description><link>https://forum.samson-connect.net/post/383</link><guid isPermaLink="true">https://forum.samson-connect.net/post/383</guid><dc:creator><![CDATA[DmitriyMarin]]></dc:creator><pubDate>Tue, 29 Jan 2019 10:06:22 GMT</pubDate></item><item><title><![CDATA[Reply to Python bindings for my custom model on Tue, 15 Jan 2019 17:32:18 GMT]]></title><description><![CDATA[<p dir="auto">Thanks, <a class="plugin-mentions-user plugin-mentions-a" href="https://forum.samson-connect.net/uid/24">@Elisa</a> !</p>
]]></description><link>https://forum.samson-connect.net/post/365</link><guid isPermaLink="true">https://forum.samson-connect.net/post/365</guid><dc:creator><![CDATA[DmitriyMarin]]></dc:creator><pubDate>Tue, 15 Jan 2019 17:32:18 GMT</pubDate></item><item><title><![CDATA[Reply to Python bindings for my custom model on Tue, 15 Jan 2019 17:30:20 GMT]]></title><description><![CDATA[<p dir="auto">I will! I am dealing with a weird unrelated bug in my programming environment, but will try to get on with this after that :)</p>
]]></description><link>https://forum.samson-connect.net/post/364</link><guid isPermaLink="true">https://forum.samson-connect.net/post/364</guid><dc:creator><![CDATA[Elisa]]></dc:creator><pubDate>Tue, 15 Jan 2019 17:30:20 GMT</pubDate></item><item><title><![CDATA[Reply to Python bindings for my custom model on Mon, 14 Jan 2019 13:31:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.samson-connect.net/uid/24">@Elisa</a> , if you came up with a solution, please, share it. In the future, we want to ship the Python Scripting Element with python interpreter and libraries, so that users won't need to install Python themselves.</p>
]]></description><link>https://forum.samson-connect.net/post/363</link><guid isPermaLink="true">https://forum.samson-connect.net/post/363</guid><dc:creator><![CDATA[DmitriyMarin]]></dc:creator><pubDate>Mon, 14 Jan 2019 13:31:17 GMT</pubDate></item><item><title><![CDATA[Reply to Python bindings for my custom model on Mon, 14 Jan 2019 13:16:53 GMT]]></title><description><![CDATA[<p dir="auto">Thank you very much, I will investigate how to ship it with a virtual python environment with pip freeze and venv.</p>
]]></description><link>https://forum.samson-connect.net/post/362</link><guid isPermaLink="true">https://forum.samson-connect.net/post/362</guid><dc:creator><![CDATA[Elisa]]></dc:creator><pubDate>Mon, 14 Jan 2019 13:16:53 GMT</pubDate></item><item><title><![CDATA[Reply to Python bindings for my custom model on Mon, 07 Jan 2019 14:11:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.samson-connect.net/uid/16">@dmitriymarin</a> said in <a href="/post/350">Python bindings for my custom model</a>:</p>
<blockquote>
<p dir="auto">Dear <a class="plugin-mentions-user plugin-mentions-a" href="https://forum.samson-connect.net/uid/24">@Elisa</a> ,<br />
This is not totally related to the Python Scripting Element but to the fact that now your Element is linked to a Python library and users will need to install Python. The Python Scripting Element also takes care of loading the Python library.<br />
There are several possibilities to solve this:<br />
1 . You can ship 2 SAMSON Elements: with Python bindings and without. But it is not that convenient.<br />
2 . Users will need to install Python.<br />
3 . You can ship a Python library together with your SAMSON Element.<br />
I will check the 3rd option and will return to you.</p>
</blockquote>
<p dir="auto">Concerning the 3rd option. A simple workaround might be to ship your SAMSON Element together with a Python library used for compilation for each platform. You can just copy the Python library in the SAMSON Binaries folder (the folder with SAMSON executable). Then even if a user has no Python installed, your SAMSON Element will be loaded since a dependency to the Python library is resolved.</p>
]]></description><link>https://forum.samson-connect.net/post/352</link><guid isPermaLink="true">https://forum.samson-connect.net/post/352</guid><dc:creator><![CDATA[DmitriyMarin]]></dc:creator><pubDate>Mon, 07 Jan 2019 14:11:05 GMT</pubDate></item><item><title><![CDATA[Reply to Python bindings for my custom model on Mon, 07 Jan 2019 13:52:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.samson-connect.net/uid/24">@elisa</a> said in <a href="/post/332">Python bindings for my custom model</a>:</p>
<blockquote>
<p dir="auto">That is not working for me, I get the error I posted before unless before that statement I add py::class_&lt;SBStructuralModel&gt;(m, "SBStructuralModel"); before exposing my structural model when importing in the Python Scripting console.</p>
</blockquote>
<p dir="auto">I have tried to reproduce the problem you are having on Win10 and Win7 with the <a href="https://github.com/1A-OneAngstrom/SAMSON-Developer-Tutorials/tree/develop" rel="nofollow ugc">PyBindTutorial sample</a>, but I could not - for me, it works without the need to expose <code>SBStructuralModel</code> (i.e., <code>py::class_&lt;SBStructuralModel&gt;(m, "SBStructuralModel");</code>) before exposing a custom structural model - there is no error when importing the module in the Python Scripting console.</p>
<p dir="auto">Could you, please, try to point not to your pybind11 folder but to one provided with the <a href="https://github.com/1A-OneAngstrom/SAMSON-Developer-Tutorials/tree/develop" rel="nofollow ugc">PyBindTutorial sample</a>, like it is already done in the CMakeLists.txt of this sample - just try to build the PyBindTutorial sample as it is.</p>
]]></description><link>https://forum.samson-connect.net/post/351</link><guid isPermaLink="true">https://forum.samson-connect.net/post/351</guid><dc:creator><![CDATA[DmitriyMarin]]></dc:creator><pubDate>Mon, 07 Jan 2019 13:52:15 GMT</pubDate></item><item><title><![CDATA[Reply to Python bindings for my custom model on Mon, 07 Jan 2019 14:02:43 GMT]]></title><description><![CDATA[<p dir="auto">Dear <a class="plugin-mentions-user plugin-mentions-a" href="https://forum.samson-connect.net/uid/24">@Elisa</a> ,</p>
<p dir="auto">This is not totally related to the Python Scripting Element but to the fact that now your Element is linked to a Python library and users will need to install Python. The Python Scripting Element also takes care of loading the Python library.</p>
<p dir="auto">There are several possibilities to solve this:<br />
1 . You can ship 2 SAMSON Elements: with Python bindings and without. But it is not that convenient.<br />
2 . Users will need to install Python.<br />
3 . You can ship a Python library together with your SAMSON Element.</p>
<p dir="auto">I will check the 3rd option and will return to you.</p>
]]></description><link>https://forum.samson-connect.net/post/350</link><guid isPermaLink="true">https://forum.samson-connect.net/post/350</guid><dc:creator><![CDATA[DmitriyMarin]]></dc:creator><pubDate>Mon, 07 Jan 2019 14:02:43 GMT</pubDate></item><item><title><![CDATA[Reply to Python bindings for my custom model on Mon, 07 Jan 2019 10:37:36 GMT]]></title><description><![CDATA[<p dir="auto">Yes, I'm using Windows 10.</p>
<p dir="auto">By the way, this is not entirely related, but now my module fails to load if the Python Scripting module is not loaded, do you know  of a simple way to handle this? So the rest of functionality of my module can be loaded.</p>
<p dir="auto">Best regards,</p>
<p dir="auto">Elisa</p>
]]></description><link>https://forum.samson-connect.net/post/349</link><guid isPermaLink="true">https://forum.samson-connect.net/post/349</guid><dc:creator><![CDATA[Elisa]]></dc:creator><pubDate>Mon, 07 Jan 2019 10:37:36 GMT</pubDate></item><item><title><![CDATA[Reply to Python bindings for my custom model on Fri, 04 Jan 2019 23:50:34 GMT]]></title><description><![CDATA[<p dir="auto">No, I do not think that it can be related to a pybind11 version. Did you experience this issue on Windows? I will try to reproduce the problem and will return to you. For now, you  may try to use your workaround with <code>py::class_&lt;SBStructuralModel&gt;(m, "SBStructuralModel");</code></p>
]]></description><link>https://forum.samson-connect.net/post/340</link><guid isPermaLink="true">https://forum.samson-connect.net/post/340</guid><dc:creator><![CDATA[DmitriyMarin]]></dc:creator><pubDate>Fri, 04 Jan 2019 23:50:34 GMT</pubDate></item><item><title><![CDATA[Reply to Python bindings for my custom model on Fri, 04 Jan 2019 12:14:05 GMT]]></title><description><![CDATA[<p dir="auto">Hi, I have built the PyBindTutorial and I got the same error:</p>
<pre><code>Jupyter QtConsole 4.3.1
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.

Python bindings for the SAMSON API are done in the same structure as the SAMSON SDK itself (see Documentation for SAMSON SDK). Python bindings for the SAMSON API are imported in the following way:

import samson as sam
from samson.Facade import SAMSON        # SAMSON Facade - main interface of SAMSON
from samson.DataModel import Quantity   # Quantities: length, mass, time, etc
from samson.DataModel import Type       # Types: position3, etc

import SE_F2078F9E_F2CB_BA72_EE86_1E01A10B63D4 as pybindtutorial
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
&lt;ipython-input-1-1dded50a96a7&gt; in &lt;module&gt;()
----&gt; 1 import SE_F2078F9E_F2CB_BA72_EE86_1E01A10B63D4 as pybindtutorial

ImportError: generic_type: type "CustomStructuralModel" referenced unknown base type "SBMStructuralModel"
</code></pre>
<p dir="auto">The only change I made to the code was in the CMakeList.txt to point to my pybind11 folder, but I don't think that should be related to this.</p>
]]></description><link>https://forum.samson-connect.net/post/337</link><guid isPermaLink="true">https://forum.samson-connect.net/post/337</guid><dc:creator><![CDATA[Elisa]]></dc:creator><pubDate>Fri, 04 Jan 2019 12:14:05 GMT</pubDate></item><item><title><![CDATA[Reply to Python bindings for my custom model on Thu, 03 Jan 2019 14:47:41 GMT]]></title><description><![CDATA[<p dir="auto">Could you, please, try to build the <a href="https://github.com/1A-OneAngstrom/SAMSON-Developer-Tutorials/tree/develop" rel="nofollow ugc">PyBindTutorial sample</a> and check if you experience the same behavior.<br />
Do you get this error when importing your module in the Jupyter QtConsole by Python Scripting?</p>
]]></description><link>https://forum.samson-connect.net/post/333</link><guid isPermaLink="true">https://forum.samson-connect.net/post/333</guid><dc:creator><![CDATA[DmitriyMarin]]></dc:creator><pubDate>Thu, 03 Jan 2019 14:47:41 GMT</pubDate></item><item><title><![CDATA[Reply to Python bindings for my custom model on Thu, 03 Jan 2019 14:18:09 GMT]]></title><description><![CDATA[<p dir="auto">That is not working for me, I get the error I posted before unless before that statement I add <code>py::class_&lt;SBStructuralModel&gt;(m, "SBStructuralModel");</code> before exposing my structural model when importing in the Python Scripting console.</p>
]]></description><link>https://forum.samson-connect.net/post/332</link><guid isPermaLink="true">https://forum.samson-connect.net/post/332</guid><dc:creator><![CDATA[Elisa]]></dc:creator><pubDate>Thu, 03 Jan 2019 14:18:09 GMT</pubDate></item><item><title><![CDATA[Reply to Python bindings for my custom model on Thu, 03 Jan 2019 12:11:04 GMT]]></title><description><![CDATA[<p dir="auto">Yes, there is no difference between <code>SBStructuralModel</code> and <code>SBMStructuralModel</code> since it's a typedef, I just wanted to note that it is already exposed by the Python Scripting SAMSON Element and therefore, you do not need to expose it in your SAMSON Element.</p>
<p dir="auto">When you expose your own custom structural model, you just need to provide the base class (i.e., <code>SBStructuralModel</code>) and the class type (the class type also depends on the class type of the base class). For a custom structural model it should be as follows (please, see the <a href="https://github.com/1A-OneAngstrom/SAMSON-Developer-Tutorials/blob/develop/PyBindTutorial/source/CustomStructuralModelPythonBindings.cpp" rel="nofollow ugc">PyBindTutorial sample</a>):</p>
<pre><code>py::class_&lt;
	CustomStructuralModel,					/* the class */
	std::unique_ptr&lt;CustomStructuralModel, py::nodelete&gt;,	/* the class type */
	SBStructuralModel					/* the base class */
	&gt;
	c(m,							/* pybind11::module */
	"CustomStructuralModel"					/* the class name in python*/
	);
</code></pre>
<p dir="auto">Then in Python Scripting you could do something like this:</p>
<pre><code>import SE_F2078F9E_F2CB_BA72_EE86_1E01A10B63D4 as tutorial	# import your module
structuralModel = tutorial.CustomStructuralModel()		# construct a custom structural model
structuralModel.create()					# create it
layer = SAMSON.getActiveLayer()					# get active layer
layer.addChild(structuralModel)					# add the custom structural model to the active layer
structuralRoot = structuralModel.getStructuralRoot()		# get the structural root of the custom structural model
group1 = tutorial.CustomStructuralGroup('group 1')		# construct a custom structural group or other type of data graph node
group1.create()							# create it
structuralRoot.addChild(group1)					# add it to the custom structural model
group2 = tutorial.CustomStructuralGroup('group 2')
group2.create()
structuralRoot.addChild(group2)
</code></pre>
]]></description><link>https://forum.samson-connect.net/post/331</link><guid isPermaLink="true">https://forum.samson-connect.net/post/331</guid><dc:creator><![CDATA[DmitriyMarin]]></dc:creator><pubDate>Thu, 03 Jan 2019 12:11:04 GMT</pubDate></item><item><title><![CDATA[Reply to Python bindings for my custom model on Wed, 02 Jan 2019 11:12:33 GMT]]></title><description><![CDATA[<p dir="auto">I also get the error if I use SBMStructuralModel:</p>
<pre><code>ImportError: generic_type: type "MyCustomModel" referenced unknown base type "SBMStructuralModel"
</code></pre>
<p dir="auto">It doesn't seem a problem with the typedef, as adding before exposing my model <code>py::class_&lt;SBStructuralModel&gt;(m, "SBStructuralModel");</code> gets it working regardless of the alias used.</p>
<p dir="auto">Best regards,</p>
<p dir="auto">Elisa</p>
]]></description><link>https://forum.samson-connect.net/post/329</link><guid isPermaLink="true">https://forum.samson-connect.net/post/329</guid><dc:creator><![CDATA[Elisa]]></dc:creator><pubDate>Wed, 02 Jan 2019 11:12:33 GMT</pubDate></item></channel></rss>