[mapguide-users] IronPython - automate Maestro
Bart Oostdam
bart at giskit.nl
Wed Jul 24 07:16:17 PDT 2024
Hello Jackie,
Thank you very much for you answer. I will try to do what you suggest.
Indeed, I already guessed that the variable was ‘empty’ but it did not dawn on me why.
Met vriendelijke groet,
GISkit BV
Bart Oostdam
Van: mapguide-users <mapguide-users-bounces at lists.osgeo.org> Namens Jackie Ng via mapguide-users
Verzonden: woensdag 24 juli 2024 16:13
Aan: MapGuide Users Mail List <mapguide-users at lists.osgeo.org>
CC: Jackie Ng <jumpinjackie at gmail.com>
Onderwerp: Re: [mapguide-users] IronPython - automate Maestro
If you focus at this part of the error: NoneType has no attribute 'AddRule'
Then IronPython is really complaining about the expression:
vectorScaleRange.PointStyle
Which is just another way of saying that the vectorScaleRange has no actual point style because it is null (on in Python terminology: None)
ie. You are adding to a layer without a point style set on the given scale range
How can you rectify this? If this is the correct layer definition you intend to add a point rule to, then you should assign a point style if vectorScaleRange.PointStyle is None.
Where can you create a new point style? From the same place where you're creating point rules: The layer definition object itself.
- Jackie
You wrote:
Hello Jackie,
I ran into a problem trying your code.
This Line does not seem to work:
vectorScaleRange.PointStyle.AddRule(pointRule)
Error when running the code:
[cid:image001.png at 01DADDBD.2CF4D050<https://lists.osgeo.org/mailman/listinfo/mapguide-users>]
I ran a dir() on the vectorScaleRange variable and it shows no AddRule.
I will take a better look at the API documentation
[cid:image002.png at 01DADDBD.2CF4D050<https://lists.osgeo.org/mailman/listinfo/mapguide-users>]
Met vriendelijke groet,
GISkit BV
Bart Oostdam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapguide-users/attachments/20240724/c2377ba5/attachment.htm>
More information about the mapguide-users
mailing list