PDA

View Full Version : Help with Map Query (posted in Map forum also)


JeremiahM
2005-01-11, 11:18 PM
I work for an independent telephone co. I am trying to create a query in Map 3D that would prompt the user to select a service area, type in a pedestal number, and specify a radius around that pedestal to query in.

We have multiple service areas and many pedestal numbers are replicated in each. The service areas are defined by a boundary (Polyline) in Map and a field in our attached SQL database (links are already built). The pedestal number is a field in the SQL database linked to a block by a unique ID (via link template).

I know this can be done with a saved Map query and be run from a toolbar button.

Here is what I have so far...

(setq ade_cmddia_before_qry (getvar "cmddia"))
(setvar "cmddia" 0)
(ade_qryclear)
(ade_qrysettype "draw")
(ade_qrydefine '("" "" "" "Location" ("polyline" "polygon" "crossing" "?")""))
(ade_qrydefine '("AND" "" "" "SQL" ("JUNCTION_ID" "JUNCNAME = ")""))
(ade_qryexecute)
(setvar "cmddia" ade_cmddia_before_qry)

I think it would look like this...

1. Prompt to select boundary on screen (Location) or type name for (SQL)
2. Prompt for pedestal number (SQL) to retrieve linked BLOCK
3. Get x,y,z from insertion point of block and push to circle start point (Location)
4. Prompt for Radius of circle
5. Execute query.

Right now I am stuck on 2. I don't know how to get a prompt for the SQL so I can type in my pedestal number, everything I try to fake into the JUNCTION = (like '?' or blank) looks for that in the DB. I also know that number 3 is out of my league and it may take more than one query strung together.

If anyone can help that would be awesome, I am pretty sure a modification of this could be used for other applications, I know it can here.

Thanks a bunch,

Jeremiah

mjfarrell
2005-01-12, 01:38 AM
If you were to create a NODE type topology
as the resultant of the Pedestal Number response
that topology could be configured to always draw those
circles you are after at the node insertion point (x,y,z)


Or you could run an additional Report type query saving the
Pedestal x,y,z information to a text file that I think you
could access with lisp or VBA to draw the circles you are after.

Your cross posting via linking them is probably outside the
Forum guide lines, or is a clever way to circumvent them. ;)

MHultgren
2005-01-12, 03:14 PM
check out this LSP for starters C:\Program Files\Land Desktop (ver)\Sample\Database Connectivity\CAO\caotest.lsp then look at using these functions to access the data
The SQL environment functions begins with ade_sql or ade_key.

ade_keycolumnlist (mk:@MSITStore:C:Program%20FilesLand%20Desktop%20R2HelpAcMapAds.chm::/ade_keycolumnlist.htm)

Returns a list of the key column names for the specified link path name.

ade_sqlgetenvstring (mk:@MSITStore:C:Program%20FilesLand%20Desktop%20R2HelpAcMapAds.chm::/ade_sqlgetenvstring.htm)

Gets a string describing the SQL environment.

The functions for query management begin with ade_qry.

ade_qryclear (mk:@MSITStore:C:Program%20FilesLand%20Desktop%20R2HelpAcMapAds.chm::/ade_qryclear.htm)

Clears the current query.

ade_qrydefine (mk:@MSITStore:C:Program%20FilesLand%20Desktop%20R2HelpAcMapAds.chm::/ade_qrydefine.htm)

Defines a query.

ade_qryexecute (mk:@MSITStore:C:Program%20FilesLand%20Desktop%20R2HelpAcMapAds.chm::/ade_qryexecute.htm)

Executes the current query.

ade_qrygetcond (mk:@MSITStore:C:Program%20FilesLand%20Desktop%20R2HelpAcMapAds.chm::/ade_qrygetcond.htm)

Gets a query condition.

ade_qrygetdwgandhandle (mk:@MSITStore:C:Program%20FilesLand%20Desktop%20R2HelpAcMapAds.chm::/ade_qrygetdwgandhandle.htm)

Gets the source drawing ID and original handle of a queried object.

ade_qrygetentlist (mk:@MSITStore:C:Program%20FilesLand%20Desktop%20R2HelpAcMapAds.chm::/ade_qrygetentlist.htm)

Returns entity handles for objects that satisfy the current query.

ade_qrygetreptransform (mk:@MSITStore:C:Program%20FilesLand%20Desktop%20R2HelpAcMapAds.chm::/ade_qrygetreptransform.htm)

Checks whether transformation is enabled for the current report query.

ade_qrygroup (mk:@MSITStore:C:Program%20FilesLand%20Desktop%20R2HelpAcMapAds.chm::/ade_qrygroup.htm)

Groups query conditions.

ade_qryhandent (mk:@MSITStore:C:Program%20FilesLand%20Desktop%20R2HelpAcMapAds.chm::/ade_qryhandent.htm)

Gets the entity name for the specified handle.

ade_qrylist (mk:@MSITStore:C:Program%20FilesLand%20Desktop%20R2HelpAcMapAds.chm::/ade_qrylist.htm)

Lists the IDs of the current query conditions.

ade_qrysave (mk:@MSITStore:C:Program%20FilesLand%20Desktop%20R2HelpAcMapAds.chm::/ade_qrysave.htm)

Saves the current query.

ade_qrysetaltprop (mk:@MSITStore:C:Program%20FilesLand%20Desktop%20R2HelpAcMapAds.chm::/ade_qrysetaltprop.htm)

Turns property alteration on or off.

ade_qrysetcond (mk:@MSITStore:C:Program%20FilesLand%20Desktop%20R2HelpAcMapAds.chm::/ade_qrysetcond.htm)

Modifies a query condition.

ade_qrysetreptransform (mk:@MSITStore:C:Program%20FilesLand%20Desktop%20R2HelpAcMapAds.chm::/ade_qrysetreptransform.htm)

Enables or disables transformation for the current report query.

ade_qrysettype (mk:@MSITStore:C:Program%20FilesLand%20Desktop%20R2HelpAcMapAds.chm::/ade_qrysettype.htm)

Sets the query mode: Preview, Draw, or Report.

ade_qryungroup (mk:@MSITStore:C:Program%20FilesLand%20Desktop%20R2HelpAcMapAds.chm::/ade_qryungroup.htm)

Ungroups query conditions.