<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="text-autospace:none">I have resolved smtkCorePython issue. Thank you so much for the prompt reply. I have one more question to ask. Here I am attaching is the sbi file I am trying to read. I was trying to get the value of the ProjectName
 String inside the Globals attribute. I can get the item but not the value. Here’s what I did<o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><o:p> </o:p></p>
<p class="MsoNormal" style="text-autospace:none">log = smtk.io.Logger()<o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none">rdr = smtk.io.<u>AttributeReader</u>()  <o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:13.0pt;text-autospace:none"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:13.0pt;text-autospace:none">rdr.read(asys, sys.argv[1], log)<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:13.0pt;text-autospace:none">att = asys.findAttribute('Globals’)<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:13.0pt;text-autospace:none">gr = att.findString('ProjectName')<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:13.0pt;text-autospace:none">gr = att.findGroup('ProjectInformation')<o:p></o:p></p>
<p class="MsoNormal">gr.find('ProjectName')<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Please let me know how can I access the value of my ProjectName.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Indu<o:p></o:p></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#1F497D"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal">Check your PYTHONPATH environment, make sure you did not accidentally included a path from older smtk build (which will explain why the "SMTKCorePython" lib is pulled in). From a python shell, you can run <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">help('modules')<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">You should see smtkCorePython listed there. If you see SMTKCorePython instead, your PYTHONPATH is including an older smtk build/install.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Yumin<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Yumin Yuan [mailto:<a href="mailto:yumin.yuan@kitware.com" target="_blank">yumin.yuan@kitware.com</a>]
<br>
<b>Sent:</b> Thursday, June 25, 2015 9:30 AM<br>
<b>To:</b> Shukla, Indu ERDC-RDE-ITL-MS</span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><br>
<b>Cc:</b> David Thompson; <a href="mailto:smtk-developers@smtk.org" target="_blank">
smtk-developers@smtk.org</a>; Hines, Amanda M ERDC-RDE-ITL-MS<br>
<b>Subject:</b> Re: [Smtk-developers] Help<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hi Indu,<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">On Thu, Jun 25, 2015 at 10:17 AM, Shukla, Indu ERDC-RDE-ITL-MS <<a href="mailto:Indu.Shukla@erdc.dren.mil" target="_blank">Indu.Shukla@erdc.dren.mil</a>> wrote:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Yes I am using the same build. Do you suggest to use import smtkCorePython instead of just smtk?
<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">No, what I meant is, in the latest smtk build, there should be no "SMTKCorePython" lib anymore, instead you should have a "smtkCorePython" lib. The fact that you error message says
 "<span style="font-size:9.5pt;color:#500050">AttributeError: type object 'SMTKCorePython.smtk.attribute' has no attribute 'System'"
</span><span style="font-size:9.5pt;color:black">suggests that this is an older version of smtk, because the latest smtk should have said </span>"<span style="font-size:9.5pt;color:#500050">AttributeError: type object 'smtkCorePython.smtk.attribute' has no
 .....".</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.5pt;color:#500050">Yumin</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I tried that, but it is giving me build errors. I have installed shiboken as well but in the link it says to ignore shiboken warnings.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
</blockquote>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Yumin Yuan [mailto:<a href="mailto:yumin.yuan@kitware.com" target="_blank">yumin.yuan@kitware.com</a>]
<br>
<b>Sent:</b> Wednesday, June 24, 2015 3:26 PM<br>
<b>To:</b> Shukla, Indu ERDC-RDE-ITL-MS<br>
<b>Cc:</b> David Thompson; <a href="mailto:smtk-developers@smtk.org" target="_blank">
smtk-developers@smtk.org</a>; Hines, Amanda M ERDC-RDE-ITL-MS<br>
<b>Subject:</b> Re: [Smtk-developers] Help</span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.5pt">Hi Indu,</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.5pt">Are you using the latest smtk (<a href="https://github.com/Kitware/SMTK.git" target="_blank">https://github.com/Kitware/SMTK.git</a>), or some older
 build from CMB ? The module name should be called "smtkCorePython" now with lower case "smtk". We changed the class name of 'smtk::attribute::Manager'  to 'smtk::attribute::System' a while back, so older version of smtk will not have 'System' class.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.5pt">Yumin</span><o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">On Wed, Jun 24, 2015 at 3:27 PM, Shukla, Indu ERDC-RDE-ITL-MS <<a href="mailto:Indu.Shukla@erdc.dren.mil" target="_blank">Indu.Shukla@erdc.dren.mil</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">David,<br>
<br>
I simplified the script even further. But still get this error.<br>
<br>
Error:<br>
Traceback (most recent call last):<br>
  File "<string>", line 5, in <module><br>
  File "/Users/indushukla/Documents/workspace/ADH_Test_Today/source/Root/Test/MetXL.py", line 8, in <module><br>
    asys = smtk.attribute.System()<br>
AttributeError: type object 'SMTKCorePython.smtk.attribute' has no attribute 'System'<br>
<br>
Thanks!<br>
<br>
Indu<br>
<br>
<br>
-----Original Message-----<br>
From: David Thompson [mailto:<a href="mailto:david.thompson@kitware.com" target="_blank">david.thompson@kitware.com</a>]<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt">Sent: Wednesday, June 24, 2015 2:03 PM<br>
To: Shukla, Indu ERDC-RDE-ITL-MS<br>
Cc: <a href="mailto:smtk-developers@smtk.org" target="_blank">smtk-developers@smtk.org</a>; Hines, Amanda M ERDC-RDE-ITL-MS<br>
Subject: Re: [Smtk-developers] Help<br>
<br>
Hi Inda,<br>
<br>
It looks like you call "import smtk" twice. This is not an error, however, the variables asys and mmgr are populated at lines 25 and 26 only if the second import attempt fails. Since it is not failing, there are probably statements below that try to call methods
 on undefined variables.<br>
<br>
        David<br>
<br>
> On Jun 24, 2015, at 2:58 PM, Shukla, Indu ERDC-RDE-ITL-MS <<a href="mailto:Indu.Shukla@erdc.dren.mil" target="_blank">Indu.Shukla@erdc.dren.mil</a>> wrote:<br>
><br>
> Sorry, I took the screen shot but forgot to send you.<br>
><br>
> -----Original Message-----<br>
> From: David Thompson [mailto:<a href="mailto:david.thompson@kitware.com" target="_blank">david.thompson@kitware.com</a>]<br>
> Sent: Wednesday, June 24, 2015 1:55 PM<br>
> To: Shukla, Indu ERDC-RDE-ITL-MS<br>
> Cc: <a href="mailto:smtk-developers@smtk.org" target="_blank">smtk-developers@smtk.org</a>; Hines, Amanda M ERDC-RDE-ITL-MS<br>
> Subject: Re: [Smtk-developers] Help<br>
><br>
> Hi Indu,<br>
><br>
> It would help to see the script you are running instead of trying to guess what is happening from an error message.<br>
><br>
>       David<br>
><br>
>> On Jun 24, 2015, at 2:53 PM, Shukla, Indu ERDC-RDE-ITL-MS <<a href="mailto:Indu.Shukla@erdc.dren.mil" target="_blank">Indu.Shukla@erdc.dren.mil</a>> wrote:<br>
>><br>
>> David,<br>
>><br>
>> Yes, I did had smtk.attribute.Item(). But the compiler still doesn't understands that code. It says "Undefined variable from import:System"<br>
>><br>
>> Thanks,<br>
>><br>
>> Indu<br>
>><br>
>> -----Original Message-----<br>
>> From: David Thompson [mailto:<a href="mailto:david.thompson@kitware.com" target="_blank">david.thompson@kitware.com</a>]<br>
>> Sent: Wednesday, June 24, 2015 1:34 PM<br>
>> To: Shukla, Indu ERDC-RDE-ITL-MS<br>
>> Cc: <a href="mailto:smtk-developers@smtk.org" target="_blank">smtk-developers@smtk.org</a>; Hines, Amanda M ERDC-RDE-ITL-MS<br>
>> Subject: Re: [Smtk-developers] Help<br>
>><br>
>> Hi Indu,<br>
>><br>
>> The error does not look like a library issue. Library issues would show up when you run "import smtk". The only way it could be a library issue is if you have multiple versions of the same SMTK libraries and are loading in mismatched versions.<br>
>><br>
>> Are you certain that line is the one causing the problem? If I run<br>
>><br>
>>      import smtk<br>
>>      smtk.attribute.Item()<br>
>><br>
>> I get the error you are reporting (because indeed Item is an abstract class). Does "smtk.attribute.Item()" appear anywhere in your script?<br>
>><br>
>>      David<br>
>><br>
>>> On Jun 24, 2015, at 2:28 PM, Shukla, Indu ERDC-RDE-ITL-MS <<a href="mailto:Indu.Shukla@erdc.dren.mil" target="_blank">Indu.Shukla@erdc.dren.mil</a>> wrote:<br>
>>><br>
>>> David,<br>
>>><br>
>>> Thank you so much for your prompt reply.<br>
>>><br>
>>> I have tried using this line of code "asys = smtk.attribute.System()" but I get this error.<br>
>>><br>
>>> ''NotImplementedError: 'smtk::attribute::Item' represents a C++ abstract class and cannot be instantiated". Am I missing some library?<br>
>>><br>
>>> Indu<br>
>>><br>
>>> -----Original Message-----<br>
>>> From: David Thompson [mailto:<a href="mailto:david.thompson@kitware.com" target="_blank">david.thompson@kitware.com</a>]<br>
>>> Sent: Wednesday, June 24, 2015 11:11 AM<br>
>>> To: Shukla, Indu ERDC-RDE-ITL-MS<br>
>>> Cc: <a href="mailto:smtk-developers@smtk.org" target="_blank">smtk-developers@smtk.org</a>; Hines, Amanda M ERDC-RDE-ITL-MS<br>
>>> Subject: Re: [Smtk-developers] Help<br>
>>><br>
>>> Hi Indu,<br>
>>><br>
>>>> I am Indu Shukla from ERDC, ITL. I have developed a .sbt file with a list of instance view and attribute view. We are not using our sbt files to run any kind of simulation. We only want to use this simulation template just as a form. Upon submission our
 python script is expected to read the values from the text boxes/radio buttons/drop downs/checkboxes from the simulation template and write them into Json format.<br>
>>>><br>
>>>> Since I don't have access to SMTK API documentation I am running into issue how to access the those instance views/attribute views and their values. I am attaching me .sbt file here, please explain me through some examples how to access those controls
 and their values.<br>
>>><br>
>>> There is a user's guide (with links to reference API documentation) at:<br>
>>><br>
>>> <a href="http://smtk.readthedocs.org/en/latest/" target="_blank">http://smtk.readthedocs.org/en/latest/</a><br>
>>><br>
>>> and in particular, some information about using python:<br>
>>><br>
>>><br>
>>> <a href="http://smtk.readthedocs.org/en/latest/tutorials/python_first_steps/ind" target="_blank">
http://smtk.readthedocs.org/en/latest/tutorials/python_first_steps/ind</a><br>
>>> ex.html<br>
>>><br>
>>> In terms of reading an attribute from an SBT file, this test is an example of how to do so from a Python script, starting at line 55:<br>
>>><br>
>>> <a href="https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt" target="_blank">
https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt</a><br>
>>> hon/definitionDefaultValueTest.py#L55<br>
>>><br>
>>> and these Python tests are examples of how to access items in the attribute:<br>
>>><br>
>>><br>
>>> <a href="https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt" target="_blank">
https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt</a><br>
>>> hon/attributeFindItemTest.py<br>
>>> <a href="https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt" target="_blank">
https://github.com/Kitware/SMTK/blob/master/smtk/attribute/testing/pyt</a><br>
>>> hon/attributeItemByPath.py<br>
>>><br>
>>>     Hope this helps,<br>
>>>     David<br>
>><br>
><br>
> <Attribute_error.png><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><br>
_______________________________________________<br>
Smtk-developers mailing list<br>
<a href="mailto:Smtk-developers@smtk.org" target="_blank">Smtk-developers@smtk.org</a><br>
<a href="http://public.kitware.com/mailman/listinfo/smtk-developers" target="_blank">http://public.kitware.com/mailman/listinfo/smtk-developers</a><o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>