McIDAS-V Support Forums

Support and discussion of the McIDAS-V software package
Forum HomeMcIDAS-V Home
It is currently 04 Aug 2020, 03:02

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: setLayerLabel with text from macro not editable
PostPosted: 09 Dec 2016, 10:31 
User avatar

Joined: 27 Nov 2010, 15:46
Posts: 490
Hi -
I am trying to write date/time information to the layer label in a jython module following the example in the User's Guide:
Code:
layer.setLayerLabel(%timestamp%)
However, I cannot save the code, because I am given a syntax error. Executing the command directly in the shell produces AttributeError. On the other hand, writing an explicit text string is fine. Looks like version 1.6 has the same problem. Can you reproduce it?
HP


Top
 Profile  
 
 Post subject: Re: setLayerLabel with text from macro not editable
PostPosted: 09 Dec 2016, 14:11 
User avatar

Joined: 15 Nov 2010, 17:57
Posts: 917
Hi HP -

Macros (including timestamp) must be included as part of a string, meaning you need quotes around them. For example:
Code:
layer.setLayerLabel('%timestamp%')

You can use macros in conjunction with other text strings, such as:
Code:
layer.setLayerLabel('%timestamp% - GOES East image')

Please let me know if you have any questions about this.

Thanks -
Bob Carp
McIDAS Help Desk


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group