Set Map Extent Activity
I used Set map Extent activity after using Get feature set Extent activity (its output is envelope1), and in the extent argument, I used “envelope1.Expand(2)”, but when running the tool, an error that says ‘Object Reference not set to an instance of an object’. This is shown in the screenshots below What might be the problem here?
Regards,
Hani
1- Workflow
/customer/servlet/servlet.FileDownload?file=00P6000000em1fVEAQ
2- Set Map Extent
/customer/servlet/servlet.FileDownload?file=00P6000000elsoOEAQ
3- Error!!
/customer/servlet/servlet.FileDownload?file=00P6000000em1UGEAY
-
Set Return Geometry on your query task to True.
Check if your featureset contains features (featuresetvariable.Features.Any should be True).
I think you are querying a polygon layer, but if you are querying a point layer and get one point in the result, than you will not get an extent back (a point has no extent)
Specific on the error ‘Object Reference not set to an instance of an object’, it's because the envelope is nothing, you can check this (envelope1 Is Nothing should be false)
0 -
Hi Hani
are you sure that there are features selected? If no features are selected then you will have issues. Try having an Alert activity to tell you that there are features ie FeatureSetName.Features.Count.String in the Alert
If Activities get to be useful in these circumstances also.
If you do have features then how about getting some properties of the Envelope to see how big it is?
Regards
Ralph
0
Please sign in to leave a comment.
Comments
2 comments