|
6/6/2007 10:32:23 AM
|
|
Scripting question
|
I would like to be able to start scripting with Accuglobe 2007 but when I copied the Message Box sample script from the Accuglobe help file into the script editor dialog and executed it, it gave me the error summarized below. I was unsure if this was a bug or if I was doing something incorrectly. Can anyone tell me why the script is not working or what I can do to fix it? Thanks for anything you can tell me.
-Dustin
Could not load file or assembly IronPython, Version=1.0.60816.1877, Culture=neutral, PublicKeyToken=21bf3856ad364e35 or one of its dependencies. The located assemblys manifest destination does not match the assembly reference. (Exception from HRESULT 0x80131040).
Give a man a fish, feed him for a day. Teach a man to fish, feed him for a lifetime.
|
|
6/11/2007 7:24:19 AM
|
|
Unable to use Scripting feature
|
I have been unsuccessful at trying to use even the sample scripts for the Accuglobe help. Please see the "Scripting Question" post under General Questions.
Has anyone gotten any script to work in Accuglobe 07?
Give a man a fish, feed him for a day. Teach a man to fish, feed him for a lifetime.
|
|
9/12/2007 9:15:22 AM
|
|
Unable to use Scripting feature
|
I have started to get the scripting to work through the Web updates, however with the more detailed script Im having trouble getting it to execute completely.
The search box will pop up with my edited text, but when I actually hit the search button I get the following error.
DTMrSIDLayer has no attribute Records (more detailed description below)
Is this an error with the mapping engine or is there some omitted code that addresses this problem? Please comment. Thanks!
(I have a screenshot of the script and error if needed)
************** Exception Text ************** System.MissingMemberException: DTMrSIDLayer object has no attribute Records at IronPython.Runtime.Types.DynamicType.GetAttr(ICallerContext context, Object self, SymbolId name) at IronPython.Runtime.Operations.Ops.GetAttr(ICallerContext context, Object o, SymbolId name) at buttonPressed$f7##64(FunctionEnvironment4Dictionary , Object , Object , Object ) at IronPython.Runtime.Calls.Function3.Call(ICallerContext context, Object arg0, Object arg1, Object arg2) at IronPython.Runtime.Calls.Function3.Call(ICallerContext context, Object[] args) at IronPython.Runtime.Calls.PythonFunction.CallInstance(ICallerContext context, Object instance, Object[] args) at IronPython.Runtime.Calls.Method.Call(ICallerContext context, Object[] args) at IronPython.Runtime.Operations.Ops.Call(Object func, Object[] args) at IronPython.Runtime.Types.ReflectedEvent.EventDispatcher.Call(Object[] args) at IronPython.Runtime.Operations.Ops.Call(Object func, Object[] args) at IronPython.Runtime.Operations.Ops.Call(Object func, Object arg0, Object arg1) at System.Void(Object, EventArgs)##39(Object , Object , EventArgs ) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Give a man a fish, feed him for a day. Teach a man to fish, feed him for a lifetime.
|
|
9/12/2007 11:59:56 AM
|
|
Unable to use Scripting feature
|
Thank you very much for your prompt reply. That was a helpful bit of information. I actually was able to get the script to run properly (for returning a record result).
Following the instructions in the help file I changed the line layer.ExecuteRecordsQuery(oQuery) to layer.ExecuteSelectionQuery(oQuery) to allow the result to be selected. After the box pops up showing how many records are being searched, an error displays that exactly 3 arguments are needed but only 1 is provided. Also, is there an alternative to using the layer index, such as using a layer name or the active layer of the map?
Thanks again.
Give a man a fish, feed him for a day. Teach a man to fish, feed him for a lifetime.
|
|
9/13/2007 9:40:45 AM
|
|
Object model for Python Scripting
|
I saw the previous post regarding this question from back in November of last year. Is there any progress toward documentation of available objects in the mapping engine?
Thanks
Give a man a fish, feed him for a day. Teach a man to fish, feed him for a lifetime.
|
|
9/13/2007 2:55:34 PM
|
|
Zoom to Selected features does not work
|
I was using the button to zoom to selected features when I noticed that it does not really zoom. It actually only pans to the feature (at your current zoom scale), making the center of the display. Im surprised this has not come up in the forum before. Are you aware of this issue?
Thanks [|)]
Give a man a fish, feed him for a day. Teach a man to fish, feed him for a lifetime.
|
|
9/14/2007 9:41:02 AM
|
|
Zoom to Selected features does not work
|
For my practical application I will only be searching for and selecting one point at a time. All I know is, when I open my project and select a point, even when I zoom to it I have trouble finding it because of the scale of the map and the point density. I suppose I could just change the selection preferences to be a larger symbol.
Thanks for your response.
Give a man a fish, feed him for a day. Teach a man to fish, feed him for a lifetime.
|
|
9/14/2007 3:02:42 PM
|
|
Add a Logical Filter to feature selection script
|
I want to add a "Logical" filter to my selection script. I see that the Predicate filter gets its name from the Select by Attributes window (i.e. oFilter.Predicate = Predicate.Like). I tried something like oFilter.Logical = Logical.And but this did not work because I supposed Im not calling it up properly. Is there a different way to type this?
Thanks again.
Give a man a fish, feed him for a day. Teach a man to fish, feed him for a lifetime.
|
|
9/14/2007 5:26:04 PM
|
|
Add a Logical Filter to feature selection script
|
Thanks for your help. I believe Im really very close to getting this to work the way I want it to. Is AddFilter a valid attribute? Im trying to use it against the DTQuery() and its reporting that there is no AddField attribute. If its not too much trouble could you point out what I need to do to get this to work? I have the pertinent section of code below. DTQuery will only take 1 argument and I dont want to create 2 queries. Im sure Im just missing something. Id appreciate anything you could tell me.
def buttonPressed(self, sender, args): layer = ActiveMap.Layers.Item(61) oFilter = DTFilter() oFilter.LeftOperand = INTNAME oFilter.Predicate = Predicate.Like oFilter.RightOperand = "%%"+self.text.Text pFilter = DTFilter() pFilter.LogicalOperation.And pFilter.LeftOperand = INTNAME pFilter.Predicate = Predicate.Like pFilter.RightOperand = "%%"+self.text2.Text Query1 = DTQuery(oFilter)
oRecords = DTRecords() oRecords = layer.ExecuteSelectionQuery(Query1, True, True)
Give a man a fish, feed him for a day. Teach a man to fish, feed him for a lifetime.
|
|
9/17/2007 9:16:16 AM
|
|
Add a Logical Filter to feature selection script
|
Wow, thanks for your great postings. I will begin implementing your suggestions. I do believe I will still get search results however because both street names are in the INTNAME field. Im using the wildcards to make the dialog box more user friendly so the individuals can just type the name of the street without direction prefixes. Through testing Ive noticed that % = 1 character but %%=multiple characters.
Give a man a fish, feed him for a day. Teach a man to fish, feed him for a lifetime.
|
|
9/17/2007 9:23:40 AM
|
|
Add a Logical Filter to feature selection script
|
error message on execute:
DTQuery object has no attribute AddFilter
Give a man a fish, feed him for a day. Teach a man to fish, feed him for a lifetime.
|
|
10/1/2007 3:16:02 PM
|
|
Script Toolbar Error
|
I also have interest in the results from your testing as I have had the same issue. Have you been able to recreate this problem or do you have a fix in the works?
Thanks
Give a man a fish, feed him for a day. Teach a man to fish, feed him for a lifetime.
|
|
10/2/2007 9:55:59 AM
|
|
Question regarding the sample scripts...
|
How does one change the active layer in the script to recognize a filename or layer name as opposed to the layers position in the index?
Give a man a fish, feed him for a day. Teach a man to fish, feed him for a lifetime.
|
|
11/5/2007 3:06:52 PM
|
|
Question regarding the sample scripts...
|
Dave,
Just wanted to say thanks for your recent responses over the past month. This is the first time Ive visited the forum in a while. I appreciate your time and effort in helping us work through the issues weve had.
Give a man a fish, feed him for a day. Teach a man to fish, feed him for a lifetime.
|
|
11/21/2007 10:29:08 AM
|
|
Script Toolbar Button errors
|
The most recent update addressed the issue that gave an error when you reopened a project that had been saved with a script button on the toolbar.
A new issue has surfaced where buttons are duplicated on the toolbar when more than one button is added. The easiest way to recreate this is to add 3 buttons in one project session. When the 3rd button is added, the 2nd button duplicates (leaving you with 4 buttons on your toolbar). Even if youre placing 2 buttons on the toolbar, the next time you open your project, at least one duplicate will show. The more buttons you add, the more the problem persists. For me to add 5 scripts, I ended up with 9 buttons. Opting to remove certain ones from the toolbar seems to fix the problem, but when the project is reopened, those settings are mixed up as well and some of the buttons you removed from the view might display.
I know the description was a bit lengthy, but I hope it points you in the right direction. Thanks for your help and happy Thanksgiving.
Give a man a fish, feed him for a day. Teach a man to fish, feed him for a lifetime.
|
|
2/21/2008 12:48:02 PM
|
|
Usable Scripts?
|
Jozed,
We experienced problems running our scripts after the most recent update. It appears that the IronPython.DLL file bundled in the installation is no longer the correct version to use.
We found the version Accuglobe was calling for here: [url]http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=423
Click on the IronPython-1.0.zip to download it and then extract the IronPython.dll AND the IronMath.dll to your root Accuglobe folder (i.e. C:\Program Files\DDTI\AccuGlobe 2007\) making sure to replace the existing file. That should take care of that pesky error.
Regards...
Give a man a fish, feed him for a day. Teach a man to fish, feed him for a lifetime.
|
|
1
|