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 <[email protected]> Namens Jackie Ng 
via mapguide-users
Verzonden: woensdag 24 juli 2024 16:13
Aan: MapGuide Users Mail List <[email protected]>
CC: Jackie Ng <[email protected]>
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
_______________________________________________
mapguide-users mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/mapguide-users

Reply via email to