Maptitude - http://research.umbc.edu/~roswell/maptitude.html
Marjorie,
Thanx for taking care of uploading my mixlines.rsc program.
To clarify: the method for using mixlines is for you to create one or more
selection sets of lines from the same file and then use Tools-Export to
export them to several dbds and then use mixlines to combine them. I wrote
it for situations where the dbds were created at different times and
possibly by different people. The dbds don't have to be in any map because
the are read directly from disk. It uses the MergeGeography() function to
combine the files, and I notice that the input files can be dbd or cdf, so
it could be changed to allow both as input; for some reason (probably a
mistake) I set it up to only read dbds.
In any case I contributed it to encourage budding DK programmers to modify
it for your own use. You could make it use selection sets, etc., etc.
By the way, a convention I use that makes it a lot easier to set up and use
addins is to make the macro name the same as the file name, eg., macro
"mixlines" for mixlines.rsc. That way it is always clear how to set it up in
Tools-Addins-Setup. Remember also, that the immediate execution button in
the GISDK Toolbox is really great for debugging, testing and doing quick and
dirty programs. Make variables in an addin global and then you can see them
with the immediate execution button.
A couple of other DK tips:
I know Caliper doesn't "guarantee" that they work but I have found (in five
years of DK program and hundreds of addins) that single quotes always work
just fine for delimiting strings, eg., 'a string' rather than "a string".
It just makes typing that must easier.
------------------
Also, I disagree strongly with Caliper's style for indenting (which is
probably derived from the C world).
They write:
if x=y then do
(statements)
end
I write:
if x=y then do
(statements)
end
I find it much, much easier to insure that your ends match your ifs and
fors, etc., especially when they are nested 3 or 4 deep.
--------------------
ShowArray()--during development use lots of these and remember you can show
non arrays by just making them into an array,
eg., ShowArray({'test point 1', string1, string2})
--------------------
The thing that save me the most time is a text replacement utility called
ShortKeys from http://www.shortkeys.com/
I set up common things like dialog box items and GetNext loops with
abbreviations in ShortKeys and then just type the abbreviation to get a
bunch of code inserted.
I know editors can have macros to replace text but this utility works in all
environments and is especially good for filling in forms on the web.
Hope these help,
Larry Manire
-----Original Message-----
From: Marjorie Roswell [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 05, 2001 9:27 AM
To: maptitude
Subject: [Maptitude] Two new Maptitude utilities at directionsmag.com
Maptitude - http://research.umbc.edu/~roswell/maptitude.html
Larry's and Armando's utilities are now up on directionsmag.com, but still
in the "Newest Additions" section.
http://www.directionsmag.com/tools/default.asp?a=unapproved&title=Newest+Add
itions
I confess that I find Armando's utility to be easier to use. I think they
do two different things, but I'm not exactly sure of the difference.
Here's the best I'm able to determine.
CopyLines MixLines
Two files must be in same directory? No Yes
Two files must be in same map? Yes Yes
Source must be DBD file? No Yes
Target must be DBD file? Yes Yes
Must have same file structure? Yes Yes
Resource (.rsc) files are case-sensitive. So, it's "CopyLines," not
"copylines"
Here's Armando's blurb on CopyLines, since I have it handy.
Here is the macro to transfer lines from one layer to another.
I am including the code and a ZIP file with the Add-In.
Would you please pass the message to the list and upload it? (I am
reluctant to send attachments to a mailing list)
The name of the Add In is CopyLines (to be filled in the "Name" field
of the AddIn Setup Dialog Box)
Limitations:
- The target layer must be in the standard format.
- Both layers should be in the same map.
- only the geometry is copied, no attached data is passed to the new
layer. (this can be improved with little extra programming, let me know
if you need it and I will try to find some free time to add it)
Before running the Add-In you have to select the lines you want to
transfer in the source layer. After the seleection is made, run the add
in. A dialog box will ask you for the source and target layer as well
as the selection set.
Please let me know of any problems or bugs you encounter. Good Luck
Armando Scalise
=======================================
I have added some code to allow the CopyLine program to copy the
geography as well as the data.
I am including the compiled dbd, and the .rsc file.
I have not done extensive testing of this macro, so let me know if there
is any problem.
One note of caution: one choosing the field names to copy from one layer
to another, DO NOT INCLUDE ID, DIR and LENGTH. This might create
some problem, specillay the ID (not so sure about the other two).
Good luck
Armando Scalise
_________________________________________________________
Marjorie Roswell, Spatial Analyst
UMBC Center for Health Program Development and Management
1000 Hilltop Circle Fx: (410)455-6850
Baltimore, MD 21250 E: [EMAIL PROTECTED]
Ph: (410)455-6802 http://umbc.edu/~roswell/mipage.html
_________________________________________________________
______________________________________________________________________
To unsubscribe, write to [EMAIL PROTECTED]
______________________________________________________________________
To unsubscribe, write to [EMAIL PROTECTED]