<div dir="ltr"><div><span style="font-size:12.8000001907349px">Hi Indu,</span><br></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">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></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><br></div><div><span style="font-size:12.8000001907349px">Yumin</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 24, 2015 at 3:27 PM, Shukla, Indu ERDC-RDE-ITL-MS <span dir="ltr"><<a href="mailto:Indu.Shukla@erdc.dren.mil" target="_blank">Indu.Shukla@erdc.dren.mil</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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>
<span class="im HOEnZb"><br>
Indu<br>
<br>
<br>
-----Original Message-----<br>
From: David Thompson [mailto:<a href="mailto:david.thompson@kitware.com">david.thompson@kitware.com</a>]<br>
</span><div class="HOEnZb"><div class="h5">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">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">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">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">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">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">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">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">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">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">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/" rel="noreferrer" 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" rel="noreferrer" 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" rel="noreferrer" 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" rel="noreferrer" 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" rel="noreferrer" 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><br>
<br>
</div></div><br>_______________________________________________<br>
Smtk-developers mailing list<br>
<a href="mailto:Smtk-developers@smtk.org">Smtk-developers@smtk.org</a><br>
<a href="http://public.kitware.com/mailman/listinfo/smtk-developers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/smtk-developers</a><br>
<br></blockquote></div><br></div>