autocad map 3d 2009 autolisp reference - … map 3d 2009 autolisp reference ... , map plotting, and...
TRANSCRIPT
AutoCADMap3D2009AutoLISPReference071020
AutoCADMap3DAutoLISPfunctionscoverdataextension(drawingsets,queries,objectdata...the"ADE"functionality),mapplotting,andtopology.
ForbroadercoverageofAutoCADMap3Dfunctionality,usethe.NETAPI,whichisincludedintheAutoCADMap3DSDK.TheSDKisaseparateinstallationfromAutoCADMap3Ditself.YoucandownloaditfromtheAutodeskwebsite.
NoteTheAutoLISPAPIremainsavailabletosupportlegacyapplicationsthatuseit.Forallnewdevelopment,the.NETAPIisthebestchoice.
TodownloadtheAutoCADMap3DSDK
1. OpentheAutodeskHomePage(itopensinanewwindow)andclickSearch.
2. Searchfor"ObjectARXforAutodeskMap3D".3. Click"DeveloperCenter-ObjectARXforAutodeskMap3D".4. Click"LicenseAndDownload".
ThreeFunctionalGroups
AutoCADMapAutoLISPcomprisesthreefunctionalgroups:
DataExtensionFunctionsPlottingFunctionsTopologyFunctions
BeforeYouBegin
TodevelopAutoLISPapplicationsforAutoCADMap,youshouldbefamiliarwithAutoCAD,theAutoCADMapuserinterface,andtheAutoLISPAPIforAutoCAD.
RelatedTopics
UsingAutoLISPFunctionsNumericIdentifiersTypographicConventions
What'sNew
NonewfeaturesorenhancementshavebeenaddedtoAutoLISPforAutoCADMap3D2008.
DataExtensionFunctionCatalogFunctionSynopsis
DataExtensionfunctionslistedalphabetically.
alias|altp|ds|dwg|edit|ent|err|expr|key|od
os|pref|proj|ql|qry|rt|save|sql|ss|user|ver
ade_aliasaddade_aliasdeleteade_aliasgetlistade_aliasupdate
ade_altpclearade_altpdefineade_altpdelpropade_altpgetpropade_altplistade_altpsetprop
ade_dsattachade_dsdetachade_dsisnestedade_dslistade_dsproplist
ade_dwgactivateade_dwgactualpathade_dwgaliaspathade_dwgattriblistade_dwgdeactivateade_dwggetidade_dwggetsetting
ade_dwghaslocksade_dwgindexade_dwgindexdefade_dwgisactiveade_dwgistoplevelade_dwgproplistade_dwgquickviewade_dwgselectdlgade_dwgsetofade_dwgsetsettingade_dwgunlockade_dwgzoomextents
ade_editdefcenade_editlockederasedade_editislockedade_editlockedade_editlockobjsade_editnewade_editunlockobjs
ade_entsetlocation
ade_errclearade_errcodeade_errgetlevelade_errmsgade_errpushade_errpushstatementade_errqtyade_errsetlevelade_errshowdlgade_errstatementade_errtype
ade_expreval
ade_keycolumnlist
ade_odaddfield
ade_odaddrecordade_odattachrecordade_oddefinetabade_oddeletefieldade_oddeletetabade_oddelrecordade_odfreerecade_odgetfieldade_odgetrecfieldade_odgetrecordade_odgettablesade_odmodifyfieldade_odmodifytabade_odnewrecordade_odpresetfieldade_odrecordqtyade_odsetfieldade_odtabledefnade_odtablelist
ade_osfexpand
ade_prefgetvalade_prefsetval
ade_projgetctgynameade_projgetinfoade_projgetwscodeade_projlistcrdsystsade_projlistctgyade_projptbackwardade_projptforwardade_projsetdestade_projsetsrcade_projsetwscode
ade_qldelctgyade_qldelqueryade_qlgetctgyinfo
ade_qlgetqryinfoade_qllistctgyade_qlloadqryade_qlqrygetidade_qlsetctgynameade_qlsetquery
ade_qryclearade_qrydefineade_qryexecuteade_qrygetcondade_qrygetdwgandhandleade_qrygetentlistade_qrygetreptransformade_qrygroupade_qryhandentade_qrylistade_qrysaveade_qrysetaltpropade_qrysetcondade_qrysetreptransformade_qrysettypeade_qryungroup
ade_rtdefrangeade_rtdeltableade_rtgetidade_rtgetpropade_rtlist
ade_saveobjsade_savetodwg
ade_sqlgetenvstring
ade_ssfree
ade_usergetade_usergetrightsade_userlist
ade_usersetade_usersetrights
ade_version
DataExtensionFunctionSynopsisFunctionCatalog
DataExtensionfunctionslistedbyfunctionalgroup.
CoordinateTransformationFunctions
DrawingFunctions
DrawingSetFunctions
DriveAliasFunctions
ErrorMessageFunctions
ExpressionEvaluationFunction
ObjectDataFunctions
ObjectEditingFunctions
ObjectSavingFunctions
OptionFunctions
PropertyAlterationFunctions
QueryFunctions
QueryLibraryFunctions
RangeTableFunctions
SQLEnvironmentFunctions
TextLabelFunction
UserSecurityFunctions
OtherFunctions
PlottingFunctionCatalogFunctionSynopsis
Plottingfunctionslistedalphabetically.
dwg|plt|topo
map_dwgbreakobjmap_dwgtrimobj
map_pltblkattsmap_pltblklistmap_pltblkvpsmap_pltcleanupmap_pltcurrdefmap_pltcurrdelmap_pltcurrgetmap_pltcurrsavemap_pltcurrsetmap_pltdefdeletemap_pltdefgetmap_pltdeflistmap_pltdefreadmap_pltdefsavemap_pltdefvalidmap_pltdefverifymap_pltdisplaymap_pltexecutemap_pltinitmap_pltplotmap_pltrestore
map_topoauditmap_topoclosemap_topocompletemap_topostat
PlottingFunctionSynopsisFunctionCatalog
Plottingfunctionslistedbyfunctionalgroup.
BoundaryFunctions
PlottingFunctions
TopologyFunctions
TopologyFunctionCatalogFunctionSynopsis
Topologyfunctionslistedalphabetically.
ac|ana|clean|edit|elem|info|iter|mnt|qry|trace|var
tpm_acclosetpm_acexisttpm_acloadtpm_acopentpm_acqtytpm_acunloadtpm_acupgradeopen
tpm_anabuffertpm_anadissolvetpm_anaoverlay
tpm_cleanactionlistdeltpm_cleanactionlistgetattpm_cleanactionlistinstpm_cleanactionlistqtytpm_cleanalloctpm_cleananchorsstpm_cleancanceltpm_cleancompletetpm_cleancreatedsstpm_cleanendtpm_cleanerrorcurtpm_cleanerrordrawtpm_cleanerrorfix
tpm_cleanerrorgettpm_cleanerrormarktpm_cleanerrorsettpm_cleanfreetpm_cleangroupdrawtpm_cleangroupfixtpm_cleangroupmarktpm_cleangroupnexttpm_cleangroupqtytpm_cleangroupsubtypetpm_cleangrouptypetpm_cleanincludesstpm_cleaninittpm_cleaninitanchorsettpm_cleanmodifiedsstpm_cleanprofileloadtpm_cleanprofilesavetpm_cleanstarttpm_cleanunchangedss
tpm_editaddelemtpm_editdelelemtpm_editmodelemtpm_editupdelem
tpm_elemadjtpm_elemfindtpm_elemgettpm_elemidtpm_elemqtytpm_elemss
tpm_infobuildvartpm_infocompletetpm_infocorrecttpm_infocurrenttpm_infodesctpm_infomodifiedtpm_infoname
tpm_infostatustpm_infotypetpm_infoversion
tpm_iterdesctpm_iternametpm_iternexttpm_iterstarttpm_iterstoptpm_itertypetpm_iterversion
tpm_mntbuildtpm_mnterasetpm_mntrebuildtpm_mntrename
tpm_qrygetresdesctpm_qrygetrestopotpm_qrygettoponametpm_qrysetrestopotpm_qrysettoponame
tpm_tracealloctpm_tracebestroutetpm_tracebestroutescantpm_tracebestroutevaltpm_traceelemedittpm_traceelemgettpm_traceelemidtpm_tracefloodtpm_tracefreetpm_traceqtytpm_tracesetmaxrestpm_tracesetminrestpm_traceshorttpm_traceshortscantpm_traceshortval
tpm_varalloc
tpm_varfreetpm_vargettpm_varlisttpm_varset
TopologyFunctionSynopsisFunctionCatalog
Topologyfunctionslistedbyfunctionalgroup.
AccessFunctions
AnalyzingFunctions
BuildingandErasingFunctions
CleanupFunctions
EditingFunctions
ElementInformationFunctions
IteratingFunctions
NetworkTracingFunctions
TopologyInformationFunctions
TopologyQueryFunctions
TopologyVariablesFunctions
ConfigurationVariables
Configurationvariablesincludethreesubsets:
Cleanupvariables,propertiesforcleanupmodels.
Cleanupactionvariables,propertiesforcleanupactions.
Topologyvariables,propertiesfortopologies.
Toallocateasetofconfigurationvariables,regardlessofwhichsubsetyouwillbeusing,usetpm_varalloc,whichreturnsanade_idforthesetthatitcreates.
Tofreeasetofconfigurationvariables,usetpm_varfree.
Togetthevalueofaconfigurationvariable,usetpm_varget.
Tosetthevalueofaconfigurationvariable,usetpm_varset.
Togetthepropertiesofagivencleanupaction,firstallocateanewsetofvariables,andthenusetpm_cleanactionlistgetat.
Togetthepropertiesofagiventopology,firstallocateanewsetofvariables,andthenusetpm_infobuildvar.
Tolistallthevaluesofagivensetofvariables,usetpm_varlist.
TopologyVariables
Topologyvariablesstorepropertiesfortopologies,whicharecreatedbytpm_mntbuildandthetopologyanalysysfunctions,tpm_ana[xx].
Topologyvariablesareasubsetoftheconfigurationvariablesdatastructure.
BUILD_TOL Tolerancefortopologybuilding,buffering,andotherprocesses(positivereal).Default=0.01
CNTR_COLOR Colorfornewcentroids,anAutoCADcolorindex(integer).Negativeinteger=CurrentcolorDefault=-1SeeColorIndexColors.
CNTR_LAYER Layernamefornewcentroids(string).nil=CurrentlayerDefault=""
CNTR_TYPE Entitytypeofnewcentroids(integer).1=Point(default)
2=Block
CNTR_BLOCK Blocknamefornewcentroids(string).Default=""
CREATE_CNTR Flagforcentroidsgeneration(integer).1=Generate(default)0=Donotgenerate
CREATE_MARKERS Whethererrorsshouldbemarkedwithpersistentmarkersasdrawnbytpm_cleanerrormark(integer).0=Donotmark(default)1=MarkMarkershapesaresetbyMARKER_HEIGHTandthe[XX]_MARKERcleanupvariables.
CREATE_NODE Flagfornodesgeneration(integer).1=Generate(default)0=Donotgenerate
CREATE_VIEW Whethererrorsshouldbemarkedwithtemporarymarkersasdrawnbytpm_cleanerrordraw0=Donotmark1=Mark(default)
DEF_OFFSET Defaultoffset(real).
Usewhenoffsetvaluecannotbecalculatedforanobject,forexample,iftheobjectlacksnecessaryobjectdata.Default=1.0
DUPLICATE_CENTROID_COLOR Markercolorforduplicatecentroiderrors,anAutoCADcolorindex(integer).Default=1(red)SeeColorIndexColors.
DUPLICATE_CENTROID_MARKER Markershapeforduplicatecentroiderrors(integer).SeeMarkerShapes.Default=4(square)
IGNORE_INCOMPLETE_AREA Whattodoiflinksareencounteredthatdonotbelongtoanypolygon(integer).1=Ignorethem0=Canceltopologycreationprocess(default)
INCOMPLETE_AREA_COLOR Markercolorforincompleteareaerrors,anAutoCADcolorindex(integer).Default=2(yellow)SeeColorIndexColors.
INCOMPLETE_AREA_MARKER Markershapeforincompleteareaerrors(integer).SeeMarkerShapes.Default=2(triangle)
INTERSECTION_COLOR Markercolorforintersection
errors,anAutoCADcolorindex(integer).Default=3(green)SeeColorIndexColors.
INTERSECTION_MARKER Markershapeforintersectionerrors(integer).SeeMarkerShapes.Default=1(octagon)
MISSING_CENTROID_COLOR Markercolorformissingcentroiderrors,anAutoCADcolorindex(integer).Default=4(cyan)SeeColorIndexColors.
MISSING_CENTROID_MARKER Markershapeformissingcentroiderrors(integer).SeeMarkerShapes.Default=3(rhombus)
NODE_BLOCK Blocknamefornewnodes(string).Default=""
NODE_COLOR Colorfornewnodes,anAutoCADcolorindex(integer):Negativeinteger=ThecurrentcolorDefault=-1SeeColorIndexColors.
NODE_LAYER Layernamefornewnodes(string):nilThecurrentlayerDefault=""
NODE_TYPE Entitytypeofnewnodes(integer):1Point(default)2Block
STOP_AT_MISSING_CNTR Whattodoifapolygonhasnocentroid(integer):0Createacentroid(default)1Canceltopologycreationprocess
STOP_AT_MULTIPLE_CNTR Whattodoifapolygonhasmorethanonecentroid(integer):0Designateonecentroid1Canceltopologycreationprocess(default)
CleanupVariables
Cleanupvariablesstorepropertiesforcleanupmodels.
Cleanupvariablesareasubsetoftheconfigurationvariablesdatastructure.
NoteDatatypescitedbelowareAutoLISPtypes.TheAutoLISPrealcorrespondstotheC++double.Similarly,integercorrespondstolong.
ANCHOROBJS_FEATURES !!New!!Classifiedobjectstoinclude,acomma-separatedlistoffeaturenames(string),suchas"Roads,Rivers,Streets".Default="*"(allfeatures).
ANCHOROBJS_LAYERS Anchoredentitiesspecifiedbytpm_cleaninitanchorsetwillbeanchoredonlyiftheyresideonlayersspecifiedhere,withmultiplelayernamesseparatedbycommas.Forexample,"0,Layer1,Layer2".Default="*"(anylayer)
APPARENT_INTERSECTION_COLOR !!New!!Colorforapparent-intersectionmarkers,anAutoCADcolorindex(integer).SeeColorIndexColors.Default=7(white)
APPARENT_INTERSECTION_MARKER !!New!!Markershapeforapparent-intersectionerrors(integer).SeeMarkerShapes.Default=2(triangle)
ARC_TYPE Convertarcsto(integer):0=Arc(default)1=2Dpolyline
CIRCLE_TYPE Convertcirclesto(integer):0=Circle(default)1=2Dpolyline2=Arc
CLEAN_TOL Cleanuptolerance(positivereal).Default=0.01
CLUSTER_COLOR Colorforclustermarkers,anAutoCADcolorindex(integer).SeeColorIndexColors.Default=5(blue)
CLUSTER_MARKER Markershapeforclustererrors(integer).SeeMarkerShapes.Default=4(square)
CONVERT Flagfortheoriginalentitiesconversion(integer).0=Donotconvert(default)1=Convert
CORRIDOR Corridorwidth(positivereal).Default=0.01NoteIfyouareusinganexplicitcleanupactionlist(specifyingcleanupactionsusingtpm_cleanactionlistins),thissettingisignored.
CROSS_COLOR Colorforcrossmarkers,anAutoCADcolorindex(integer).SeeColorIndexColors.Default=2(yellow)
CROSS_MARKER Markershapeforcrosserrors(integer).SeeMarkerShapes.Default=1(octagon)
DANGL_COLOR Colorfordanglingnodemarkers,anAutoCADcolorindex(integer).SeeColorIndexColors.Default=1(red)
DANGL_MARKER Markershapefordanglingnodeerrors(integer).SeeMarkerShapes.
Default=1(octagon)
DEL_MARKER Whethertodeletepreviouserrormarkers(integer).0=Donotdelete1=Delete(default)
DUPL_COLOR Colorforduplicatesmarkers,anAutoCADcolorindex(integer).SeeColorIndexColors.Default=6(magenta)
DUPL_MARKER Markershapeforduplicateerrors(integer).SeeMarkerShapes.Default=1(octagon)
ENT_PROCESS Flagfororiginalentitiesprocessing(integer).1=Convertoriginal2=Createnewandkeeporiginal3=CreatenewanddeleteoriginalDefault=0
GENERALIZE Flagforgeneralization(linksimplication)(integer).0=Donotgeneralize(default)1=GeneralizeNoteIfyouareusinganexplicitcleanupactionlist(specifyingcleanupactions
usingtpm_cleanactionlistins),thissettingisignored.
INCLUDE_LINEAROBJS !!New!!Whethertoincludelinearobjectswhiledeletingduplicates(integer).0=Donotinclude.1=Include.Default=1.
INCLUDE_POINTS !!New!!Whethertoincludepointswhiledeletingduplicatesorsnappingclusterednodes(integer).0=Donotinclude.1=Include.Default=1.
INCLUDE_BLOCKS !!New!!Whethertoincludeblockswhiledeletingduplicatesorsnappingclusterednodes(integer).0=Donotinclude.1=Include.Default=0.
INCLUDE_TEXT !!New!!Whethertoincludetextwhiledeletingduplicates(integer).0=Donotinclude.1=Include.Default=0.
INCLUDE_MTEXT !!New!!Whethertoincludemtextwhiledeletingduplicates(integer).0=Donotinclude.1=Include.Default=1.
INCLUDE_ROTATION !!New!!Whethertoincluderotationwhiledeletingduplicates(integer).0=Donotinclude.1=Include.Default=0.
INCLUDE_ZVALUES !!New!!Whethertoincludez-valueswhiledeletingduplicates(integer).0=Donotinclude.1=Include.Default=0.
SNAP_TO_NODE !!New!!Whethertosnaptonodesorlinks(integer).0=Snaptonodes.1=Snaptolinks.Default=0.
INCLUDEOBJS_AUTOSELECT Howentitiesarespecifiedforcleanup0=Selectentitiesmanually(thatis,bypassinga
selectionsettotpm_cleaninit)1=Selectallentitiesinthedrawing(inwhichcasetheselectionsetpassedtotpm_cleaninit,ifany,isignored)
INCLUDEOBJS_FEATURES !!New!!Classifiedobjectstoinclude,acomma-separatedlistoffeatures(string),suchas"Roads,Rivers,Streets".Default="*"(allfeatures).
INCLUDEOBJS_LAYERS Entitiesspecifiedbytpm_cleaninitwillbecleanedonlyiftheyresideonlayersspecifiedhere,withmultiplelayernamesseparatedbycommas.Forexample,"0,Layer1,Layer2".Default="*"(anylayer)
LINE_TYPE Convertlinesto(integer)0=Line(default)1=2Dpolyline
LINK_COLOR Colorfornewlinks,anAutoCADcolorindex(integer).SeeColorIndexColors.Negativeinteger=Currentcolor
Default=-1
LINK_CORRECT Flagforlinkerrorcorrection(integer).0=Donotcorrect1=Correct(default)NoteIfyouareusinganexplicitcleanupactionlist(specifyingcleanupactionsusingtpm_cleanactionlistins),thissettingisignored.
LINK_ERROR Linkerrortypes(integer),sumofthedesiredoptions.0=None1=Short2=Cross4=Undershoot8=DuplicateDefault=15
LINK_LAYER Layernamefornewlinks(string).nil=CurrentlayerDefault=""
MAINTAIN_MARKERS Flagtomaintainmarkerswhencleanupends0=Donotmaintain1=MaintainmarkersThisvariableaffectsonlyerrorsthathavenotbeenfixed.Ifanerrorhasbeenfixed,itsmarkerisdeletedattheendofthecleanup
processnomatterwhat(bytpm_cleanend).
MARKER_HEIGHT Theheightoferrormarkers,apercentofscreenheight(positivereal).Default=5.0
NODE_CORRECT Flagfornodeerrorcorrection(integer).0=Donotcorrect1=Correct(default)NoteIfyouareusinganexplicitcleanupactionlist(specifyingcleanupactionsusingtpm_cleanactionlistins),thissettingisignored.
NODE_ERROR Nodeerrortypes(integer),sumofthedesiredoptions. 0=None16=Cluster32=Pseudo64=DanglingDefault=48
POLY3D_TYPE Convert3Dpolylinesto(integer).0=3Dpolyline(default)1=2Dpolyline
PSEUDO_COLOR Colorforpseudonodemarkers,anAutoCAD
colorindex(integer).SeeColorIndexColors.Default=6(magenta)
PSEUDO_MARKER Markershapeforpseudonodeerrors(integer).SeeMarkerShapes.Default=2(triangle)
SHORT_COLOR Colorforshortmarkers,anAutoCADcolorindex(positiveinteger).SeeColorIndexColors.Default=1(red)
SHORT_MARKER Markershapeforshorterrors(integer).SeeMarkerShapes.Default=1(octagon)
UNDER_COLOR Colorforundershootmarkers,anAutoCADcolorindex(integer).SeeColorIndexColors.Default=3(green)
UNDER_MARKER Markershapeforundershooterrors(integer).SeeMarkerShapes.Default=1(octagon)
WEED_DISTANCE !!New!!Weedingdistance(real).Default=15.0
WEED_ANGLE !!New!!Weeddistance
(real).Default=4.0
WEED_SUPPLEMENT_DISTANCE !!New!!Weedsupplementdistance(real).Default=100.0
WEED_SUPPLEMENT_BULGE !!New!!Weedsupplementbulge(real).Default=1.0
CleanupActionVariables
Cleanupactionvariablesstorepropertiesforcleanupactions,whichareassignedtoactionlistsbytpm_cleanactionlistins.
Actionlistsareafeatureofcleanupmodels.Cleanupactionvariablesareasubsetoftheconfigurationvariablesdatastructure.
ARC_TYPE WiththeSimplifyObjectscleanupaction(cleangrouptype128)only,whethertocreatearcs(integer).1=Createarcs(default)0=DonotcreatearcsForanyactionotherthan128,SimplifyObjects,ARC_TYPEdoesnotmatter.
CLEAN_TOL Cleanuptolerance(positivereal).Default=0.01CLEAN_TOLaffectsthefollowingactionsonly:8=DeleteDuplicates1=EraseShortObjects4=ExtendUndershoots16=SnapClusteredNodes64=EraseDanglingObjects128=SimplifyObjectsWiththefollowingactions,theCLEAN_TOLvaluedoesnotmatter:2=BreakCrossingObjects
32=DissolvePseudoNodes256=ZeroLengthObjects
CONVERT WiththeExtendUndershootscleanupaction(cleangrouptype4)only,whethertobreakthetargetobject(insertanewnode)wheretheextendedundershootintersectsit(integer).1=Breaktarget(default)0=DonotbreaktargetForanyactionotherthan4,ExtendUndershoots,CONVERTdoesnotmatter.
ErrorCodes
ThefollowingerrorscodesarenativetoAutoCADMap.
Customapplicationscandefinetheirownerrorcodes.Seeade_errpush.
Youcangetanerror'serrorcodebypassingitsstackindex(0=firsterror)toade_errcode.
ErrorCodeIndex
�15 1200 2000 2500 3000
0 1300 2100 2600 3100
200 1500 2200 2700 3200
1000 1800 2300 2800 4000
1100 1900 2400 2900
Expression
�15 kErrXEDValueFail Internalerror
�14 kErrRngTabEvalFail Internalerror
�13 kErrNoRngTabFound Internalerror
�12 kErrNoRngTabLibFound Internalerror
�11 kErrLispValueFail Internalerror
�10 kErrGetAttrFail Internalerror
�09 kErrGetSQLFail Internalerror
�08 kErrGetEEDFail Internalerror
�07 kErrInvalidProperty Internalerror
�06 kErrExpInvalidOperand Internalerror
�05 kErrExpADS Internalerror
�04 kErrExpNoMemforOperand Internalerror
�03 kErrExpMathOverFlow Internalerror
�02 kErrExpInvalidOper Internalerror
�01 kErrExpSyntaxErr Internalerror
FormoreExpressionerrors,whichbeginat2900,click .
CommonUsage
00 kAdeOk GeneralADEreturnvalue:calltoADEobjectissuccessful
01 kAdeErr GeneralADEerror:calltoADEobjectisnotsuccessful
02 kAdeBadInput Invalidfunctionargument
03 kAdeObjectNotFound
04 kAdeOutOfMemory
05 kAdeObjNotInitialized
06 kAdeWrongType
07 kAdeWrongProject
08 kAdeEOB
09 kAdeADSError Invalidfunctionargumenttype
10 kAdeAdsNameConvertionFails
11 kAdeWrongArgument
12 kAdeWriteBufFails
13 kAdeReadBufFails
14 kAdeXDataCorrupted
15 kAdeNoEnvironment
16 kAdeUsrBreak
17 kAdeUncomparable
18 kAdePermissionDenied Nopermissiontoperformsomeaction.Whenusingthefollowingcommands,themessagehasdifferentmeanings:ADESAVEOBJS=Can'tbeexecutedindemonstrationmode;ADEDRAWINGS=Userhasnorightstoupdatetheset;ADESELOBJS,ADDREMOBJS=Userhasnorightstoedit;ADEDWGMAINT=Userneedstobesuperusertoremovetheforeignlocks;MAPOPTIONS:SystemPreferences=Can'tset"ForceUserLogin"flagandchange"ObjectLocking"flagifdrawingsetcontainsactiveorlockeddrawings.Deactivateorunlockthedrawingsbeforetryingtosetthesepreferences.
19 kAdeWrongSyntax
20 kAdeDuplicate
21 kAdeInvalidPathOrFileName
22 kAdeInvalidVersion
23 kAdeFileIOFatalError
ExternalSubsystems
200 kAdeAcDbError
201 kAdeIRDNotInitialized
202 kAdeIRDError
203 kAdeASENotInitialized
204 kAdeASEError
205 kAdeASIError
206 kAdeAsiNotInitialized
207 kAdeAsiConnectToEnvironmentFailed
TransactionalManager
1000 kErrClosed RepeatedattemptstoclosepreviouslyclosedADEobject.Callsupport.
1001 kErrWasErased AttempttoworkwitherasedADEobject.Callsupport.
1002 kErrOpenForRead AttempttoupdateADEobjectsopenedforread.Callsupport.
1003 kErrOpenForWrite AttemptstogetmultipleaccesstoADEobjectopenedforwrite.Callsupport.
1004 kErrWrongMode IncorrectmodeoftheADEobjectsshouldbe
opened.Callsupport.
1005 kErrClone ExceptionatthetimeofcloningADEobjects.Callsupport.
1006 kErrResponse IncorrectattempttostartADEtransaction.Callsupport.
1007 kErrObjIsAbsent AttempttoworkwitherasedADEobject.Callsupport.
1008 kErrAccess TypeofworkwithADEdoesnotcorrespondtoitsstatus.Callsupport.
1009 kErrMultipleUsage AttemptstogetmultipleaccesstoADEobjectopenedforwrite.Callsupport.
1010 kErrUpgrade IncorrectattempttoupdateopeningmodeoftheADEobject.Callsupport.
1011 kErrNotClosed ObjectwasnotclosedduringcurrentADEtransaction.Callsupport.
CAdeList
1100 kAdeGetIteratorFails
1101 kAdeListIsEmpty
CAdeListIterator
1102 kErrListEnd
1103 kErrListObjectIsAbsent
Drawing
1200 kAdeQueriedEntity Ignoringqueriedentityforsavingselection.Whenusing
ADESAVEOBJS,themessagemeansqueriedobjectsthatareselectedforsavebackareignored.
1201 kAdeDwgNotActive Attempttoreadtheobjectlockedfromaninactivedrawing.WhenusingADEWHOHASIT,themessagemeansthedrawingfromwhichtheobjectwasqueriedisnolongeractive.ADEisunabletodetermineiftheobjectselectediscurrentlylocked.Activatethespecifieddrawingandre-enterthecommand.
1202 kAdeReadDwgFileFails ADEfailstoreadexternaldrawing.IfusingADEDRAWINGS,thismessagemeansthatADEisunabletoreadthespecifieddrawing.Perhapsthedrawingdoesn'texitorthespecifiedfileisnotavalidAutoCADDrawingFile.Checktheerrormessagestackformoreinformation.
1203 kAdeMultipleUsers ADEfailstoaccessexternaldrawing.IfusingADEDRAWINGS,thismessagemeansADEisunabletoaccessthespecifieddrawingbecauseoffilelockingproblems.Checktheerrormessagestackformoreinformation.
1204 kAdeEntityLockingFails ADEfailstolock.IfusingADESELOBJS,thismessagemeansADEisunabletolockanobject.Theobjectmayalreadybelocked.UsetheADEWHOHASITtodetermineiftheobjectislocked,perhapsbyanotheruser.Checktheerrormessagestackformoreinformation.
1205 kAdeUnlockedEntity Entityisunlocked.IfusingADEWHOHASIT,thismessageindicatesthattheselectedobjectisnotcurrentlylocked.
1206 kAdeLockedEntity EntityhasbeenlockedbyanotherADEuser.IfusingADESELOBJS,thismessageindicatesthattheobjectisalreadylockedbyanotheruser.UsetheADEWHOHASITcommandtoidentifytheuser.
1207 kAdeAlreadyInSaveSet
1208 kAdeAlreadyNotInSaveSet
1209 kAdeMultipleReaders
1210 kAdeOpenPrefDictionaryFails ADEfailstoopenADEpreferencesdictionary.Callsupport.
1211 kAdeSavePrefDictionaryFails ADEfailstosaveADEpreferencesdictionary.Callsupport.
1212 kAdeRestoreDSetFails ADEfailstorestorethedrawingset.Callsupport.
1213 kAdeOpenDSetDictionaryFails ADEfailstoopenADEdrawingsetdictionary.Callsupport.
1214 kAdeSaveDSetDictionaryFails ADEfailstosaveADEdrawingsetindictionary.Callsupport.
1215 kAdeOpenQueryDictionaryFails ADEfailstoopenADEquerylibrarydictionary.Callsupport.
1216 kAdeSaveQueryDictionaryFails ADEfailstosaveADEquerylibraryindictionary.Callsupport.
1217 kAdeOpenRTableDictionaryFails ADEfailstoopenADErangetabledictionary.Callsupport.
1218 kAdeSaveRTableDictionaryFails ADEfailstosaveADErangetableindictionary.Callsupport.
1219 kAdeRestoreRTableDictionaryFails ADEfailstorestoreADErangetableindictionary.Callsupport.
1220 kAdeOpenDocViewDictionaryFails ADEfailstoopenADEDocViewinformationdictionary.Callsupport.
1221 kAdeSaveDocViewDictionaryFails ADEfailstosaveADEDocViewinformationindictionary.Callsupport.
1222 kAdeOpenKeyViewDictionaryFails ADEfailstoopenADEKeyViewinformationdictionary
1223 kAdeSaveKeyViewDictionaryFails ADEfailstosaveADEKey
Viewinformationindictionary.Callsupport.
1224 kAdeSaveProjectionFails ADEfailstosaveprojectioncodeinthedrawing.Callsupport.
1225 kAdeCopyHardPointerFails ADEfailstoapplypropertyalterationforsomesymboltable.Callsupport.
1226 kAdeDwgToBeReloaded
1227 kAdeDwgHasBeenModified Therewereobjectsqueriedfromthedrawingthatwillbetreatedasnewobjects.IfusingADEDRAWINGS,thismessagemeansthatwhenadrawingfromwhichobjectshavebeenqueriedisdetached,ADEconvertstheobjectsintonewlycreatedobjects.WhenyouusetheADEWHOHASITcommandtoseetheoriginoftheseobjects,itsaysthattheyhavenotbeenqueried.
1228 kAdeOnLockedLayer Objectsfromalockedlayerhavebeenselected.IfusingADESELOBJS,ADEREMOBJS,orADESAVEOBJS,thismessagemeansyouselectedobjectsfromalockedlayerandtheycannotbeaddedto,savedto,orremovedfromthesavesetorsavedtosource.
1229 kAdeDwgSaveFales ADEfailstosavethesource
drawing.IfusingADESAVEOBJS,ADESELOBJS,ADEREMOBJS,OPEN,NEW,orQUIT,orifyou'reconfiguringoptions,ormodifyingobjects,youmaygetthismessage.Callsupport.NOTE:Usethismessageexactlyasspelledhere.
1230 kAdeDwgLocksLeft ADEfailstoremoveobjectlocks(ifpresent)bytheendofADEsession.IfusingOPEN,NEW,orQUIT,orifyou'reconfiguringoptions,thismessagemeansthedrawingmightbelockedbyanotherADEuser.
1231 kAdeLinkWillBeLost ADEdoesnotsavelinksbetweenqueriedobjectsandsourcedrawingsbetweenADEsessions.Detachsourcedrawingwithqueriedobjects.UsetheSAVEcommandwithqueriedobjectsornoobjectsinthesaveset.
1232 kAdeDwgDiskFull
1233 kAdeDwgHasQueriedObject
1234 kAdeDwgUnlockedFile
CurrentSession
1300 kAdeGetCPointFails=1300 ADEfailstogetTextlocationfor
theentity.Callsupport.
1301 kAdeSetCPointFails ADEfailstostoreTextlocationfortheentity.Callsupport.
1302 kAdeTextInsPointMissed MissingTextinsertpoint.Callsupport.
1303 kAdeTextAllignPointMissed MissingalignmentpointforAlignedandFitText.Callsupport.
1304 kAdeTextHeightMissed MissingTextheight.Callsupport.
1305 kAdeTextStringMissed MissingTextstring.Callsupport.
1306 kAdeIndexUpdateFails ExceptioninIndexgenerationorregeneration.IfusingADESAVEOBJS,ADESELOBJS,ADEREMOBJS,orADEDWGMAINT,thismessagemeansentitymodificationoccurred.Callsupport.
1307 kAdeIgnorePreview ADEcustomobjectisselectedtoaddtosavesetortosave.IfusingADESAVEOBJS,ADESELOBJS,orADEREMOBJSthismessagehasthefollowingmeaning:WhendoingaPreviewQuery,ADEcreatesaspecialobjectcalledaPREVIEWobject,usedtodisplaythequeriedobjects.PREVIEWcannotbesavedbacktoasourcedrawing.Whenauserselectsthisobjectforaddingtothesavesetorwhensavingback,ADEdetectsthisandpreventstheoperation.
1308 kAdeIgnorePSpace
1309 kAdeEraseIRDObjectFails ADEfailstoerasetheObjectDataTable.Callsupport.
1310 kAdeRenameIRDObjectFails ADEfailstorenametheObjectDataTable.Callsupport.IfusingADEDEFDATA,thismessagemeansADEcan'trenameObjectDataTable.PerhapsObjectDataofthesamenamealreadyexistsinthedrawingorObjectDataTabledefinitionsbearingtheoldnamearedifferentinthesourcedrawings.Checktheerrormessageformoreinformation.
1311 kAdeAlterIRDObjectFails ADEfailstoalterObjectDataTable.IfusingADEDEFDATA,thismessagemeansADEcan'talterObjectDataTable.PerhapsObjectDataTabledefinitionsaredifferentinthesourcedrawings.Checktheerrormessagestackformoreinformation.
1312 kAdeIrdDuplicateTableName ObjectDataTablewithspecifiednamealreadyexists.ADEDEFDATA-allObjectDatatablenamesmustbeunique.Duplicatenamesarenotallowed.
1313 kAdeIrdNotIdenticaFormat ConflictinObjectDataTabledefinition.IfusingADEDEFDATA,thismessagemeansthatperhapsObjectDataTabledefinitionsaredifferentinthesourcedrawings.NOTE:Usethismessageexactlyasspelledhere.
1314 kAdeBHatchUnit ADEtreatsbhatchanditsboundaryasoneunit.IfusingADESELOBJSorADEREMOBJS,thismessagehasthefollowingmeaning:Whenaddinganobjecttothesaveset,ADEchecksifthisobjectispartofahatchboundary.Ifitis,allotherobjectsthatformtheboundaryareaddedtoorremovedfromthesaveset.Whensavingbackbhatchedareas,ADEalwaystreatstheboundaryasoneobject.
1315 kAdeReQuery ADEqueriedoneormoreobjectstwice.ADEdoesnotsupportUNDOforthisoperation.IfusingADEQUERYorADERUNXQUERYthismessagehasthefollowingmeaning:IfadrawingfilehasbeenmodifiedbyanotherADEuserandifaqueriedobjectmatchesanotherquery,ADEremovestheoldcopyandqueriesanewcopy.Thisoperationcan'tbeundone.
1316 kAdeCantAccessFont
1317 kAdeCantAccessImageFile
1318 kAdeUnableRedefineXrefBlock
DrawingSet
1500 kAdeRestoreDrawingSetFails ADEfailstoreadDrawingSetfromDWGfile.YouencounterthismessageduringADE
initializationorwhenusingOpendrawingfileorADEDRAWINGS.IfusingADEDRAWINGS-attachdrawing,themessagemeans"activateonattach"isONorade_dsattach(),ade_dswcattach()drawingiscorruptedoroldADEversionisinuse.
1501 kAdeDuplicatedDrawing Attempttoattachthesamedrawingtwice.IfusingADEDRAWINGS,thiserrorappearswhenadrawingwiththesamenamehasalreadybeenattachedtotheworksession.
1502 kAdeNestedDrawing Prohibitedattempttoeditpropertiesofthedrawinginthenesteddrawingset.IfusingADEDRAWINGS,thismessagemeansauserisnotallowedtomodifythetransformationandsavebackextentsofnesteddrawingsintheworksession.Thesepropertiescanonlybemodifiedfortopleveldrawings.
1503 kAdeActivateDrawingFails ADEfailstoactivatesourcedrawing.ADEwasunabletoactivateadrawingPerhapsthedrawingdoesnotexistoritislockedbyanotheruser,orthecurrentuserdoesn'thavepermissiontoreadthespecifieddrawingfile.Checktheerrormessagestackformoreinformation.
1504 kAdeDeactivateDrawingFails ADEfailstodeactivatesourcedrawing.ADEisunabletodeactivateadrawing.Perhapsthedrawingislockedbyanotheruser,thedrawingnolongerexists,ortherearelockedobjectsinthedrawing.Checktheerrormessagestackformoreinformation.
1505 kAdeLongDrawingDescription Specifieddrawingdescriptionexceeds133symbols.Shortendescription.
1506 kAdeEntityHasBeenLocked Drawingwithlockedentitiescan'tbedeactivated.ADEDRAWINGS-thespecifieddrawingcannotbedeactivatedbecauseitcontainslockedobjects.Removelocksanddeactivate.
1507 kAdePreviewNotSupported ADE2.0ignorestheseobjects:Tolerance,Body,Ellipse,3dSolid,Region,andMline.IfusingADEQUERY(Preview),ADEQVIEWDWGS,orADEKEYVIEW,thismessagemeansADEdoesnotsupportaPreviewQueryofTolerance,Body,Ellipse,3dSolid,RegionandMline.
1508 kAdeAliasIsInUse Adrivealiasofthesamenamealreadyexists.
1509 kAdeActivateDrawingCancelled Thedrawingactivationoperationfailed.
1510 kAdeAttachDrawingCancelled Thedrawingattachmentoperationfailed.
FeatureAlteration
1800 kAdeInvalidFeatureType Attempttosetaninvalidpropertyalterationtype.IfcallingAPIfunctionsade_altpsetproporade_altpdefine,checkforamistakeinpropertytype.
1801 kAdeNoListId Propertyalterationinternallistisinvalid.Callsupport.
1802 kAdeInvalidExpType Attemptmadetosetaninvalidpropertyalterationexpressiontype.Callsupport.
1803 kAdeNoExpression Propertyalterationinternalobjectisinvalid.Callsupport.
1804 kAdeTextCreationFailed Propertyalterationwasunabletocreateanewtextobject.Thismessageoccurswhenusingqueriesthatalterproperties.Checkexpressionsinthetextpropertyalterationdefinition.
1805 kAdeHatchCreationFailed Propertyalterationwasunabletocreateanewhatchobject.Thismessageoccurswhenusingqueriesthatalterproperties.Checkexpressionsinthehatchpropertyalterationdefinition.
1806 kAdeInvalidColor Invalidcolorpassedtopropertyalteration.Thismessageoccurswhenusingqueriesthatalterproperties.CheckexpressionsevaluatestoavalidAutoCADcolor.
1807 kAdeInvalidLayer Invalidlayername.Thismessageoccurswhenusingqueriesthatalterproperties.CheckexpressionsevaluatestoavalidAutoCADlayer.
1808 kAdeInvalidStyle Invalidstylename.Thismessageoccurswhenusingqueriesthatalterproperties.Checkexpressionsevaluatestoavalidstyle.
1809 kAdeInvalidJustification Theexpressionforjustificationinatextpropertyalterationdidnotevaluatetoavalidjustification.Thismessageoccurswhenusingqueriesthatalterproperties.CheckexpressionsevaluatestoavalidAutoCADjustification.
1810 kAdeInvalidScale
1811 kAdeNoRangeId ADEinternalobjectisinvalid.Callsupport.
Mapping
1900 kErrMapCoincPoint Coincidentpoints.IfusingADERSHEETorADETRANSFORMthismessagemeanseitheroldornewpointsarecoincident.Theymustbedifferent.
1901 kErrMapWrongScale Invalidscale.Callsupport.
1902 kErrMapTransform Can'ttransformentity.ADERSHEET,ADETRANSFORM,ADEQUERY,ADESAVEOBJSAnerrorappearedatthetimeofentitytransformation.Itishigh-levelerror.Theremustbeanothererrorinthestackwithmorespecificinformation.
1903 kErrMapWrongExtents Invalidentityextents.Ifyou'reusingADETEXTLOC,ADERSHEET,ADEQUERY,ADESAVEOBJS,orcallingAcDbEntity::getGeomExtents()methodyoumaygetthismessage.
1904 kErrMapWrongPoints Invalidpointsnumber.Ifyou'reusingADERSHEET,thismessagemeansthatthenumbersofoldandnewpointsaredifferent,orlessthan2.Dialogdoesn'tallowthis.
1905 kErrMapWrongSelSet Invalidselectionset.Callsupport.
1906 kErrMapWrongEntityName Invalidentityname.Theentityisopen.Forexample,ithasbeenreceivedfromtheAPI.
1907 kErrMapOpenEntity Can'topenentity.Theentityisopen.Forexample,anotherapplicationopenedtheentity.
1908 kErrMapUpgradeEntity Can'tupgradeopen.Entitymodificationoccurred.
1909 kErrMapMoveStretchPoints Can'tmodifystretchpoints.Callsupport.
1910 kErrMapEntityPoint Can'tmodifyentitypoints.Callsupport.
1911 kErrMapCmdecho Can'tchangeCMDECHOvariable.UsingADEFILLPOLYGmayproducethismessage.
1912 kErrMapCecolor Can'tchangeCECOLORvariable.UsingADEFILLPOLYGmayproducethismessage.
1913 kErrMapHatch Errorinhatchcommand.UsingADEFILLPOLYGmayproducethismessage.
1914 kErrMapWrongIntersectForPoints Can'tfindintersection.UsingADEQUERYorcallingAcDbentity::IntersectWith()methodmayproducethismessage.
1915 kErrMapWrongHandle Wrongentityhandle.Callsupport.
1916 kErrMapNotPolyline Entityisn'tpolyline.Callsupport.
1917 kErrMapIterator Can'tcreateiterator.Callsupport.
1918 kErrMapWriteXData Can'twriteXdata.EnsurethatXdatasizeis16KBorless.
1919 kErrMapBuffer Can'tcreatebuffer.Ifyou'reusingADEQUERY,tomakealocationqueryusingabufferfence,youmaygetthismessage.
1920 kErrMapStretchPoints Can'tgetstretchpoints.Ifyou'reusingADETRANSFORMorADEQUERYorcallingAcDbEntity::getStretchPoints()youmaygetthismessage.
Topology
Topology
2000 kErrTopInvalidName Invalidtopologyname.Occursduringtopologycreation.
2001 kErrTopExist Topologyalreadyexists.Occursduringtopologycreation.
2002 kErrTopBuildNet Errorbuildingnetworktopology.Occursduringtopologycreation.
2003 kErrTopBuildPolygon Errorbuildingpolygontopology.Occursduringtopologycreation.
2004 kErrTopBuildNode Can'tcreatenode.Occursduringtopologycreation.
2005 kErrTopBuildArc Can'tcreatelink.Occursduringtopologycreation.
2006 kErrTopBuildCntr Can'tcreatecentroid.Occursduringtopologycreation.
2007 kErrTopAPIReg Can'tregistertopologyAPI.OccursduringADEloading.
2008 kErrTopFuncNotAvail Functionisn'tavailable.Occursifyou'reusingtopologyfunctionsoftheAPI.
2009 kErrTopWriteData ErrorwritingXdata.Occursduringtopologycreationandmodification.
2010 kErrTopNotExist Topologydoesn'texist.Occursifyou'reusingtopologyfunctionsoftheAPI.
2011 kErrTopOverlayType Wrongoverlaytype.
2012 kErrTopMakeLayer Can'tcreatenewlayer.UsingADEDWGCLEANproducesthis
message.
2013 kErrTopBlockNotExist Blockdoesn'texist.
2014 kErrTopNotOpenForWrite Topologyisn'topenforwrite.Occurswheneditingtopology.
2015 kErrTopOpenIrdTable Can'topenobjectdatatable.Occurswhenloadingandeditingtopology.
2016 kErrTopWrongIrdAttr Invalidobjectdatatable.Occurswhenloadingandeditingtopology.
2017 kErrTopLoaded Topologyisalreadyloaded.Occurswhenloadingtopology.
2018 kErrTopIncompleteElem Incompletetopologyelement.Occurswheneditingtopology.
2019 kErrTopInvalidColor Invalidcolornumber.OccurswhenusingADEDWGCLEANandcreatingtopology.
2020 kErrTopInvalidFlag Invalidflag.OccurswhenusingADEDWGCLEAN.
2021 kErrTopInvalidTolerance Invalidtolerance.OccurswhenusingADEDWGCLEANandcreatingtopology.
2022 kErrTopInvalidCorridor Invalidcorridorwidth.OccurswhenusingADEDWGCLEAN.
2023 kErrTopInvalidOffset Invalidoffset.Occurswhenusingbuffering.
2024 kErrTopInvalidHeight Invalidmarkerheight.OccurswhenusingADEDWGCLEAN.
2025 kErrTopInvalidMarkerType Invalidmarkertype.Occurswhen
usingADEDWGCLEAN.
2026 kErrTopInvalidEntityType Invalidtypefornewentities.OccurswhenusingADEDWGCLEAN.
2027 kErrTopInvalidErrorType Invaliderrortype.OccurswhenusingADEDWGCLEAN.
2028 kErrTopIntersection Intersectionsdetected.Occurswhencreatingandeditingpolygontopology.
2029 kErrTopOverlayItself Can'toverlaytopologywithitself.
2030 kErrTopSourceDwgAccess Can'taccesssourcedrawing.
2031 kErrTopSourceDwgNotActive Sourcedrawingisn'tactive.
2032 kErrTopSourceDatabaseAccess Can'taccesssourcedrawingdatabase.
2033 kErrTopSourceObjectId Can'tgetobjectIDbyhandleinsourcedrawingdatabase.
2034 kErrTopNotLoaded Topologyisn'tloaded.
2035 kErrTopImplicitNode Nodeobjectdoesn'texistinnodetopology.
2036 kErrTopMisplacedNode Wrongnodecoordinates.
2037 kErrTopUnreferencedNode Nodeisn'treferencedinlinks.
2038 kErrTopUnexistentNode Linkreferencesnonexistentnode.
2039 kErrTopMismatchStartNode LinkhasinvalidIDatthestartnode.
2040 kErrTopMismatchEndNode LinkhasinvalidIDattheendnode.
2041 kErrTopMisplacedCentroid Wrongcentroidcoordinates.
2042 kErrTopMismatchLeftPoly LinkhasinvalidIDfortheleftpolygon.
2043 kErrTopMismatchRightPoly LinkhasinvalidIDfortherightpolygon.
2044 kErrTopUnexistentCentroid Centroidisn'tinsidepolygon.
2045 kErrTopMultiplyCentroid Polygonhasseveralcentroidsinside.
2046 kErrTopWrongPolyQty Somepolygonsareincorrect.
2047 kErrTopMismatchPolyArea Incorrectpolygonarea.
2048 kErrTopMismatchPolyPerimeter Incorrectpolygonperimeter.
2049 kErrTopOpenSourceDwgTopo Topologyloadedfromsourcedrawingscan'tbeopenforwrite.
2050 kErrTopOpenTempTopo Temporarytopologycan'tbeopenforwrite.
2051 kErrTopIdNotExist Currentdrawingdoesn'thaveODtablewithinformationaboutlastID.
2052 kErrTopEmpty Can'tcreateorloademptytopology.
2053 kErrTopWasModified TopologyobjectsweremodifiedbyAutoCADcommands.
2054 kErrTopMultiple Objectbelongstomultipletopologiesandcan'tbeerased.
2055 kErrTopCalculateOffset Can'tcalculateoffset.Usedefault.Occurswhenusingbuffering.
2056 kErrTopZeroOffset Zerooffset.Can'tbuildbuffer.
2057 kErrTopDifferentOffset Offsethasdifferentsignforsomeobjects.Can'tbuildbuffer.
2058 kErrTopInvalidSelSet Invalidselectionset.OccurswhenusingtheAPI.
2059 kErrTopCleanNotInit Cleanupmodelisn'tinitialized.OccurswhenusingtheAPI.
2060 kErrTopCleanNoGroup Thereisnocurrentgroup.OccurswhenusingtheAPI.
2061 kErrTopCleanInvalidIndex Invaliderrorindex.OccurswhenusingtheAPI.
2062 kErrTopCleanNoError Currenterrorisn'tset.OccurswhenusingtheAPI.
2063 kErrTopTraceLinkNotExist Linkdoesn'texistintracingmodel.OccurswhenusingtheAPI.
2064 kErrTopTraceNodeNotExist Nodedoesn'texistintracingmodel.OccurswhenusingtheAPI.
2065 kErrTopTraceNoPath Resultpathisn'tcalculated.OccurswhenusingtheAPI.
2066 kErrTopTraceInvalidIndex Invalidelementindex.OccurswhenusingtheAPI.
2067 kErrTopInvalidExpression Can'tprocessADEexpression.Occurswhenusingoverlay,buffer,dissolve,ortracingcommand.
2068 kErrTopLockedTable Can'twriteintotopologyODtable.Occurswhenusingdissolvecommand.
2069 kErrTopCreateTable Can'tcreateODtable.Occurswhenusingtopologycreation,
overlay,buffer,ordissolvecommands.
2070 kErrTopCreateTableColumn Can'taddcolumntoODtable.Occurswhenusingtopologycreation,overlay,buffer,ordissolvecommands.
2071 kErrTopTraceNodesEqual Startandendnodesarethesame.Occursdoingshortestpathtracing.
2072 kErrTopTracePathNotExist Emptypath.Occursduringshortestpathtracing.
2073 kErrTopTraceFloodNotExist Emptypath.Occurswhentracingfloods.
2074 kErrTopRenameDisabled Can'trenametopology,becausecurrentdrawinghasqueriedobjectswithOD.
2075 kErrTopDeleteDisabled Can'tdeletetopology,becausecurrentdrawinghasqueriedobjectswithOD.
2076 kErrTopInvalidExtents
TopologyAPI
2100 kAdeTopApiErrWrongInput Missingorinvalidparameter.
2101 kAdeTopApiWrongId InvalidID.
Tracing
2150 kAdeTopSprErr Tracingerror.Occursduringtopologytracing.
QueryDefinition
QueryDefinition
2200 kErrUnexpectedBuffChar Invalidcharacterencounteredwhilereadingthequerydefinitionfromthedrawing.Optionsarea)Recoverthedrawingb)Defineandsaveanewquerydefinitioninthedrawing.
2201 kErrInvalidIndex Aninvalidlinenumberwasspecifiedforeithergroupingorungroupingofquerylines.Specifythecorrectlinenumberforgroupingorungroupingthelines.
2202 kErrInvalidQueryLine Oneormorequerylineshavebeenincorrectlydefined.Mayoccurwhenyouincorrectlyplaceaparenthesisoranoperatorinaqueryline.
2203 kErrInvalidName Eitheraqueryoraquerycategorynameisinvalid.EnsurethatthequeryorcategorynameconformtotheAutoCAdsymbolnamespecifications.
2204 kErrEntryAlreadyExists Eitherthequeryorthequerycategorynamealreadyexistsinthequerylibrary.Ensurethatthequerynameisuniquewithinthequerylibrary.
2205 kErrEntryInOtherCategory Thequerynamespecifiedalreadyexistsinanothercategoryinthequerylibrary.Ensurethatthequerynameisuniquewithinthequerylibrary.
2206 kErrEntryAndFileAlreadyExist Thefilenamespecifiedforsaving
theexternalqueryalreadyexists.Chooseadifferentfilename.
2207 kErrASIConnectFailed TheconnectiontotheASIenvironmentrequiredfortheSQLquerywasnotmade.UseASEtoconnecttotheenvironmentbeforeattemptingtoperformtheSQLquery.
2208 kErrASIStmtPrepareFailed ThecalltoCAsiExecStm::Preparefailed.correctthetablenameortheSQLstatementspecified.
2209 kErrASICsrAllocFailed ThecalltoCAsiCsr::Allocatefailed.LookattheASIerrordisplayed.
2210 kErrASICsrOpenFailed ThecalltoCAsiCsr::Openfailed.LookattheASIerrordisplayed.
2211 kErrInvalidDOName AninvalidEnvironment,SchemaorCatalognamewasspecified.SetthecorrectEnvironment,Catalog,andSchemanames.
2212 kErrLPInitFailed ThecalltoCAseLinkPath::initfailed.LookattheASEerrordisplayed.
2213 kErrColNotFound UsedfortheSQLOrder-bydialognowobsolete.Callsupport.
2214 kErrQDefNotInTM TheCAdeQueryDefobjectwasnotappendedtotheTransactionManager.Internalerror.
2215 kErrQryDefnExists Aquerydefinitionalreadyexistsandanewonecannotbeloaded.Cleartheexistingquerydefinition
beforeloadinganewone.
2216 kErrInvalidOperator Invalidoperatordefinedinquerydefinition.Thespecifiedcomparisonoperatorisincompatiblewithoperandtypes.Donotuse>withthepointtype.Checkthequerydefinitionandchangeeithertheoperatororoperandtype.
2217 kErrInvalidPtrnOperator Invalidoperatordefinedinquerydefinitionforpatternvalue.Ifvalueoperandisdefinedaspattern,only"="comparisonoperatorcanbeused.Checkthequerydefinitionandchangeeitheroperatororoperandvalue.
2218 kErrInvalidField Non-existentobjectdatafieldspecified.Thiserroroccurswhentheuserspecifiesthewrongobjectdatafieldnameforatable(ifthereisnosuchfieldinthespecifiedtable)inthequerydefinitionandexecutesthequery.Checkquerydefinitionandtablesandcorrectthemistake.
2219 kErrInvalidNotBranch
2220 kErrInvalidBranch
2221 kErrUndefinedValue
2222 kErrInvalidLocationType
2223 kErrCantLoadExternQuery
QueryManager
QueryManager
2300 kErrIntersectFailed AcalltoCAseLinkSel::intersectPartialKeyfailed.LookattheASEerrordisplayed.
2301 kErrNoTemplate Thequerytypewasspecifiedasreportbutnoreportoptionsweredefined.Definereportoptions.
2302 kErrASIStoreValueFailed AcalltoCAsiData::storeValuefailed.LookattheASIerrordisplayed.
2303 kErrASIGetValueFailed AcalltoCAsiData::getValuefailed.LookattheASIerrordisplayed.
Utility
2400 kErrLicFatal FatalerrorinADElicense.Callsupport.
2401 kErrFileNotFound Can'tfindassociateddocument.OccurswhenusingADEDOCVIEW.
2402 kErrPathNotFound Can'tfindexecutablefile.OccurswhenusingADEDOCVIEW.
2403 kErrBadFormat Syntaxerrorinthecommandline.OccurswhenusingADEDOCVIEW.
2404 kErrConvtErr ErrorconvertingADE1.0datatoADE2.0data.OccurswhenusingADECONVERT.
DataDialogs
2450 kErrIRDMismatch
2451 kErrIRDInvalidName
2452 kErrIRDTableExists
2453 kErrInvalidTableName
2454 kErrInvalidAttrName
2455 kErrTopoName
2456 kErrQueriedAndNotNew
2457 kErrNotAdministrator
GenLink
2500 kErrTagNotFound
2501 kErrTagValueAbcent
2502 kErrIllegalFormat
2503 kErrColMoreThanOne
Environment
2600 kErrInitEnv AnerroroccurredduringtheinitializationofADE.Thecauseofthiserrormaybeduetoerrorsinloading/initializingADEuserpreferences,systempreferences,logfile,oruserlist.
2601 kErrCantFindAdeExePath
2602 kErrINIWrite
2603 kErrInvalidUserName Theusernamespecifieddoesnotexistintheuserlist.UseausernamethatalreadyexistsintheuserlistordefineanewoneusingUserAdministration.
2604 kErrLoadUserList
2605 kErrSaveUserList
2606 kErrInvalidPswd Thepasswordspecifieddoesnotmatchtheonespecifiedintheuserlistforthisuser.Usethecorrectpassword.
Rx
2700 kErrRxAseLoad ASEisn'tloadedCan'tinitializeASEAPI.
2701 kErrRxAseInit ObjectDatamoduleisn'tloaded.
2702 kErrRxIrdLoad Can'tinitializeObjectDataAPI.
2703 kErrRxIrdInit Specifiedcoordinatesystemcategorynotfoundinthelibrary.Callsupport.
Projection
2800 kErrNoProjCatFound Specifiedcoordinatesystemcategorynotfoundinthelibrary.Callsupport.
2801 kErrNoDatumFound Specifiedcoordinatesystemdatumnotfound.Callsupport.
2802 kErrNoElipFound Ellipsoidnotfoundintheellipsoidlist.Callsupport.
2803 kErrNoCoordFound SpecifiedCoordinateSystemnotfound.Callsupport.
2804 kErrFaileOpenDatumFile Can'topenprojection.mp3file.OccurswhenloadingADE.
2805 kErrFaileOpenElipFile Can'topenellipsefile.OccurswhenloadingADE.
2806 kErrNoneCoord Internalcodetoset"None"projectiontothedrawing.Callsupport.
Expression
2900 kErrNoExpressionFound Emptyexpressionisspecified.Callsupport.
2901 kErrGetPropFail Thisisaninternalcodetoshowthatentityhasnospecifiedproperty.Callsupport.
2902 kErrExpEvalFail ADEfailstoevaluateexpression.Occurswhenexecutingquerywithpropertyalterationandexecutingapropertyquery.
2903 kErrExpMissingQuote QuotesmismatchedinSQLexpression.OccurswhenexecutingaSQLqueryandaquerywithSQLpropertyalteration.AlsooccurswhenusingADECONVERT.
2904 kErrExpMissingCParen Parenthesismismatched.Occurswhenexecutingaquerywithfeaturealterationandexecutingapropertyquery.
2905 kErrExpExceedThreeOper Morethanthreeoperandsarespecified.Occurswhenexecutingaquerywithpropertyalterationandexecutingapropertyquery.
2906 kErrRngTabNameExist Rangetablewithspecifiednamealreadyexists.Callsupport.
2907 kErrLpnInvalid
2908 kErrLpnNotFound
2909 kErrRangeInvalidElse
FormoreExpressionerrors,whichbeginat�15,click .
Index
3000 kErrInvalidIndexVersion Theversionoftheindexinthedrawingisinvalid.Theoptionsare:1)Regeneratetheindexusingdrawingmaintenance2)Removetheindexusingtheindexremovalutilityandthenre-generatetheindex.
3001 kErrIndexOutOfDate Theindexinthedrawingisout-of-date.Regeneratetheindexusingdrawingmaintenance.
3002 kErrTypeAllObjects
3003 kErrTypeNoOneObject
Validation
3100 kErrWrongSymbolName
3101 kErrWrongSymbol
3102 kErrWrongStrLength
3103 kErrDirDoesNotExist
3104 kErrDirReadOnly
3105 kErrAccessDenied
3106 kErrFileDoesNotExist
3107 kErrFileAlreadyExists
3108 kErrFileOpenFailed
3109 kErrFileReadOnly
3110 kErrInvalidString
3111 kErrOutOfRange
3112 kErrWrongColor
3113 kErrIncorrectParameters OneofADEvalidationmethodsrecognizedincorrectinputparameters.ThiserrorisaninternalADEerror.
3114 kErrFileOpenLimit
3115 kErrShareViolation
3116 kErrNetAccessDenied
3117 kErrPathDoesNotExist
FileLocking
3200 kErrDwkFileDoesNotExist ADElockfileislocked.OccurswhenusingADEDRAWINGSandADEQUERYcommandsandwhenADEisrunninginamulti-userenvironment.
3201 kErrOpenDwkFileFailed ADEwasunabletoopenthe.DWKlockfile.Callsupport.
3202 kErrFileLockedByAcad Attempttoremoveauserwhodoesnotexistfromthelockfile.Callsupport.
3203 kErrOldMapLockFile ADEwasunabletocreatethe.DWKlockfile.Callsupport.
3204 kErrFileIsNotDwk ADEtriedtolockafileforwritethatwasalreadylockedforread.Callsupport.
3205 kErrSpecifiedUserDoesNotExist ADEtriedtolockafileforreadthatwasalreadylockedforwrite.Occursduringqueryoperationsinamulti-userenvironment.
3206 kErrCreateDwkFileFailed ADEtriedtoopenandreadafilethatwasnotavalid.DWKfile.Callsupport.
3207 kErrFileIsLockedForRead ADEwasunabletounlockthelockfile.Callsupport.
3208 kErrFileIsLockedForWrite ADEtriedtoattachafilethatisalreadyopenbyAutoCAD.OccurswhenusingADEDRAWINGSwithATTACHoperationsifthefileisopeninanAutoCADproject.
3209 kErrInvalidLockStateSpecified ADEinternalobjectisinvalid.Callsupport.
3210 kErrNotOwnerOfWLH ADEtriedtoremoveawritelockwhentheuserdidnothaveawritelock.Callsupport.
3211 kErrUserIsNotWriter
3212 kErrUserIsNotReader
3213 kErrUserHasReadLock
3214 kErrLockFileIsFull
3215 kErrDwgFileDoesNotExist ADEtriedtounlockafilebutthe.DWKfilewasmissing.Occursifthe.dwkfilewaserasedafterafilewasattached.
3216 kErrNotAnADELockFile ADEinternalobjectisinvalid.Callsupport.
3217 kErrFileMayHaveBeenModified Existing.DWKfiledoesnotbelongtoADE.thelockfileexistsandcanbereadbyADE,butADEdoesnotownthefile.
3218 kErrFileHasLocks ADEtriedtoremovealockfilebutitwasnotfound.Occursifthe.dwkfilewaserasedafterafilewasattached.
UnicodeSupport
4000 kAdeUnicodeInsufficientBufferToConvert
4001 kAdeUnicodeInvalidFlagsToConvert
4002 kAdeUnicodeInvalidParameterToConvert
4003 kAdeUnicodeNoTranslation
4004 kAdeUnicodeCodePageNotAvailable
Double-ByteSupport
4005 kAdeNoMBCSAllowed
ErrorTypes
Errorsaregroupedbyerrortype.
Youcangetanerror'serrortypebypassingitsstackindex(0=firsterror)toade_errtype.
00 kAdeNoMessage Errorconditiondoesnotexist.
01 kAdeWarning ADE(AutoCADDataExtension)executionwarning
02 kAdeError ADEexecutionerror
03 kAseWarning ASE(AutoCADSQLExtension)executionwarning
04 kAseError ASEexecutionerror
05 kAcWarning AutoCADexecutionwarning
06 kAcError AutoCADexecutionerror
07 kAsiWarning ASI(AutoCADSQLInterface)executionwarning
08 kAsiError ASIexecutionerror.
09 kIRDWarning Extendedobjectdata(Xdata)warning
10 kIRDError Xdataerror
13 kMapError AutoCADMapexecutionerror
14 kMentorError
15 kApplicationError Operatingsystemlevelapplicationerror
16 kDiagMessage Diagnosticmessagereturned.
ConvertingCoordinates
Convertingpointcoordinatesfromonegeo-referencedsystemtoanother.
KeepinmindthatanyCartesiancoordinatepairyouselectinageo-referencedcoordinatesystemcorrespondstoapointonthesurfaceoftheearth.Thisfactdefinesarelationbetweenthecoordinatepairsinonecoordinatesystemandthecoordinatepairsinanyother,solongasthepointinquestionactuallyexistsinbothsystems.Inotherwords,solongasthecoordinatesystemshavearegionofintersection,andthepointinquestionisinit.
Toconvertthecoordinatesofapointfromonegeo-referencedcoordinatesystemtoanother
1. Definea"source"coordinatesystemwithade_projsetsrc.2. Definea"destination"coordinatesystemwithade_projsetdest.3. Passacoordinatepairtoade_projptforward.
Thefunctionassumesthatthecoordinatepairyoupasstoitisapointinthesourcesystem,anditreturnsthecorrespondingcoordinatepairinthedestinationsystem.Ifthereisnocorrespondingcoordinatepair,itreturnsnil.
Toconvertintheotherdirection,useade_projptbackward.
Youcanspecifycoordinatetriplets,butifyoudo,theZvalueisignored.
PlottingaMap
Plottingisthelaststageinpresentingmapdata.
Thefollowingsampleoutlinesthestepsrequiredtosetupandplotamapset.
Toplotamap1. SetthePlotternameforLayout1usingtheAutoCAD�ActiveX�
interface.
(vl-load-com)(setqacadObject(vlax-get-Acad-object))(setqacadDocument(vla-get-ActiveDocumentacadObject))(setqactiveLayoutObject(vla-Get-ActiveLayoutacadDocument))(setqpSpace(vla-get-PaperSpaceacadDocument))(setqlayout(vla-get-layoutpSpace))(vla-put-confignamelayout"\\\\PlotServer\\HpLaserjet4100SeriesPcl")
2. AddadrivealiastothelistsothatAutoCADMapcanfindthedrawingsusedtoexecutetheplot.
(ade_aliasadd"LISP_SAMPLE""C:\\Lisp\\Drawings\\PlotMapSet")
3. Defineaboundarydrawingoruseanexistingone.ThisexampleusesanexistingdrawingnamedSystem-Grid.dwg.
Theboundarydrawingmustcontainatleastoneclosedpolylinewithobjectdata.Eachclosedpolylineisadivisionofthemap,andthesheet
nameisattachedtoitasobjectdata.
4. Attachthedrawingsforthisplotsetandtheboundarydrawing.
(ade_dsattach"LISP_SAMPLE:\\Landbase-Shared.dwg")(ade_dsattach"LISP_SAMPLE:\\Water-Facilities.dwg")(ade_dsattach"LISP_SAMPLE:\\System-Grid.dwg")
5. Definea"Draw"modequerywhichselects"ALL"objectsintheattacheddrawings.
(ade_qryclear)
(ade_qrydefine'("""""""Location"("All")""))
(ade_qrysettype"draw")
6. Savethequeryinternaltotheproject.
(ade_qrysave"PlotQueries"'(("name""TruckBook-100")("saveoption"2)))
7. Definealayoutblock,(titleblock)oruseanexistingone.Thelayoutblockmustcontainatleastoneviewportandoptionallyareferenceviewport.Ifthelayoutblockcontainsanattributewhichrepresentsamapnameorsomeothertypeofareanamingconvention,thatnamecanbemappedfromtheboundarydrawingtothisattribute,infactanyobjectdataassociatedtoaboundarycanbemappedtoanattributeonthelayoutblock.Thissampledoesnotcontaincodeforcreatingordefiningthislayoutblock.
8. Createanewplotset.
(map_pltCurrDef"TruckBook-100")
9. DefinePlotSetvariables
Definethedrawingset:
(setqdwgs_list(list"LISP_SAMPLE:\\Landbase-Shared.dwg""LISP_SAMPLE:\\Water-Facilities.dwg"))(map_pltCurrSet"dwgs"dwgs_list)
Definetheplotternameviathelayout:
(map_pltCurrSet"pnam""Layout1")
Definethelayoutblockname:
(map_pltCurrSet"block""TITLE-A")
Definethelayoutblocksviewportlayer:
(map_pltCurrSet"vlayer""TB-BORDER")
Definetheobjectdatatablecontainingboundaryinformation:
(map_pltCurrSet"bnamt""MAPSYS-MAP")
Definetheboundaryfieldname:
(map_pltCurrSet"bnamf""MAPNAME")
Definetheboundaryobjectdatafieldtoblockattributeinlayoutmapping:
(map_pltCurrSet"atts""MAPNAME")
Definethelayoutblocksreferenceviewportflag:
(map_pltCurrSet"kflg"nil)
Definethelayoutblockskeyviewportlayer:
(map_pltCurrSet"klayer""")
Definethedisplaylayersinthereferenceviewport:
(map_pltCurrSet"kdispl""")
Definethelayerstofreezeinmainviewport:
(map_pltCurrSet"vdispl""0")
Definethequerycategory:
(map_pltCurrSet"qcat""PlotQueries")
Definethequeryname:
(map_pltCurrSet"qnam""TruckBook-100")
Definetheboundarydrawing:
(map_pltCurrSet"bdwg""LISP_SAMPLE:\\System-Grid.dwg")
Definetheboundarylayer:
(map_pltCurrSet"blyr""MAPEDGE")
Definetheboundaryfieldname:
(map_pltCurrSet"bodfs""MAPNAME")
Specifytheboundaries:
(setqbndry_list(list"101""102"))(map_pltCurrSet"bnds"bndry_list)
Definetheplottospecifiedscaleflag:
(map_pltCurrSet"sflg"nil)
Definetheplotscale:
(map_pltCurrSet"scale""1:750")
Definetheclipobjectsagainstboundaryflag:
(map_pltCurrSet"clip"T)
Definetheplottheboundaryflag:
(map_pltCurrSet"pbnd"T)
10. Appendthecurrentplotsetdefinitiontotheplotsetlist.
(map_pltCurrSave)
11. Writethecurrentplotsetdefinitiontotheplotdefinitiondictionarywithinthecurrrentproject.
(map_pltDefSave)
12. Performacursorychecktoseeiftherequiredattributeshavebeenset,thisisoptional.
(if(not(map_pltDefValid"TruckBook-100"))(prompt"\nERROR:Plotsetinvalid."))
13. Performamoreextensivecheckthatmakessurethatnoerrorsoccurwhenplottingtakesplace,thisisoptional.
(map_pltdefverify"TruckBook-100")
14. Initializetheplottingenvironment.See(map_pltInit)formoredetailonthisfunction.
(map_pltInit)
15. Displayasinglesheetwithintheplotsetbasedonaboundaryvalue,thenplotifsuccessful.Note,youmustalwayscallmap_pltdisplay()beforecallingmap_pltPlot().
(map_pltDisplay"101")
;Visuallychecktheplotsetdisplay.Ifitiscorrect,plotit.(initget"YesNo")(setqanswer(getkword"\nDisplayiscorrectYes/No?"))(if(or(nullanswer)(equalanswer"Yes"))(map_pltPlot))
16. Restorethedisplayenvironmenttoitsstatebeforethelastexecutionofthemap_pltDisplay().
(map_pltRestore)
17. RestorethedataextensionoptionsandAutoCADsettingsalteredbymap_pltInit().
(map_pltCleanup)
CompletingaTopology
Thisprocedurecreatesapartialtopologyandusesmap_topocompletetoaddthemissingelementstocompleteit.
Tocompleteatopology1. Createapolygontopologyandsaveittoafile.
2. Startanewprojectandattachthedrawingusingade_aliasadd,ade_dsattach,andade_dwgactivate.
3. Queryinsomeofthetopology'sobjectstocreateapartialtopology.Usequeryfunctions.
(ade_qryclear);clearallqueries(ade_qrysettype"draw");drawqueryresults(setqpt1(list2.91238.85130.0))(setqpt2(list5.91341.16340.0))(setqpt3(list10.79311.73540.0))(setqpt4(list10.03718.87420.0))(setqlst(list"polygon""crossing"pt1pt2pt3pt4))(setqqry_id(ade_qrydefine"""""""location"lst""))(if(nullqry_id)(prompt"\nERROR:Querydefinitionfailed.")(progn(prompt"\nQueryinginpartofthepolygontopology.")(setqresult(ade_qryexecute))(if(nullresult)
(prompt"\nExecutionofqueryfailed."))))
4. Loadthetopologyintomemoryfromtheprojectdrawing.
(setqresult(tpm_acloadnamenil))
5. Openthetopologywithreadaccess.
(setqtpm_id(tpm_acopen"test"nil))
6. Testthetopologyforcorrectnessandcompleteness.
(if(tpm_infocorrecttpm_id)(prompt"\nTopologyiscorrect.")(prompt"\nTopologyisnotcorrect."))(if(tpm_infocompletetpm_id)(prompt"\nTopologyiscomplete.")(prompt"\nTopologyisnotcomplete."))
7. Optionally,youcangettopologystatistics.Youcanaddcodetodisplaythestatistics.
(setqlst(map_topostattpm_id))(if(nulllst)(prompt"\nERROR:Unabletogetstatistics.")(progn(prompt"\nNumberofnodes:")
(princ(cdr(assoc"node_count"lst)))(prompt"\nNumberoflinks:")(princ(cdr(assoc"link_count"lst)))))
8. Closethetopology.
(tpm_acclosetpm_id)
9. Usemap_topocompletetobringinthemissingobjectstocompletethetopology.
(map_topocomplete"test")
10. Repeatsteps5through7totestthetopologyforcompleteness.11. Unloadthetopology.
>
(tpm_acunload"test")
DrawingCleanup
Youmustcleandrawingobjectsbeforebuildingatopologywiththem.
Drawingcleanupextendsundershoots,snapsclusterednodes,removesduplicates,simplifieslinearobjects,andcorrectsothererrors.
Let'slookatthisintwophases,preparingthecleanupmodel,whichendswithacalltotpm_cleaninit,andexecutingthecleanup,whichbeginswithacalltotpm_cleanstart.
Topreparethecleanupmodel
1. Allocatememoryforthecleanupmodel.Usetpm_cleanalloc.
(setqclean_id(tpm_cleanalloc))
2. Allocatememoryforcleanupvariables,whichspecifypropertiesforthecleanupprocess.Thevariablesareinitializedtotheirdefaultvalues.Usetpm_varalloc.
(setqclean_var_id(tpm_varalloc))
Ifyouwillbespecifyinganexplicitlistofcleanupactions(youcreateandmanagethislistwithcallstotpm_cleanactionlistinsandrelatedfunctions),alsoallocatememoryforcleanupactionvariables,whichspecifypropertiesforindividualactions.Againusetpm_varalloc.
(setqaction_var_id(tpm_varalloc))
3. Getaselectionsetofobjectstobecleaned(theincludeset).
(prompt"\nSelectobjectstoclean.")(setqss_clean(ssget))
Youcanalsogetaselectionsetofobjectstobeanchored(theanchorset).Anchoredobjectsarenotrepositionedbythecleanupprocess,butremainfixedwhileothersarerepositionedaroundthem.
(prompt"\nSelectobjectstoanchor.")(setqss_anchor(ssget))
Thessgetfunctionpromptstheusertoselectobjectsandreturnsaselectionset.
4. Setcleanupvariablesusingtpm_varsetwiththeclean_var_idthatyouallocatedinstep2.Afewofthesevariablesspecifycleanupactions,butmostofthemspecifyhowcleanupactionswillbeperformed.
;setsomecleanupvariables(tpm_varsetclean_var_id"MAINTAIN_MARKERS"1)(tpm_varsetclean_var_id"CLEAN_TOL"4.21)(tpm_varsetclean_var_id"ANCHOROBJS_LAYERS""Layer1")
Beforesettingcleanupvariables,youcanloadacleanupprofileifyousavedonepreviously,andinthatwaysetmanyvariablesatonce.Usetpm_cleanprofileload.
(setqresult(tpm_cleanprofileloadclean_var_id"C:\\profile.dpf"))
Ifyouspecifyanexplicitlistofcleanupactions,notethatthosewillbetheonlyactionsperformed.CleanupactionsspecifiedbythevariablesNODE_ERROR,LINK_ERROR,andGENERALIZEwillbeignored,aswellasanysettingspecifictothemonly,suchasCORRIDOR's,whichdefinesthetoleranceforGENERALIZE.
Usinganactionlististhebestwaytospecifycleanupactions,becauseyoucanspecifytheorderinwhichtheyexecute,andyoucanincludethesameactionmorethanonce.Usingvariablestospecifycleanupactionsisanoldertechnique,whichisstillsupportedforthesakeofolderscripts,butitisdeprecatedfromAutoCADMap6onward.
NoteWhenyouinserttheSimplifyObjectsaction(cleangrouptype128),itisalwayslistedfirst,andyoucannotinsertitmorethanonce.
Withanexplicitlistofcleanupactions,notethatcertainindividualactionscanhaveindividualtolerancesettings(andinsomecases,othersettingsalso).SeeCleanupActionVariables.Whenyouareabouttoinsertanactionintotheactionlist,youcanusetpm_varsetwiththeaction_var_idthatyouallocatedinstep2tosetvariablesforthisactionbeforecallingtpm_cleanactionlistins.Youcancontinuallyresetandreusethesamesetofcleanupactionvariableswitheachactionthatyouinsert.
;insertacleanupactionintotheactionlist;firstsetatoleranceforthisaction(tpm_varsetaction_var_id"CLEAN_TOL"2.2);withtheactionlistreferencedbyclean_var_id...;*insertatthefirstposition(position0);*insertEraseShortObjects(action1);*withtheoptionsreferencedbyaction_var_id(tpm_cleanactionlistinsclean_var_id01action_var_id)
Atanypointwhileyouaresettingcleanupvariables,orafteryouhavefinished,youcansavethecurrentcleanupprofileusing
tpm_cleanprofilesave.
(setqresult(tpm_cleanprofilesaveclean_var_id"C:\\profile.dpf"))
NotethatsavedprofilesareXMLfiles.Youcanvieworedittheminatexteditorasyoucanwithsavedqueries(whichareAutoLISPscripts).SeeEditingQueryFiles.
5. Calltpm_cleaninittoaddcleanupvariablesandtheselectionsetofobjectstocleantothecleanupmodel.
(setqresult(tpm_cleaninitclean_idclean_var_idss_clean))
Ifyouhavecollectedaselectionsetofobjectstobeanchored,firstcalltpm_cleaninitanchorsetbeforecallingtpm_cleaninit.
(setqresult(tpm_cleaninitanchorsetclean_idclean_var_idss_anchor))
Thecleanupmodelisnowcomplete.
Toexecutethecleanup
1. Beginthecleanupprocesswithtpm_cleanstart.
(setqresult(tpm_cleanstartclean_id))
2. Executecleanupactions(processcleanupgroups)untilcleanupiscomplete.Witheachcleanupgroup,witheacherror,markandfixit.
(tpm_cleangroupnextclean_id)
(while(not(tpm_cleancompleteclean_id));counterrorsinthisgroup(setqi(tpm_cleangroupqtyclean_id));processeacherror(while(>=(setqi(1-i))0);withthecurrenterror(tpm_cleanerrorcurclean_idi);markit(tpm_cleanerrormarkclean_id);cleanit(tpm_cleanerrorfixclean_id))(tpm_cleangroupnextclean_id))
3. Updatethedrawingwithtpm_cleanend.
(tpm_cleanendclean_id)
Toclearthecleanupmodelwithoutupdatingthedrawing,usetpm_cleancancel.
BuildingaTopology
Thefollowingstepsdescribebuildingatopology.
Theresultingtopologyisloadedbutnotopen.
NoteForsimplicity,cleaningdrawingobjectsbeforebuildingthetopologyisomitted.SeeDrawingCleanup.
Tobuildatopology1. Allocatememoryfortopologyvariables.Thevariablesareinitializedto
theirdefaultvalues.
(setqvar_id(tpm_varalloc))
2. Setthetopologytype,name,anddescription.Thisexamplecodepromptsforthetopologytype.
(initget"noDeNetworkPolygon")(setqtyp(getkword"Selecttopologytype(noDe/Network/Polygon)<Exit>:"))(if(nulltyp)(prompt"\nNotopologytypeentered."))
3. Thenextstepistoincludeobjectsforthetopology(nodes,links,centroids),dependingonthetopologytype.Thiscoderepeatsthreetimestoincludeeachobjecttype.
Afterpromptingfornodeobjects,asshownhere,thisexamplepromptsforlinkandcentroidobjects.
Setupafiltertogettheobjectsyouwant.Someautomaticfilteringisperformedbyssget,whichplacestheobjectsinanAutoCADselectionset.Notethatyoumustincludedifferentobjecttypesforeachtypeoftopology.
;NodeobjectsarePOINT,TEXT,andINSERT(cond((=indx1)(setqfilter(list(cons-4"<OR")(cons0"POINT")(cons0"TEXT")(cons0"INSERT")(cons-4"OR>")))(prompt"\nSelectnodeobjects.")(setqss_nod(ssgetfilter)))
;LinkobjectsareLINE,PLINE,ARC,andCIRCLE((and(=indx2)(or(=typ"NETWORK")(=typ"POLYGON")))(setqfilter(list(cons-4"<OR")(cons0"LINE")(cons0"PLINE")(cons0"ARC")(cons0"CIRCLE")(cons-4"OR>")))(prompt"\nSelectlinkobjects.")
(setqss_lnk(ssgetfilter)))
;CentroidobjectsarePOINT,TEXT,andINSERT((and(=indx3)(=typ"POLYGON"))(setqfilter(list(cons-4"<OR")(cons0"POINT")(cons0"TEXT")(cons0"INSERT")(cons-4"OR>")))(prompt"\nSelectcentroidobjects.")(setqss_ctr(ssgetfilter))));cond);repeat
4. Buildthetypeoftopologyyouselectedinstep2,usingtpm_mntbuild.Thissampleusesaconditionaloperationtobuildthetopology.
Fortype1,anodetopology,tpm_mntbuildincludesonlynodes.
(cond((=typ"NODE")(setqresult(tpm_mntbuildvar_idnamedesc1ss_nod)))
Fortype2,anetworktopology,itincludesnodesandlinks.
((=typ"NETWORK")(setqresult(tpm_mntbuildvar_idnamedesc2ss_nodss_lnk)))
Fortype3,apolygontopology,itincludesnodes,links,andcentroids.
((=typ"POLYGON")(setqresult(tpm_mntbuildvar_idnamedesc3ss_nodss_lnkss_ctr))
Ifnoerrorsoccur,thetopologyisnowcomplete.
OpeningaTopology
Thefollowingnumberedstepsdescribehowtoloadandopenatopologyforreadaccess,getinformationaboutthetopology,andthencloseit.
Toopenatopology1. Promptforthetopologyname.
(setqname(getstring"\nEnterthetopologyname"))
2. First,useTopologyAccessfunctionstoseeifthetopologyisalreadyloadedand,ifnot,loadit.
Checktoseeifthetopologyisloadedwithtpm_acexist.
(setqresult(tpm_acexistnameTT))(ifresult(prompt"\nTopologyisalreadyloaded."))
UsingTforboththesourceandloadedparameterscausestpm_acexisttocheckfortopologiesinbothcurrentandsourcedrawingsthatarealreadyloadedinmemory.
3. Ifitisnotloaded,loaditwithtpm_acload.
(setqresult(tpm_acloadname))
Youcanaddcodeheretohandleerrorsorannouncesuccessfulloading.
4. Openthetopologyforreadaccess.Thetpm_acopenfunctionopensatopologyandcreatesanewtopology_ID(*)thatprovidesaccesstoit.Usingthenilvalueforthewrite_accessparametersetsaccesstoread.
(setqtpm_id(tpm_acopennamenil))
5. UseTopologyInformationfunctionstogetinformationaboutthetopology.
Getthedescriptionofthetopologywithtpm_infodesc.
(prompt(strcat"\nTopologydesc:"(tpm_infodesctpm_id)))
Getthetypeofthetopologywithtpm_infotype.
(prompt(strcat"\nTopologytype:"(itoa(tpm_infotypetpm_id))))
Testthetopologytoseeifitiscorrectwithtpm_infocorrect.
(if(tpm_infocorrecttpm_id)(prompt"\nTopologyiscorrect.")(prompt"\nTopologyisnotcorrect."))
Testthetopologytoseeifitiscompletewithtpm_infocomplete.
(if(tpm_infocompletetpm_id)
(prompt"\nTopologyiscomplete.")(prompt"\nTopologyisnotcomplete."))
Gettheversionofthetopologywithtpm_infoversion.
(prompt(strcat"\nTopologyversion:"(tpm_infoversiontpm_id)))
6. Closethetopology.
(tpm_acclosetpm_id)
Whenyouusetpm_acopentoopenortestthestatusofatopology,alwaysclosethetopologywithtpm_acclose.Otherwise,youruntheriskofleavingthetopologyopenwithmultipleIDspointingtoit.
EditingQueryFiles
Ifyouhavequeriesthatyouuseoften,youcansavetheminqueryfiles,whichyoucanmodifyandreuseasyouneedthem.Modifyinganexistingqueryratherthancreatinganewonecansaveyoutime.Thissectionshowsthecontentsofsometypicalqueryfiles.
LocationQuery
PropertyQueries
LocationQuerywithPropertyAlteration
LocationQuerywithPropertyAlteration:BeforeandAfter
ComplexQuery
Colors
ColorscanbespecifiedorreturnedasAutoCADcolorindexes(ACIs)ortruecolors.
Bytruecolorswemean24-bitcolor:threeRGBcomponents,8bitseach,withnoalphacomponent(thatis,notransparencyvalue).
ACIColors
ThevalidACIformatsare
ColorIndexes,integerstringsfrom0through256.Forexample,"123".Notethatindexes0and256donotspecifycolorsliterally,as1through255do,butlogically.See"LogicalColors"below.
ColorNames,whichcorrespondtoindexes1through7.Thecolornamesarered,yellow,green,cyan,blue,magenta,andwhite.Forexample,"yellow"(alwaysdouble-quoted).
LogicalColors,whichcorrespondtoindexes0and256.ThelogicalcolorsareByBlockandByLayer.Forexample,"ByBlock"(alwaysdouble-quoted).NotethatByBlockandByLayercanreturntruecolorsorACIs.
FormoreinformationaboutACIcolors,seeColorIndexColors.
TrueColors
Thevalidtrue-colorformatsare
RGBTriplets,whereeachcomponentisanintegerfrom0through255.Forexample,"255,0,0".RGBtripletsarewrappedindoublequotesexceptwhentheyareusedinqueryconditions,inwhichcasetheymustalwaysbewrappedinescapeddoublequotes('\"').See"ColorPatterns"below.
ColorBookColors,suchas"Pantone,123CVC",acompositeoftwocomma-separatednamesrepresentingaColorBookandacolorwithinit.Colorbookstringsarewrappedindoublequotesexceptwhentheyareusedinqueryconditions,inwhichcasetheymustalwaysbewrappedinescapeddoublequotes('\"').See"ColorPatterns"below.Andnomatterwheretheyareused,colorbookstringsmustalwaysbewrappedinescapeddoublequotesiftheycontaincertainspecialcharacters.Ifyouareunsureifacolorbookstringcontainsspecialcharacters,thereisnoharmwrappingitinescapeddoublequotesjusttobesure.
Expressions,suchas".COLOR"or".TRUECOLOR"(alwaysdouble-quoted).".COLOR"alwaysreturnsanACIcolor.Iftheselectedobject'scolorisatruecoloritreturnsthenearestACIequivalent.".TRUECOLOR"returnsatruecoloriftheselectedobject'scolorisatruecolor,oranACIifitscolorisanACI.Notethat".TRUECOLOR",andotherexpressionsthatcanreturntruecolors,returninvalidformatonlyifthetypeargumentof(ade_expreval)is"string".
ColorPatterns,comma-separatedlistsofcolorsinanyofthevalidformats,includingACIcolors,alwaysdouble-quoted.Colorpatternsareusedtoexpressmultiplecolorconditionsincompactformat.Considerthecolorpattern"red,green".Thepseudocodeexpression,color="red,green",islogicallyequivalentto(color="red")OR(color="green").Similarly,color<>"red,green"islogicallyequivalentto(color<>"red")AND(color<>"green").Becausecolorpatternsarecomma-separatedlists,ColorBookcolorsandRGBcolorsinqueryconditionsarealwaysboundedbyescapeddoublequotes('\"')becausetheyarethemselvescomma-separated.Forexample,thefollowingcolorpatternincludessixcolors:threeACIs,oneRGB,andoneColorBookcolor.
"12,34,56,\"12,34,56\",\"Pantone,123CVC\""
NoteYoucanusewildcardcharacterswhenyouspecifyamatchstringforColorBookcolors(butnotforRGBcolors).Forthisreason,anywildcardcharacterinaColorBookstringthatismeanttobetakenliterallymustbe
escapedusingabackquote,"`".Forexample,the"."characterinthefollowingstring,normallyawildcardmatchinganynon-alphanumericcharacter,ismeantasaliteral:"My`.Colors,Hot".
PropertyAlterationDefinitionSamples
Thefollowingexamplescomposepropertyalterationdefinitionsthatuserangetables.
(defunc:run_altpsample1();RangetableforColoris:;<15"green";<20"yellow";otherwise"red"(ade_rtdefrange"COLOR_RANGE""ColorRangeTable"'(("<"15"green")("<"20"yellow")("otherwise""""red")));RangetableforTextValueis:;<15"Small";<20"Medium";otherwise"Large"(ade_rtdefrange"TEXT_RANGE""TextValueRangeTable"'(
("<"15"Small")("<"20"Medium")("otherwise""""Large")));Thelayerofeachobjectwillbeusedtodeterminewhatvalue;fromtherangetableistobeused:;Clearoutanyexistingalterationdefinitions:(ade_altpclear);Nextdefinethecolorfortheobjectsbeingcreated:(ade_altpdefine"color""(range.layerCOLOR_RANGE)");Nextdefinethetextobjecttobecreatedforeachentity:(ade_altpdefine"textobject"'(("color""(range.layerCOLOR_RANGE)")("textvalue""(range.layerTEXT_RANGE)")));Forfill,usethefollowingpropertyalterationfunctions(ade_altpdefine"hatch"'(("pattern""(range.layerTEXT_RANGE)")("color""(range.layerCOLOR_RANGE)")))(princ))
(defunc:run_altpsample2();Rangetableforpatternis:(ade_rtdefrange"PATTERN_RANGE""HatchPatternRangeTable"'(("<"15"Earth")("<"20"Grass")("otherwise""""Swamp")));RangetableforColoris:(ade_rtdefrange"COLOR_RANGE""ColorRangeTable"'(("<"15"green")("<"20"yellow")("otherwise""""red")));Rangetableforscaleis:(ade_rtdefrange"SCALE_RANGE""HatchScaleRangeTable"'(("<"15"25")("<"20"50")("otherwise""""100")));RangetableforAngleis:(ade_rtdefrange"ANGLE_RANGE""HatchAngleRangeTable"'(("<"15"45")
("<"20"90")("otherwise""""0")));Thelayerofeachobjectwillbeusedtodeterminewhichvalue;fromtherangetableistouse;Clearoutanyexistingalterationdefinitions:(ade_altpclear);Forfill,usethefollowingpropertyalterationfunctions(ade_altpdefine"hatch"'(("pattern""(range.layerPATTERN_RANGE)")("scale""(range.layerSCALE_RANGE)")("rotation""(range.layerANGLE_RANGE)")("color""(range.layerCOLOR_RANGE)")))(princ))
(defunc:run_altpsample3();Rangetableforsymbolnameis:(ade_rtdefrange"SYMBOL_RANGE""SymbolNameRangeTable"'(("<"15"Sym1")("<"20"Sym2")("otherwise""""Sym3")))
;Rangetableforscaleis:(ade_rtdefrange"SCALE_RANGE""SymbolScaleRangeTable"'(("<"15"5")("<"20"10")("otherwise""""50")));RangetableforColoris:(ade_rtdefrange"COLOR_RANGE""ColorRangeTable"'(("<"15"green")("<"20"yellow")("otherwise""""red")));Thelayerofeachobjectwillbeusedtodeterminewhich;valuefromtherangetabletouse;Clearoutanyexistingalterationdefinitions:(ade_altpclear);Forfill,usethefollowingpropertyalterationfunctions:(ade_altpdefine"blockname""(range.layerSYMBOL_RANGE)")(ade_altpdefine"scale""(range.layerSCALE_RANGE)")(ade_altpdefine"color""(range.layerCOLOR_RANGE)")(princ))
MoreSamples
TherearedozensofVisualLISPsamplesintheSamplefolderofyourAutoCADMapinstallation.
UsingAutoLISPFunctions
TowriteAutoLISPprograms,usetheVisualLISPIDE.Youdonotneedacompiler,becauseAutoCADMapincludesaninterpreterthatprocessesAutoLISPsourcecodedirectly.
OptionalParameters
IfanAutoLISPfunctionhasoptionalparameters,theyareenclosedinsquarebracketsinthefunctionprototype.Ifaparameterisoptional,youcanomititsargumentifnoargumentsfollow.
A-lists
Theterma-listusedinAutoLISPfunctiondescriptionsdenotesanassociationlist,alsocalledadottedpair.Itlookslikethis:
(property.value)
Forexample,intheexpression
(ade_altpdefine"textobject"'(("color"."yellow")("textvalue".".Layer")))
thesub-expression("color"."yellow")isana-list,andsois("textvalue".
".Layer").
InvokingDataExtensionCommands
YoucaninvokealmostanyDataExtensioncommandusingtheAutoLISPexpression,(command"_.ADE[XX]"...).TheexceptionsareADEDEFCRDSYS,ADEZEXTENTS,ADEEDITDATA,andADEATTACHDATA.YoucannotinvokethesecommandsfromwithinADSRXorVisualLISP.FortheADEKEYVIEWcommand,onlytheRedisplayoptionissupportedwhenADSRXorVisualLISPisactive.
IncompleteExecutionofFunctions
IfanAutoLISPfunctionthatperformsasequenceoftasksfailspartwaythroughitsexecutionandreturnsanerrorcode,thetasksitcompletedcorrectlyareundone.Forexample,ade_qrysetcondmodifiesaquerycondition.Ifyoucallthisfunctionanditisnotabletomodifyeverycomponentofthecondition,thecomponentsitdidmodifyarereturnedtotheiroriginalstates.
NumericIdentifiers
AutoLISPfunctionsworkwithnumericidentifiers(IDs).Theirtypeisreal.
Forexample,whenyouuseade_dslisttolistthedrawingsattachedtothecurrentdrawing,thefunctionreturnsalistofIDs,notdrawingnames.Togetadrawingname,youcallade_dwggetsettingwithtwoarguments:"dwgname"(thesettingyouwanttoknowabout)andthedrawingID.
TopologyfunctiondocumentationusesanumberofdifferentkindsofIDs.SeeTopologyIDsforanannotatedlist.AlthoughtheseIDsareallthesametype,ade_id,wegivethemdifferentnamesinthedocumentationaccordingtotheirpurpose.
TypographicConventions
Thisdocumentationusesthefollowingtypographicconventions.
TypographicConventions
Textelement Description Example
boldsansserif Textyouenter Atthecommandprompt,enter(ade_dslist).
italic Namesoffilesanddirectories
c:\map\map_api.hlp
monospacefont APIpropernames,inlinesamplecode
Theexpression("color"."yellow")...
[]squarebrackets Optionalparametersinfunctionprototypes
(tpm_iterstart[source][loaded])
NoteAllfilenamesanddirectorypathsinAutoCADMaparecasesensitive.
tpm_cleanactionlistgetatCleanupFunctions
Getsthecleanupactionatagivenlistposition.
(tpm_cleanactionlistgetatclean_var_idindexaction_var_id)
Returnsacleanupactionasacleangrouptype(integer)or0onerror:seetpm_cleangrouptypeforalistoftypes.
clean_var_id CleanupvariablesID(real)returnedbytpm_varalloc
index Listpositiontoaccess(integer)
action_var_id CleanupactionvariablesID(real)returnedbytpm_varalloc
Theclean_var_idargumentreferencespropertiesforthecleanupoperationthatyouarepreparingtoinitiate(seeCleanupVariables).Thesepropertiesincludetheactionlist.
Theindexargumentisazero-basedpositionintheactionlist.Avaluegreaterthanorequaltothelistsizeorlessthan0returnsanerror.
Theaction_var_idargumentreferencespropertiesaffectingthespecificcleanupactionthatyouaregetting(seeCleanupActionVariables).Usetpm_vargetortpm_varlisttoreadthemaftercallingtpm_cleanactionlistgetat.
tpm_cleanactionlistinsCleanupFunctions
Insertsacleanupactionintheactionlist.
(tpm_cleanactionlistinsclean_var_idindexactionaction_var_id)
ReturnsTornil.
clean_var_id CleanupvariablesID(real)returnedbytpm_varalloc
index Wheretoinsertinthelist(integer)
action Cleanupactiontoinsert(integer),acleangrouptype:seetpm_cleangrouptypeforalistoftypes.
action_var_id CleanupactionvariablesID(real)returnedbytpm_varalloc
Theclean_var_idargumentreferencespropertiesforthecleanupoperationthatyouarepreparingtoinitiate(seeCleanupVariables).Thesepropertiesincludetheactionlist.
Theindexargumentisazero-basedpositionintheactionlist,or-1forthelastposition.Avaluegreaterthanorequaltothelistsizeorlessthan-1istakenas-1.
NoteWhenyouinserttheSimplifyObjectsaction(cleangrouptype128),itisalwayslistedfirst,andyoucannotinsertitmorethanonce.
Theaction_var_idargumentreferencespropertiesaffectingthespecific
cleanupactionthatyouareinserting(seeCleanupActionVariables).Usetpm_varsettosetthembeforecallingtpm_cleanactionlistins.
ADSRXEquivalent
inttpm_cleanactionlistins
ade_idclean_var_id,longindex,intaction,ade_idaction_var_id);
ReturnsRTNORMoranerrorcode.
tpm_cleangrouptypeCleanupFunctions
Determinesthetypeofthecurrentgroup.
(tpm_cleangrouptypeclean_id)
Returnsatypecodeornil.
clean_id ModelIDreturnedbytpm_cleanalloc
TypeCodes
1 Eraseshortobjects
2 Breakcrossingobjects
4 Extendundershoots
8 Deleteduplicates
16 Snapclusterednodes
32 Dissolvepseudonodes
64 Erasedanglingobjects
128 Simplifyobjects
256 Zerolengthobjects
512 Apparentintersections
1024 Weedpolylines
tpm_cleancreatedssCleanupFunctions
Getscreatedentitiesfollowingadrawingcleanup.
(tpm_cleancreatedssclean_id)
Returnsaselectionset.
clean_id CleanupmodelID(real),returnedbytpm_cleanalloc.
Thisfunctionreturnsentitiesthatwerecreatedduringthecleanupprocess.
NoteCallthisfunctionaftercallingtpm_cleanend,whichconcludesthecleanupprocess.Ifyoucallthisfunctionearlier,itreturnsaselectionsetfromthepreviouscleanuportheemptyselectionset.
tpm_cleanmodifiedssCleanupFunctions
Getschangedentitiesfollowingadrawingcleanup.
(tpm_cleanmodifiedssclean_id)
Returnsaselectionset.
clean_id CleanupmodelID(real),returnedbytpm_cleanalloc.
ThisfunctionreturnsmembersoftheIncludesetthatwerechangedduringthecleanupprocess.
NoteCallthisfunctionaftercallingtpm_cleanend,whichconcludesthecleanupprocess.Ifyoucallthisfunctionearlier,itreturnsaselectionsetfromthepreviouscleanuportheemptyselectionset.
tpm_cleanunchangedssCleanupFunctions
Getsunchangedentitiesfollowingadrawingcleanup.
(tpm_cleanunchangedssclean_id)
Returnsaselectionset.
clean_id CleanupmodelID(real),returnedbytpm_cleanalloc.
ThisfunctionreturnsmembersoftheIncludesetthatwerenotchangedduringthecleanupprocess.NotethatitdoesnotreturnmembersoftheAnchorset,whichareunchangedbydefinition.
NoteCallthisfunctionaftercallingtpm_cleanend,whichconcludesthecleanupprocess.Ifyoucallthisfunctionearlier,itreturnsaselectionsetfromthepreviouscleanuportheemptyselectionset.
tpm_tracebestrouteNetworkTracingFunctions
Calculatesthebestround-triproute.
(tpm_tracebestroutetpm_idtrace_idnode0node1...noden)
ReturnsatopologyID(real)representingthebestrouteornil.
tpm_id TopologyID(real)representingthenetworkyouareanalyzing
trace_id TracingmodelID(real)returnedbytpm_tracealloc
node0 ElementID(real)ofthestartandendnode
node1...noden ElementIDs(real)ofthenodestovisit
Thebestroutetopology,whoseIDthisfunctionreturnsifsuccessful,isassignedanarbitrarynameandisopenforread.Togetitsname,usetpm_infoname.Tochangeitsname,usetpm_mntrename.
Forthebestroutetracetosucceed,thetotalcalculatedresistancecannotbegreaterthanthevaluesetforthemaximumresistanceorlessthanthevaluesetfortheminimumresistance.Seetpm_tracesetmaxresandtpm_tracesetminres.Theaccumulatedresistancevalueisthetotalresistanceofthenodesandlinksthatmakeupthebestroute.
Typicalusage:
(setqbestroute(tpm_tracebestroutetpm_idtrace_id7.01.04.010.05.06.09.0))
where7.0istheelementIDofthestartandendnodeandtheremainingargumentsareelementIDsofthenodestovisit.(ElementIDsarereturnedbytpm_traceelemid.)
ADSRXEquivalent
ade_idtpm_tracebestroute
ade_idtpm_id,ade_idtrace_id,structresbuf*nodes);
ReturnsatopologyIDorADE_NULLID.
Thelistofnodesisimplementedasaresbufchain,whichyoucancreatelikethis:
structresbuf*nodes;//nodeliststructresbufrb0,rb1,..,rbN;//resbufelementsade_idnode0,node1,..,nodeN;//nodestoanalyze//gettracingelementIDsforthenodes//thatwewillanalyzeandassignthemto//node0,node1,..,nodeN...rb0.restype=RTLONG;rb0.resval.rlong=node0;rb0.rbnext=&rb1;rb1.restype=RTLONG;
rb1.resval.rlong=node1;rb1.rbnext=&rb2;...rbN.restype=RTLONG;rbN.resval.rlong=nodeN;rbN.rbnext=NULL;nodes=&rb0;
tpm_tracebestroutescanNetworkTracingFunctions
GetstheelementIDofalinkornodeinthebestroute.
(tpm_tracebestroutescantrace_idflag)
ReturnsanelementID(real)ornil.
trace_id TracingmodelID(real)returnedbytpm_tracealloc
flag Pathelementcode(integer):0=Currentelement1=Firstelement2=Lastelement3=Nextelement4=Previouselement
Firstusetpm_tracebestroutetocalculatethebestroute.
ADSRXEquivalent
ade_idtpm_tracebestroutescan
ade_idtrace_id,intflag);
ReturnsaelementIDorADE_NULLID.
tpm_tracebestroutevalNetworkTracingFunctions
Calculatestheresistanceofthebestroute.
(tpm_tracebestroutevaltrace_id)
Returnsaresistancevalue(real)ornil.
trace_id TracingmodelID(real)returnedbytpm_tracealloc
Firstusetpm_tracebestroutetocalculatethebestroute.
ADSRXEquivalent
inttpm_tracebestrouteval
ade_idtrace_id,ads_real*resist);
ReturnsRTNORMoranerrorcode.
resist Resistance
TheADSRXfunctionpassestheresistanceofthebestroutethroughaparameterinsteadofreturningitastheAutoLISPfunctiondoes.
ColorIndexColors
Validcolorindexvaluesareintegersfrom0through256.Youcanalsousecolornamesorthelogicalcolors,ByBlockandByLayer.
AutoCADMapalsosupportstruecolor.
NamedColors
Indexes1through7arethenamedcolors.Youcanspecifyanyofthesecolorsbynameorbyindex.Index7,thecolornamedwhite,displaysaswhiteorblackdependingonbackgroundcolor.
Index Name
1 Red
2 Yellow
3 Green
4 Cyan
5 Blue
6 Magenta
7 White
NoteYoucanspecifyACIcolorsinqueryconditionsusingcolornamesorcolorindexes.Butifyouretrievesuchacondition,ACIcolorsarealwaysreportedas
colorindexes,becausethatishowtheyarestored,eveniftheywereoriginallyspecifiedwithcolornames.However,thisisnotthecasewithcolorpatterns.Ifyouretrieveaconditionusingacolorpattern,whetheritcontainscolorindexes,colornames,orboth,thecolorpatternisreportedasitwasoriginallyspecified.
OtherColors
Indexes8and9(adarkgrayandalightgray),togetherwiththenamedcolors,arecollectivelythestandardcolors.Indexes0and256(thelogicalcolors,ByBlockandByLayer)invoketherelevantblockandlayercolorsrespectively.NotethatByBlockandByLayercanreturnACIsortruecolors.
Formoreinformation1. InAutoCADMap,clickFormat>Color.2. IntheSelectColordialogbox,clickHelp.
ade_prefgetvalOptionFunctions
GetsanAutoCADMapoptionsetting.
(ade_prefgetvalvariable)
Returnsanoptionsettingornil.
variable Optionname(string).SeetheOptionstablesbelow.
Thefunctionreturnvaluedependsonwhichoptionyouspecify.Thetablesbelowshowoptionnamesandreturnvalues,organizedbyoptiontype.
WorkSessionOptions
RestoreLastActiveDwgsOnStartup Tornil.
ActivateDwgsOnAttach Tornil.
DontAddObjectsToSaveSet Tornil.
MarkObjectsForEditingWithoutPrompting Tornil.
LogFileActive Tornil.
LogFileName Filename(string).Forexample,"ade.log".
LogMessageLevel 0,1,or2.
QueryOptions
QueryFileDirectory. Path(string).Forexample,"c:\\data\\qry".
CaseSensitiveMatch. Tornil.
SaveCurrQueryInSession. Tornil.
MkSelSetWithQryObj Tornil.
DefaultJoinOperator 1=OR,2=AND.
ColorForAdd Color(string).
ColorForRemove Color(string).
BlockLocnForQuery 1=insertionpoint,2=boundingbox.
TextLocnForQuery 1=insertionpoint,2=boundingbox.
ShowBlockAsInsPt Tornil.
ShowImageAsBoundary Tornil.
CreateAssociativeHatchObjects Tornil.
ReferenceBoundaryForAreaLocation Tornil.
SaveBackOptions
RedefineBlockDefinitions Tornil.
RedefineLayerDefinitions Tornil.
RedefineTextStyleDefinitions Tornil.
RemoveUnusedGroups Tornil.
EraseSavedBackObjects Tornil.
RemoveLockAfterSave Tornil.
CreateHistoryFileOfChanges Tornil.
CreateBackupFileOfSourceDwg Tornil.
ExternalDatabaseOptions
NoOfSQLConditionsInHistory integer.
DisplayTabsInSingleView Tornil.
OpenDataViewReadOnly Tornil.
SaveDataViewFmtChanges Tornil.
ReconnectDbOnWSOpen Tornil.
ShowFullDBPath Tornil.
KeepDataViewOnTop Tornil.
dbfDatabases string,oneofthefollowing:"Prompt","DB3","DB4","DB5","FOX2.0","FOX2.5",or"FOX2.6".
xlsDatabases string,oneofthefollowing:"Prompt","Excel3","Excel4","Excel5",or"Excel7".
dbDatabases string,oneofthefollowing:"Prompt","Paradox3.0","Paradox4.0",or"Paradox5.0".
CoordinateTransformationOptions
CoordinateTransformationOptions
AdjustSizesAndScalesForChangesInUnits Tornil.
AdjustRotationsForMapDistortions Tornil.
AdjustSizesAndScalesForMapDistortions Tornil.
AdjustElevations Tornil.
AdjustZeroRotationObjects Tornil.
.
SystemOptions
AccessWorkCenter Tornil.
CheckoutDirectory Path(string).Forexample,"c:\\data\\dwg"or""ifnone.
PreserveAWCFiles Tornil.
ForceUserLogin Tornil.
EnableObjectLocking Tornil.
ReadPrefFromINI Tornil.
NumberofOpenDwgs integer
DoublePrec real,0orgreater,butlessthan1.
The"ForceUserLogin"and"DoublePrec"systemoptionscannotbemodifiedunlessyourenduserhassuperuserprivileges.
If"DoublePrec"issetto0,thebehaviorofdataextensionqueriesisthesameasbeforeintroducingthisoption.The"DoublePrec"optionhasnouserinterfaceequivalent.
WorkspaceOptions
CheckClasses Tornil.
CheckDrawings Tornil.
CheckQueryLibrary Tornil.
CheckDatabases Tornil.
CheckTables Tornil.
CheckQueries Tornil.
CheckTopologies Tornil.
CheckLPNs Tornil.Notethatlinkpathnames(LPNs)havebeenreplacedbylinktemplatesinAutoCADMap.
ShowOPMOnStartup Tornil.
ShowWSpaceOnStartup Tornil.
WSpaceDockingView Tornil.
WSpaceWindowRect Alistoffourvalues(integer)thatdefinetheleft,top,right,andbottomofthewindowrectangle.
Databasetablesanddatabasequerycategoriesarevisibleintheworkspaceonlyif"CheckTables"and"CheckQueries"aresettoTand"CheckDatabases"issettoTalso.
Thefollowingworkspaceoptionsarereadonly.Thatis,theycanbeusedonlywithade_prefgetvaltodetermineifacategoryisvisibleintheworkspace.
Read-OnlyWorkspaceOptions
ClassesVisible Tornil.
DrawingsVisible Tornil.
QueryLibraryVisible Tornil.
DatabasesVisible Tornil.
TablesVisible Tornil.
QueriesVisible Tornil.
TopologiesVisible Tornil.
LPNsVisible Tornil.
ade_prefsetvalOptionFunctions
SetsanAutoCADMapoption.
(ade_prefsetvalvariablevalue)
ReturnsTornil.
variable Optionname(string)
value Valueappropriateforthegivenoption(typevaries).
Seeade_prefgetvalforalistofoptionnamesandvalues.
Thefollowingexamplesets"ColorForAdd"to"red".
(ade_prefsetval"ColorForAdd""red")
ade_altpdefinePropertyAlterationFunctions
Createsapropertyalterationexpression.
(ade_altpdefinepropertyvalue)
ReturnsapropertyalterationexpressionIDornil.
property Propertytoalter(string).SeetheAlterablePropertiestablebelow
value Newvalue(typevaries),orarangetableexpression(string)thatdeterminesthenewvalue.SeeUsingaRangeTablelaterinthistopic.
Alistofoneormorepropertyalterationexpressionsconstitutesapropertyalterationdefinition.Ifthereisacurrentpropertyalterationdefinitionwhenyoucreateapropertyalterationexpression,thenewexpressionisaddedtoit.WhenyouexecuteaDrawquery,eachqueriedentityisalteredinaccordwiththecurrentpropertyalterationdefinition.
Thefollowingtableliststhealterableproperties:
AlterableProperties
blockname Blockname(string)
color Color(string)
elevation Zcoordinate(point)intheusercoordinatesystem
height Textheight(real)
layer Layername(string)
linetype Linetype(string)
rotation Rotation(real)
scale Scalingfactor(real).Forexample,1.2=120%
style Textstyle(string)
width Linewidth(real)
textvalue Textvalue(string)
thickness Thickness(real)
hatch Listofdottedpairsthatdefinethehatchproperties.SeeHatchpropertiesbelow
textobject Listofdottedpairsthatdefinethetextobjectproperties.SeeTextobjectpropertiesbelow
Toaddahatchpatterntoeachqueriedentity,aslongasitisaclosedpolygon,specify"hatch"forthepropertyargument.Thevalueargumentisthenalistofdottedpairs.Eachdottedpairiscomposedofahatchpropertyandastringvalue.
HatchProperties
pattern Hatchpatternname(string)
scale Scalingfactor(string).Forexample,"1.2"=120%
rotation Rotationofthehatchpattern(string)
layer Nameofthelayerthatcontainsthehatchpattern(string)
color Hatchpatterncolor(string)
Tocreateatextobjectforeachqueriedentity,specify"textobject"forthepropertyargument.Thevalueargumentisthenalistofdottedpairs.Eachdottedpairiscomposedofatextobjectpropertyandastringvalue.Thevalueelementinthedottedpaircanbeanexplicitvalueorarangetableexpressionthatdeterminesavalue.
TextObjectProperties
textvalue Texttodisplay(string)
height Textheight(string)
inspt Pointwheretextisinserted(expressionasastring)
justify Textalignment(string).Forexample,"center".
style Textstyle(string)
layer Nameofthelayeronwhichthetextobjectresides(string)
color Textcolor(string)
rotation Rotationofthetextobject(string)
Thepropertyalterationexpressiondefinedby
(ade_altpdefine"color""red")
changesthecolorofeachqueriedentitytored.
Thepropertyalterationexpressiondefinedby
(ade_altpdefine"textobject"'(("color"."yellow")("textvalue".".Layer")))
createsatextobjectforeachqueriedentity.Eachtextobjectisyellow,anditstextvalueisthelayeronwhichtheentityresides.
Alongerpropertyalterationexpressionforatextobject:
(ade_altpdefine"textobject"(list(cons"Textvalue"".Layer")(cons"Justify""MIDDLE")(cons"Inspt"".CENTER")(cons"Style""STANDARD")(cons"Height""1.0")(cons"Rotation""0.0")(cons"Color""BYLAYER")))
Apropertyalterationexpressionforahatch:
(ade_altpdefine"hatch"(list(cons"Pattern""USER")(cons"Scale""1.0")(cons"Rotation""45.0")(cons"Layer""Query_Hatch")(cons"Color""BYLAYER")))
UsingaRangeTable
Insteadofsupplyinganexplicitvalueargumentwhenyoucallade_altpdefine,youcansupplyarangetableexpressionthatreferencesanexistingrangetable.Notethatthisexpressionisastringvalue.Itmustbeenclosedinquotes.
Arangetableexpressionhasthefollowingformat:
(rangereferencertname)
RangeTableExpressionParameters
range Therangekeyword.Allrangetableexpressionsbeginwithrange.Itisnotquoted.
reference Referenceproperty,suchas.Coloror.Layer.Itisnotquoted.
rtname Rangetablename.Canbeupto31characterslong.Mustbeunique,containnospaces,andstartwithanalphanumericcharacter.Itisnotquoted.
Therangetableexpressionusesitsincludedrangetabletoprocessthevalueofthereferencepropertyandreturnanewpropertyvalue.Forexample,thefollowingcode(1)usesade_rtdefrangetodefinearangetable,(2)referencestherangetableinarangetableexpression,andthen(3)suppliestherangetableexpressionasthevalueargumentinanade_altpdefinecall.
Firstwedefinearangetable:
(ade_rtdefrange"rt_def""Changeallexceptredtoyellow"'(("="11)("OTHERWISE"""2)))
Thenwereferencethisrangetableinarangetableexpression,whichassertsthattherangetablewilllookatthe.Colorpropertyofeachqueriedentitytodetermineiftheentity'scolorwillbealteredandwhatcoloritwillbe.
(setqpropVal"(range.Colorrt_def)")
Finally,weusetherangetableexpressioninsteadofanexplicitpropertyalterationvalueinacalltoade_altpdefine.
(ade_altpdefine"color"propVal)
ThenexttimeaDrawqueryisexecutedwithPropertyAlterationineffect,thecolorofeachqueriedentityisaltereddependingonitscurrentcolorandinaccordancewiththerulesembeddedintherangetableanditsenclosingrangetableexpression.
Thefollowingexampleusesrealvalues:
(ade_rtdefrange"rt_def""Setrotation"'(("="45.90.)("OTHERWISE"""45.)))
Foranotherexample,youcouldrewritethe"textobject"examplecitedearliertousearangetable.
(adertdefrange"labelWaterOnly"""'(("=""Water""Water")("OTHERWISE""""")))(ade_altpdefine"textobject"'(("color"."yellow")("textvalue"."(range.LayermyRangeTable)")))
Thefollowingexampleexecutesalocationquerybasedonacircledefinedbytheuser.Itincludespropertyalterationbasedonarangetable.Thecolorofeachqueriedentity,ifitisnotalreadyred,ischangedtoyellow.
(ade_qryclear)(ade_qrysettype"draw")(ade_dwgzoomextents)
(prompt"\nQueryLOCATIONbyCIRCLE:")(setqc_cen(getpoint"\nCenterofcircle:")c_radp(getpointc_cen"\nRadiusofcircle:")c_rad(distancec_cenc_radp)qry_cond(list"circle""inside"c_cenc_rad)qry_id(ade_qrydefine"""""""location"qry_cond""))(if(nullqry_id)(prompt"\nERROR:Querydefinitionfailed.")(progn(ade_altpclear);Definetherangetable(ade_rtdefrange"rt_def""Changeallexceptredtoyellow"'(("="11)("OTHERWISE"""2)));Referencetherangetableinarangetable;expression;notethatit'sallonestring(setqpropVal"(range.Colorrt_def)"(if(or(null(ade_altpdefine"color"propVal))(null(ade_qrysetaltpropT)))(prompt"\nERROR:Alterpropertiesdefinitionfailed.")(if(=0.0(ade_qryexecute))(prompt"\nERROR:Noobjectsfound."));if);if);progn);if
ade_altpgetpropPropertyAlterationFunctions
Getsapropertyalterationexpression.
(ade_altpgetpropaltp_id)
ReturnsapropertyalterationexpressionIDornil.
altp_id PropertyalterationexpressionID(real)
Seeade_altpdefineforinformationaboutpropertyalterationexpressions.
ade_altpsetpropPropertyAlterationFunctions
Modifiesapropertyalterationexpression.
(ade_altpsetpropaltp_idpropertyvalue)
ReturnsTornil.
altp_id PropertyalterationexpressionID(real)
property Propertytoalter(string)
value Newvalue(typevaries).
Seeade_altpdefineforinformationaboutpropertiesandvalues.
ade_qrydefineQueryFunctions
Definesaquery.
(ade_qrydefinejoinopbggroupsnot_opcondtypeqrycondendgroups)
ReturnsaconditionIDornil.
joinop Ajoiningoperator:"and"or"or"or""(none).If""(none)isspecified,thedefaultjoiningoperatorisused(seeade_prefgetval).
bggroups Forgroupingthisconditionwithothersinthequerydefinitionyouarebuilding.Useoneormoreopenparenthesesasneeded,or""(none).Forexample,"((".
not_op TheNOToperator,ifneeded:"not"or""(none).
condtype Aconditiontype:"Location","Property","Data",or"SQL".
qrycond Aconditionexpression.Dependsontheconditiontype.SeeConditionExpressionsbelow.
endgroups Forgroupingthisconditionwithothersinthequerydefinitionyouarebuilding.Useoneormorecloseparenthesesasneeded,or""(none).Forexample,"))".
Aquerydefinitioniscomposedofoneormoreconditions,eachdefinedbyaseparateade_qrydefinecall.Youcangroupconditionsbysupplying
parenthesesoremptystringstothebggroupsorendgroupsparametersasneeded.
Youmustspecifyallsixade_qrydefinearguments.
ConditionExpressions
Theqrycondparameterrequiresaconditionexpression.Conditionexpressionsarelists.Whatyouincludeinthelistdependsontheconditiontype:Location,Property,Data,orSQL.
LocationExpressionsPropertyExpressionsDataExpressionsSQLExpressions
ade_qrygetcondQueryFunctions
Getsaconditionofthecurrentquery.
(ade_qrygetcondcondition_id)
Returnsaqueryconditionornil.
condition_id QueryconditionID(real)
Seeade_qrydefineforinformationaboutqueryconditions.
ade_qrysetcondQueryFunctions
Replacesaquerycondition.
(ade_qrysetcondcondition_idcondition)
ReturnsTornil.
condition_id QueryconditionID(real)toreplace.
condition Newquerycondition(alist).Seeade_qrydefine.
Thisfunctionaffectsthecurrentquery.
Youcannotaltergroupingwiththisfunction.Anygroupingyouspecifyisignored.Togrouporungroup,useade_qrygrouporade_qryungroup.
PropertyExpressions
Propertyexpressionsareusedasquerycondargumentsinade_querydefinecallsthatdefinePropertyconditions.
Theyhavethefollowingformat:
(propertyoperatorvalue[subclasses])
PropertyExpressionParameters
property Propertyname(string).SeethePropertyandValueArgumentstablebelow.
operator "=",">","<","<=",">=","<>".Notethattheonlyvalidoperatorinastringcontextis"=".
value Dependsonthepropertyargument.SeethePropertyandValueArgumentstablebelow.
subclasses Optional.Tornil.Thedefaultiftheargumentisomittedisnil.Thissettinghasnoeffectunlesspropertyis"feature".Tmeansreturnallobjectsbelongingtothefeatureclassidentifiedbythevalueargument,includingobjectsbelongingtoanysubclassofthatfeature.nilmeansdonotincludeobjectsbelongingtosuchasubclass.
PropertyandValueArguments
Property Value
area Areavalue(string).
blockname Blockname(string).
color Color(string).
elevation Zcoordinate(string).
"feature" Featurename(string).
group Groupname(string).
layer Layername(string).
length Length(string).
linetype Linetype(string).
"lineweight" Lineweight(string).
"plotstyle" Plotstyle(string).
style Textstyle(string).
thickness Thickness(string).
objtype Objecttype(string),or"unknown".
value Textvalue(string).
PropertyExpressionExamples
ThefollowingexamplesdefinePropertyconditions.Thefirstspecifiesalayer:
(setqqry_id(ade_qrydefine'("and""""""property"("layer""=""WATER")"")
))
Andthesecondspecifiesacolor:
(setqqry_id(ade_qrydefine'("or""(""not""property"("color""=""RED")"")))
DataExpressions
Dataexpressionsareusedasquerycondargumentsinade_querydefinecallsthatdefineDataconditions.
Theyhavethefollowingformat.
(datatypetablename.fieldnameoperatorvalue[subclasses])
DataExpressionParameters
datatype Datatypetomatch(string):"objdata","attrib","aselink","EED",or"feature".
tablename Dependsonthedatatypeargument.SeetheTablenameAndFieldnameArgumentstablebelow.
fieldname Dependsonthedatatypeargument.SeetheTablenameAndFieldnameArgumentstablebelow.
operator Comparisonoperator(string):"=",">","<","<=",">=",or"<>".Notethattheonlyvalidoperatorinastringcontextis"=".
value Valuetomatch.
subclasses Optional.Tornil.ThedefaultiftheargumentisomittedisT.Thissettinghasnoeffectunlessdatatypeis"feature".Tmeansreturnobjectsbelongingtothefeatureclass
identifiedbythetablenameargument,includingobjectsbelongingtoanysubclassofthatfeature.nilmeansdonotincludeobjectsbelongingtosuchasubclass.
Thetablenameandfieldnameargumentsdependonthedatatypeargument:
TablenameandFieldnameArguments
datatype tablename fieldname
objdata Tablename. Fieldname.
attrib Blockname. Attributedefinition.
aselink Linktemplate. Columnname.
EED RegAppname. EEDfieldname.
feature FeatureClassname. Propertyname.
DataExpressionExamples
ThefollowingexamplesdefineDataconditionsofvarioustypes.
(ade_qrydefine'("""""""Data"("attrib""*.Type""=""c*")""))
(ade_qrydefine'("""""""Data"("objdata""mytable.fl1""=""1")""))
(ade_qrydefine'("""""""Data"("aselink""cpu_lpn.cpu""=""MAC2LC")""))
(ade_qrydefine'("""""""Data"("EED""REGAPP.STREET""=""Willow")""))
(ade_qrydefine'("""""""Data"("EED""REGAPP.#NUMBER""=""512")""))
(ade_qrydefine'("""""""Data"("EED""REGAPP.&SQLLINK;""=""MAC2LC")""))
Noteinthelastexamplethat&SQLLINKisnottreatedasalinktemplatekey.ItistreatedjustlikeanyotherADE1.0EEDfield.Forexample,ifanobjecthasEEDsuchas
(-3(1000."&EEDFIELD;"="1234"))
thentheDataconditiontoretrievetheobjectiswrittenasfollows:
("EED""REGAPP.&EEDFIELD;""=""1234")
IftheEEDisdefinedby
(-3(1000."&EEDFIELD;"="'First','Last'"))
thentheDataconditiontoretrievetheobjectiswrittenasfollows:
("EED""REGAPP.&EEDFIELD;""=""'First','Last'")
Inotherwords,everthingaftertheequalsignistreatedasonestring.Thatwayyoucanuseanypattern(forwcmatch)inthequery.
ade_aliasaddDriveAliasFunctions
Createsadrivealias.
(ade_aliasaddalias_namepath_name)
ReturnsTornil.
alias_name Aliasname(string).Canbeupto31characterslong.Mustbeunique,containnospaces,andstartwithanalphanumericcharacter.
path_name Driveandpathtowhichthealiasrefers(string).
Thefunctionaddsanewdrivealiastothedrivealiaslist.Forexample:
(ade_aliasadd"tutor""c:\\tutorials\\drawings")
ade_aliasdeleteDriveAliasFunctions
Deletesadrivealias.
(ade_aliasdeletealias_name)
ReturnsTornil.
alias_name Aliasname(string);canbeupto31characterslong.Mustbeunique,containnospaces,andstartwithanalphanumericcharacter.
ade_aliasgetlistDriveAliasFunctions
Listsalldrivealiasesintheproject.
(ade_aliasgetlist)
Returnsthelistofdrivealiasesornil
Thelistofdrivealiasesisalistofa-lists.Eacha-listdisplaysthealiasnameandthedriveandpathtowhichitrefers.
ade_aliasupdateDriveAliasFunctions
Changestheactualpathofadrivealias.
(ade_aliasupdatealias_namepath_name)
ReturnsTornil.
alias_name Aliasname(string)canbeupto31characterslong.Mustbeunique,containnospaces,andstartwithanalphanumericcharacter.
path_name Newactualpathforthisdrivealias(string).
ade_altpclearPropertyAlterationFunctions
Clearsthecurrentpropertyalterationdefinition.
(ade_altpclear)
ReturnsTornil.
Apropertyalterationdefinitionisalistofoneormorepropertyalterationexpressions.Seeade_altpdefineforinformationaboutpropertyalterationexpressions.
ade_altpdelpropPropertyAlterationFunctions
Deletesapropertyalterationexpression.
(ade_altpdelpropaltp_id)
ReturnsTornil.
altp_id PropertyalterationexpressionID(real)
ade_altplistPropertyAlterationFunctions
ListstheIDsofthecurrentpropertyalterationexpressions.
(ade_altplist)
ReturnsalistofpropertyalterationIDsornil.
Thislistofpropertyalterationexpressionsreturnedbythisfunctionconstitutesthecurrentpropertyalterationdefinition.
ade_dsattachDrawingSetFunctions
Attachesadrawingtotheprojectdrawing.
(ade_dsattachdwgname)
ReturnstheIDoftheattacheddrawingornil.
dwgname Pathaliasandfilename(string)
ThisfunctionreturnsanIDevenifthedrawingdoesnotexist.Asystemadministratorcanusethisfunctiontodefineadrawingsetbeforethedrawingfilesitreferencesarecreatedorinstalled.Adrawingmustexistbeforeyoucanmakeitactive.
(ade_aliasadd"dwg_drive""d:\\myproject\\mydir")(setqdwg_id(ade_dsattach"dwg_drive:\\mydrawing.dwg"));checkifdrawingwassuccessfullyattached(ifdwg_id;checkifitreturnedanID(princ"\nSuccessfullyattached.")(princ"\nDidnotattach."))
ade_dsdetachDrawingSetFunctions
Detachesadrawingfromtheproject.
(ade_dsdetachdwg_id)
ReturnsTornil.
dwg_id DrawingIDtodetach(real)
Thefollowingcodedetachesthedrawingattachedintheade_dsattachexample:
(if(ade_dsdetachdwg_id);checkifitreturnedT(princ"\nSuccessfullydetached.")(princ"\nDidnotdetach."))
ade_dsisnestedDrawingSetFunctions
Checksifadrawinghasnesteddrawings.
(ade_dsisnested[dwg_id])
ReturnsTifthedrawinghasdrawingsattached,ornil.
dwg_id DrawingID(real)
Verifythatthedrawinginquestionisactivebeforecallingade_dsisnested.Itisnotpossibletodetermineifaninactivedrawinghasnesteddrawings.Ifdwg_idisnotspecifiedorisnil,thefunctioncheckstheprojectdrawingtoseeifithasdrawingsattached.
;GetIDsofdrawingscurrentlyattached(setqds_ids(ade_dslist));Seeifthefirstonehasnesteddrawings(princ"\nFirstdrawinghas"(if(ade_dsisnested(cards_ids))(princ"drawingsattached.")(princ"nodrawingsattached."))
ade_dslistDrawingSetFunctions
Liststhedrawingsattachedtoagivendrawing.
(ade_dslist[dwg_id[nested]])
ReturnsalistofdrawingIDsornil.
dwg_id DrawingID(real)ornil
nested Drawingisnestedornot.Values:Tornil
Ifthedwg_idargumentisomittedornil,thefunctionreturnsdrawingIDsforthedrawingsattachedtotheproject.
Ifyousupplyanestedargumentotherthannil,thefunctionincludesdrawingsthataredirectlyattachedandallnesteddrawingsateverylevelbelowthem.Otherwise,itincludesonlydrawingsthataredirectlyattached.
(setqds_ids(ade_dslist))
ade_dsproplistDrawingSetFunctions
Listsallvaluesfoundinthedrawingsetforagivendrawingproperty.
(ade_dsproplistproperty)
Returnsalistofvaluesornil.
property Drawingproperty(string).SeeDrawingPropertiesbelow.
Thefunctionsearchesallactivesourcedrawingsandreturnsalistofthevaluesitfindsforthegivendrawingproperty.
Thefollowingtableshowspropertynamesandreturnvalues.
DrawingProperties
object_type AutoCADobjecttypes(string)
blockname Blocknames(string)
linetype Linetypenames(string)
textstyle Textstylenames(string)
attrib Attributenametags(string)
extents Computedextents:thelower-leftandupper-rightpointsinthesetofactivesourcedrawings.Forexample:((2.202864.99866)(20.468912.3563))
group Groupnames(string)
layer Layernames(string)
lpn Linktemplates(string).Notethatlinkpathnames(LPNs)havebeenreplacedbylinktemplatesinAutoCADMap.
objdata Namesofobjectdatatables.Tablenamescanbeupto25characterslong(string).Mustbeunique,containnospaces,andstartwithanalphanumericcharacter
mlinestyle Mlinestyle(string)
feature Featurename(string)
lineweight Lineweight(string)
plotstyle Plotstyle(string)
Thiscodereturnsalistoflayersinthedrawingset.
(ade_dsproplist"layer")
ade_dwgactivateDrawingFunctions
Activatesadrawing.
(ade_dwgactivatedwg_id)
ReturnsT,ifthedrawingisalreadyactive,ornil.
dwg_id DrawingID(real)
Youcanattachadrawingthatdoesnotyetexist,butyoucannotactivateit.Seeade_dsattach.
ade_dwgactualpathDrawingFunctions
Returnstheactualpathforadrawing.
(ade_dwgactualpathdwg_id)
Returnsthefullpath(withoutanalias)ofthespecifieddrawingornil.
dwg_id DrawingID(real)
ade_dwgaliaspathDrawingFunctions
Returnsthealiaspathforadrawing.
(ade_dwgaliaspathdwg_path)
Returnsthealiaspathofthespecifieddrawingornil.
dwg_path Actualpathofthedrawing(string)
ade_dwgattriblistDrawingFunctions
Returnsalistofattributetagsforthespecifiedblockname.
(ade_dwgattriblistdwg_idblock_name)
Returnsalistofattributetagsornil.
dwg_id DrawingID(real)
block_name Blocknameforwhichtogetattributetags(real)
Thisfunctionreturnsalistoftheattributetags,givenablocknamefromthespecifieddrawing.
ade_dwgdeactivateDrawingFunctions
Deactivatesadrawing.
(ade_dwgdeactivatedwg_id)
ReturnsTornil.
dwg_id DrawingID(real)
Thiscodedeactivatesallthedrawingsinthedrawingset:
(foreachdwg_id(ade_dslist)(ade_dwgdeactivatedwg_id))
Thiscodeusesthemapcarfunctiontodeactivatethedrawingsinthedrawingset.
(mapcar'ade_dwgdeactivate(ade_dslist))
ade_dwggetidDrawingFunctions
GetsthedrawingIDofadrawing.
(ade_dwggetiddwg_pathname)
ReturnsadrawingID(real)ornil.
dwg_pathname Pathaliasanddrawingfilename(string)
Codeexample:
(ade_aliasadd"mydwgs""d:\\myproject\\mydrawing")(setqdwg_id(ade_dwggetid"mydwgs:\\mydrawing.dwg"))
ade_dwggetsettingDrawingFunctions
Getsadrawingsettingvalue.
(ade_dwggetsettingdwg_idsetting)
Returnsthevalueofthegivendrawingsettingornil.
dwg_id DrawingID(real)
setting Drawingsettingname(string).SeeDrawingSettingNamesbelow
DrawingSettingNames
SettingName ReturnValue
dwgname Drawingname(string);apathaliasandfilename,suchas"myfiles:\\mydwg.dwg”
dwgdesc Drawingdescription(string)
t_scale Simpletransformscale(real.Forexample,1.2=120%
t_rotate Simpletransformrotationdirection.ValuedependsontheAutoCADANGDIRsetting(real).Values:0=counterclockwise1=clockwise
t_xoffset SimpletransformXoffset(real)
t_yoffset SimpletransformYoffset(real)
t_apply Flagvalue(integer).Values:1=applyallsimpletransformationsdefinedforthegivendrawing0=donotapplytransformations
saveback Savebackcoordinates,asequenceofcornerpoints,inthisorder:lowerleft,lowerright,upperright,upperleft,separatedby"."
Thefollowingcodegetsthenameofthefirstdrawinginthelistofattacheddrawings:
(setqdwg_id(car(ade_dslist)))(ade_dwggetsettingdwg_id"dwgname")
Thereturnvalueisadrawingpathname,forexample,
"c:\\drawings\\mydwg.dwg"
ade_dwghaslocksDrawingFunctions
Checksifadrawinghaslockedobjects.
(ade_dwghaslocksdwg_id)
ReturnsTifthedrawinghaslockedobjects,ornil.
dwg_id DrawingID(real)
ade_dwgindexDrawingFunctions
Createsorremovesindexesforagivensetofdrawings.
(ade_dwgindexdwgIds)
ReturnsTornil.
dwgID ListofdrawingIDsforwhichindexeswillbecreated.
Callstoade_dwgindexdefaddindexoperationstotheindexoperationlist.Callingade_dwgindexexecutestheindexoperationsinthelist.Iftheindexoperationlistisempty,ade_dwgindexhasnoeffectandreturnsnil.
Thefollowingexamplecreateslocationandpropertyindexesforeachattacheddrawing:
;cleartheindexoperationslist(ade_dwgindexdefnil)
;adda'createlocationindex'operationtothelist(ade_dwgindexdef"location"1)
;adda'createpropertyindex'operationtothelist(ade_dwgindexdef"property"1)
;executethegivenindexoperationsforeachattacheddrawing(mapcar'ade_dwgindex(ade_dslist))
ade_dwgindexdefDrawingFunctions
Addsoperationstotheindexoperationslist.
(ade_dwgindexdefindextype[indexoper][indexparams])
ReturnsTornil.
indextype Typeofindex(string):"location","property","eed","sqllinks","objdata",ornil,wherenilmeansremoveall.
indexoper Operation(integer):1=create,0=remove.Omitthisargumentifindextypeisnil.
indexparams Listofobject-datatablesandfieldstoincludeintheindexifindextypeis"objdata",orniltoincludeall.Addthisargumentonlyifindextypeis"objdata".
Callstoade_dwgindexdefaddoperationstotheindexoperationslist.Callingade_dwgindexexecutestheindexoperationsinthelist.Iftheindexoperationlistisempty,ade_dwgindexhasnoeffectandreturnsnil.
Examples
(ade_dwgindexdefnil)Removeallindexes.
(ade_dwgindexdef"location"1)Createalocationindex.
(ade_dwgindexdef"location"0)Removethelocationindex.
(ade_dwgindexdef"property"1)Createapropertyindex.
(ade_dwgindexdef"property"0)Removethepropertyindex.
ObjectDataExamples
(ade_dwgindexdef"objdata"1nil)Createanobjectdataindexthatincludesallobjectdata.
(ade_dwgindexdef"objdata"0nil)Removeallobjectdatafromtheobjectdataindex.
(ade_dwgindexdef"objdata"1'(("TABLE")))CreateanobjectdataindexthatincludesallfieldsinTABLE.
(ade_dwgindexdef"objdata"0'(("TABLE")))RemoveallfieldsinTABLEfromtheobjectdataindex.
MoreObjectDataExamples
(ade_dwgindexdef"objdata"1'(("TABLE""FIELD1")))
(ade_dwgindexdef"objdata"0'(("TABLE""FIELD1")))
(ade_dwgindexdef"objdata"1'(("TABLE""FIELD1""FIELD2")))
(ade_dwgindexdef"objdata"0'(("TABLE""FIELD1""FIELD2")))
(ade_dwgindexdef"objdata"1'(("TABLE1")("TABLE2""FIELD1")))
(ade_dwgindexdef"objdata"0'(("TABLE1")("TABLE2""FIELD1")))
ade_dwgisactiveDrawingFunctions
Checksifadrawingisactive.
(ade_dwgisactivedwg_id)
ReturnsTornil.
dwg_id DrawingID(real)
ThefunctionreturnsTifthespecifieddrawingisactive.IfthedrawingisnotactiveorthedrawingIDisinvalid,thefunctionreturnsnil.
ade_dwgistoplevelDrawingFunctions
Checksifadrawingisdirectlyattachedtotheprojectdrawing.
(ade_dwgistopleveldwg_id)
ReturnsTifthedrawingisattacheddirectlytotheprojectdrawing,ornil.
dwg_id DrawingID(real)
ade_dwgproplistDrawingFunctions
Listsallvaluesfoundinadrawingforagivendrawingproperty.
(ade_dwgproplistdwg_idproperty)
Returnsalistofthevaluesforthedrawingproperty,ornil.
dwg_id DrawingID(real)
property Propertyname(string).SeePropertyNamesbelow
Thefunctionsearchesthegivendrawingandreturnsalistofthevaluesitfindsforthegivendrawingproperty.
PropertyNames
Name ReturnValue
object_type AutoCADobjecttypes(string)
blockname Blocknames(string)
linetype Linetypenames(string)
textstyle Textstylenames(string)
attrib Attributetagnames(string)
extents Computedextents.Themostlower-leftpointandthemost
upper-rightpointinthedrawingForexample:((2.202864.99866)(20.468912.3563))
group Groupnames(string)
layer Layernames(string)
lpn Linktemplates(string).Notethatlinkpathnames(LPNs)havebeenreplacedbylinktemplatesinAutoCADMap
objdata Namesofobjectdatatables(string)
mlinestyle Mlinestyle(string)
feature Featurename(string)
lineweight Lineweight(string)
plotstyle Plotstyle(string)
Thefollowingcodeidentifiesthelastdrawingattachedtotheprojectdrawingandreturnsalistofitslayers.
(setqdwg_id(last(ade_dslist)))(ade_dwgproplistdwg_id"layer")
Thereturnedlisthastheform
("water""sewer""electric")
ade_dwgquickviewDrawingFunctions
Displaysaquickviewofadrawing.
(ade_dwgquickviewdwg_id)
ReturnsTornil.
dwg_id DrawingID(real)
Thefollowingcodedisplaysquickviewsofalldrawingsintheproject.
(foreachdwg_id(ade_dslist)(if(not(ade_dwgquickviewdwg_id))(princ(strcat"\nProblemviewingdrawing:"(ade_dwggetsettingdwg_id"dwgname")))))
ade_dwgselectdlgDrawingFunctions
DisplaystheSelectDrawingsdialogbox.
(ade_dwgselectdlg[parent[caption]])
Returnsalistofselecteddrawings,eachrepresentedbyitsaliaspath(string),ornilifnodrawingsareselected.
parent IntegervaluedefiningthepointertotheSelectDrawingsdialogboxparentwindow,whichisexpectedtoberepresentedbyaCWndobject.0meansthattheparentwindowisnotdefined.
caption AstringthatisshownbeforethecurrentdirectoryinthecaptionoftheSelectDrawingsdialogbox.
ade_dwgsetofDrawingFunctions
Identifiesthedrawingstowhichagivendrawingisattached.
(ade_dwgsetofdwg_id)
ReturnsalistofdrawingIDs(real)ornil.
dwg_id DrawingID(real)
Youcannotusethisfunctiontocheckifadrawingisattachedtotheprojectdrawing.Useade_dwgistoplevelinstead.Ifadrawingisattachedtoboththeprojectdrawingandtootherdrawings,thisfunctionreturnsalistoftheIDsoftheotherdrawingsonly.
ade_dwgsetsettingDrawingFunctions
Setsadrawingsettingvalue.
(ade_dwgsetsettingdwg_idproplist)
ReturnsTifsuccessfulandthedrawingisactive,ornil.
dwg_id DrawingID(real).
proplist Listcomposedofasettingnameandavalue(string).SeeSettingNamesbelow.
SettingNames
Settingname Value
dwgname Drawingname(string);afullpathname,suchasc:\\drawings\\mydwg.dwg.
dwgdesc Drawingdescription(string)
t_scale Simpletransformscale(real).Forexample,1.2=120%
t_rotate Simpletransformrotation(real);rotationdirectiondependsontheAutoCADANGDIRsetting
t_xoffset SimpletransformXoffset(real)
t_yoffset SimpletransformYoffset(real)
t_apply Flagvalue(integer).Values:1=applyallsimpletransformationsdefinedforthegivendrawing0=donotapplytransformations
saveback Savebackcoordinates,asequenceofcornerpoints,inthisorder:lowerleft,lowerright,upperright,upperleft,separatedby"."
Thefollowingcodesampleusesthe"saveback"valueoftheproplistparameter—asequenceofcornerpoints:lowerleft,lowerright,upperright,upperleft.
(setqdwg_id(car(ade_dslist)))(ade_dwgsetsettingdwg_id'(("dwgdesc"."SampleDrawingDescription")))(ade_dwgsetsettingdwg_id'(("saveback".((2.202864.99866)(20.46894.99866)(20.468912.3563)(2.2028612.3563)))))
ade_dwgunlockDrawingFunctions
Removesallobjectlocksfromadrawing.
(ade_dwgunlockdwg_id)
ReturnsTornil.
dwg_id DrawingID(real)
Usingthisfunctionrequiressuperuserprivileges.
ade_dwgzoomextentsDrawingFunctions
Zoomstotheextentsoftheactivedrawings.
(ade_dwgzoomextents)
ReturnsTornil.
ade_editdefcenObjectEditingFunctions
Definesanewlabelpointforanobject.
(ade_editdefcenenamept)
ReturnsTornil.
ename AutoCADentityname.
pt Labelpoint,alistofrealvaluesdefinedin2Dor3Dpoint(point)
Usethisfunctionwithpropertyalterationifthecurrentlabelpointisnotsuitableforthetextobjectyouareadding.
Thefollowingexamplesetsthelabelpointofthelastobjectto(5,5).
(setqpt1'(55))(setqent1(entlast))(ade_editdefcenent1pt)(ade_expreval(entlast)".labelpt""point")
ade_editlockederasedObjectEditingFunctions
Getstheobjectsinthesavesetthathavebeenerased.
(ade_editlockederased)
Returnsaselectionsetornil.
Theseareobjectsthatwereerasedintheprojectdrawingandarenowqueuedforsavebacktosourcedrawings.
(setqss_erased(ade_editlockederased))
ade_editislockedObjectEditingFunctions
Getslockinformationaboutanobjectifitislocked.
(ade_editislockedename)
Returnsalistoflockinformationaboutthespecifiedobjectiflocked,orifnotlocked,thennil.
ename AutoCADentityname.
Thelistoflockinformationreturnedbythisfunctioncontainsthefollowingstrings,inorder:
Loginnameoftheuserwholockedtheobject.Nameandpathofthedrawingthatcontainstheobject.Datetheobjectwaslocked.Timetheobjectwaslocked.Nameandpathoftheprojectdrawing.
Forexample:
("login""c:\\path\\drawing.dwg""7/1/2000""9:58:36AM""c:\\path\\project.dwg")
YoucanchangetheformatofthedateandtimestringsthroughoptionsintheInternationaldialogboxintheMicrosoftWindowsControlPanel.
ade_editlockedObjectEditingFunctions
Getstheobjectsinthesavesetthathavebeenmodifiedorarenew.
(ade_editlocked)
Returnsaselectionsetornil.
Theseareobjectsthatweremodifiedintheprojectdrawingoraddedtoitandarenowqueuedforsavebacktosourcedrawings.
(setqss_modified(ade_editlocked))
ade_editlockobjsObjectEditingFunctions
Locksasetofobjectsandaddsthemtothesaveset.
(ade_editlockobjssel_set)
Returnsthenumberofobjectslocked(real)ornil.
sel_set Selectionsetname.
Thefunctionlockstheobjectscontainedinthedesignatedselectionset.Lockingtheseobjectsaddsthemtothesaveset.
Itisagoodideatocomparethenumberofobjectslockedwiththenumberofobjectsinthedesignatedselectionset.Ifthenumberlockedislessthanthenumberintheselectionset,anerroroccurredinthelockingprocess,andyoushouldchecktheerrorstack.
Thefollowingexamplecreatesaselectionset,addsitsobjecttothesaveset,andcheckstheresult.
(entmake'((0."circle")(62.1)(1012.02.00.0)(40.1.0)));Getthenewentity.(setqe(entlast));Createaselectionsetcontaininge.
(setqss(ssadde));Checkhowmanyobjectsinss.(setqnum_tolock(sslengthss));Locktheobjectsinssandgetthenumberlocked.(setqnum_locked(fix(ade_editlockobjsss)));Fixtruncatestherealreturnvalueof;ade_editlockobjs.(if(equalnum_tolocknum_locked)(progn(princ"\nObjectslocked"(princ"andaddedtosaveset:")(princnum_locked))(princ"\nUh-oh"))
ade_editnewObjectEditingFunctions
Getstheobjectsinthesavedsetthatarenew.
(ade_editnew)
Returnsaselectionsetornil.
Theseareobjectsthatwereaddedtotheprojectdrawingandarenowqueuedforsavebacktosourcedrawings.
(setqss_modified(ade_editnew))
ade_editunlockobjsObjectEditingFunctions
Unlocksasetofobjectsandremovesthemfromthesaveset.
(ade_editunlockobjssel_set)
Returnsthenumberofobjectsunlocked(real),ornil.
sel_set Selectionsetname.
Thefunctionunlockstheobjectsinthespecifiedselectionset.Iftheselectionsetisnil,thefunctionunlocksallerasedobjects.Unlockingobjectsremovesthemfromthesaveset.
ade_entsetlocationOtherFunctions
Setsanewentitylabelpoint
(ade_entsetlocationenamept)
ReturnsTornil
ename AutoCADentityname.
pt Newlabelpointlocation,a2Dor3Dpoint(point)
Thisfunctionsetsanewlabelpointforanobject.Anobject'slabelpointisthestartingpositionfortextaddedduringaquerypropertyalteration.Bydefault,thecentroidoftheobjectisthelabelpoint.
Thisfunctionsetsthelabelpointasdefinedbythepointargument.
ade_errclearErrorMessageFunctions
Clearstheerrorstack.
(ade_errclear)
ReturnsTornil.
ade_errcodeErrorMessageFunctions
Getstheerrorcodeforagivenerrorinthestack.
(ade_errcodeerr_index)
Returnsanerrorcode(integer)ornil.
err_index Positionoftheerrorinthestack(integer),where0=firsterror
ade_errgetlevelErrorMessageFunctions
Getsthesystemerrorlevel.
(ade_errgetlevel)
Returnsanerrorlevel(integer)ornil.
Thesystemerrorleveldetermineswhicherrortypesarepushedtothestack.
ErrorLevels
0 Allerrorsarepushed.
1 Allerrorsexceptwarningsanddiagnosticsarepushed(theirtypesarelistedbelow).
2 Noerrorsarepushed.
Thefollowingerrortypesaresuppressediftheerrorlevelis1.
SuppressedErrorTypes
01 kAdeWarning ADE(AutoCADDataExtension)executionwarning.
03 kAseWarning ASE(AutoCADSQLExtension)executionwarning.
05 kAcWarning AutoCADexecutionwarning.
07 kAsiWarning ASI(AutoCADSQLInterface)executionwarning.
09 kIRDWarning Extendedobjectdata(Xdata)warning.
16 kDiagMessage Diagnosticmessagereturned.
Errorsthatarenotpushedtotheerrorstackarenotdisplayedintheerrordialogintheuserinterface,andtheyarenotaccessiblebyanyerrormessagefunction.
Theerrorlevelmanagedbyade_errgetlevelandade_errsetlevelhasnothingtodowiththeerrorlevelmanagedbyade_prefgetvalandade_prefsetval(theworksessionpreference,LogMessageLevel).Thelatteraffectswhichtypesofmessagearewrittentothelogfile.
Theerrorlevelisnotsavedwhenasessionends.Whenasessionbegins,theerrorlevelisalways0.
ade_errmsgErrorMessageFunctions
Getstheerrormessageforagivenerrorinthestack.
(ade_errmsgerr_index)
Returnsanerrormessage(string)ornil.
err_index Positionoftheerrorinthestack(integer),where0=firsterror.
ade_errpushErrorMessageFunctions
Pushesanerrortothestack.
(ade_errpush[err_code][level]message)
ReturnsTornil.
err_code Errorcode(detailsbelow).
level Errorlevel(string).Values:"warning","error"(default),ortheemptystring.Iftheemptystring,theerrorlevelis"error".
message Errormessage(string).
Ifyourapplicationwillusecustomerrorcodes,definearangeforthemthatdoesnotconflictwithanyrangeusedforAutoCADMaperrorcodes.Tospecifyageneralerror,lettheerr_codeargumentbe1(kAdeErr).
Thevalidlevelvalues,"warning",and"error",correspondrespectivelytothefollowingerrortypes:
1 kAdeWarning
2 kAdeError
Foralistofallerrortypes,includingthetwothatarevalidlevelvalues,seeErrorTypes.
Thefollowingexamplepushesanerrortothestack.
(ade_errpush1"error""messagetext")
ade_errpushstatementErrorMessageFunctions
PushesafaultySQLstatementtotheerrorstack.
(ade_errpushstatementstatementposition)
ReturnsTornil.
statement Faultystatementthatcausedtheerror(string)
position Startingpositionoftheerrorinthefaultystatement(integer).Position1correspondstothefirstcharacter.
Thisfunctionisdesignedtoadddiagnosticinformationtoanerroryouhavejustpushed.Itisassociatedwiththelatesterrorinthestackonly.Acalltoade_errpushstatementmakessenseonlyifacalltoade_errpushimmediatelyprecedesit.
ade_errqtyErrorMessageFunctions
Returnsthenumberoferrorsinthestack.
(ade_errqty)
Returnsanerrorcount(integer)ornil.
ade_errsetlevelErrorMessageFunctions
Setsthesystemerrorlevel.
(ade_errsetlevellevel)
ReturnsTornil.
level Errorlevel(integer):0,1,or2
Seeade_errgetlevelfordetails.
ade_errshowdlgErrorMessageFunctions
DisplaystheMapMessagesdialogbox.
(ade_errshowdlg)
ReturnsTornil.
Iftherearenoerrorsormessagesintheerrorstack,thedialogboxdoesnotdisplay,andthefunctionreturnsnil.
ade_errstatementErrorMessageFunctions
GetsthefaultySQLstatementforagivenerrorinthestack.
(ade_errstatementerr_index)
ReturnsthefaultySQLstatementwitherrorpositionornil.
err_index Positionoftheerrorinthestack(integer)0=firsterror
TheSQLstatementanderrorpositionarereturnedinthefollowingformat.
(faulty_statementerr_pos)
Thefaulty_statementstringquotesthefaultySQLstatementthatcausedtheerror.Theerr_posvalueidentifiesthestartingpositionoftheerrorinthefaultystatement.Position1isthefirstcharacterofthestatement.
Theexpression(ade_errstatement2),whichreferencesthethirderrorinthestack,couldreturn
("xxx"6)
where"xxx"isthefaultystatementand6tellsyouthatthetroublebeginsatthesixthcharacter.
ade_errtypeErrorMessageFunctions
Getsthetypeofagivenerrorinthestack.
(ade_errtypeerr_index)
Returnsanerrortype(integer)ornil.
err_index Positionoftheerrorinthestack(integer),where0=firsterror.
ade_expreval
Evaluatesanexpression.
(ade_expreval[ename]exprtype)
Returnsthevalueoftheexpressionornil.
ename Optionaldrawingobjectname.Requirediftheexpressionusesobjectpropertiesordata.
expr Expressiontoevaluate(string)
type Expectedreturntype(string):"short","long","real","string",or"point".
Iftheexpressionusesobjectpropertiesordata,youmustspecifythenameofadrawingobject.Forexample,ifthetheexprargumentis"(+56)",noenameargumentisrequired,buttoevaluate"(+".COLOR"6)"youneedanobjecttosupplythecolor.
Thefollowingexamplegetstheareaofaselectedobject:
(setqmyobject(car(entsel"Selectanobject:")))(setqvalue(ade_exprevalmyobject".area""real"))
Dependingonwhatyouspecifyforthetypeargumentintheprecedingexample,theresultcanbeanintegerorastring,asthefollowingtwoexamples
demonstrate.Supposetheareaofmyobjectis2.7.Thefirstexpressionreturnsthisareaas2;thesecondreturnsitas"2.7".
(ade_exprevalmyobject".area""short")
(ade_exprevalmyobject".area""string")
NoteIftheexprargumentisanintegercalculationandyousupply"string"forthetypeargument,theresultingstringdoesnotcontainaninteger,butareal.Forexample,thefollowingexpressionreturns"2.0",not"2".
(ade_expreval"(+11)""string")
Ifyouwantthestringtocontainaninteger,includethefixfunctionintheexprargument.
(ade_expreval"(fix(+11))""string")
Theade_exprevalfunctioncanreturnanintegerstringsolongasthereturnvalueisnottheresultofanintegercalculation.Forexample,thefollowingcodereturnsanintegerstringwithoutusingfix.
(setqobj(car(entsel"Selectanobject:")))(setqobjcolor(ade_exprevalobj".color""string")))
Togetthecentroidandthelayernameofthesameobject,addtheselines:
(setqobjcentr(ade_exprevalobj".centroid""point"))(setqobjlayer(ade_exprevalobj".layer""string"))
ade_keycolumnlistSQLEnvironmentFunctions
Returnsalistofthekeycolumnnamesforthespecifiedlinktemplate.
(ade_keycolumnlistlinktemplate)
Returnsalistofkeycolumnnamesornil.
linktemplate Linktemplate(string)
FormoreinformationaboutlinktemplatesandusingSQL,seetheAutoCADonlinedocumentation.
ade_odaddfieldObjectDataFunctions
Addsfieldstoatable.
(ade_odaddfieldtabnamefieldlist)
ReturnsTornil.
tabname Tablename(string)canbeupto25characterslong.Mustbeunique,containnospaces,andstartwithanalphanumericcharacter
fieldlist Listoffieldstoadd.Asequenceoffielddefinitions.
Asequenceoffielddefinitionsisintroducedbythestring"columns".Eachfielddefinitionisalistofa-lists,andeacha-listconsistsofafieldpropertyandavalue,asfollows:
Fieldproperty Value
colname Fieldname(string)canbeupto31characterslong.Mustbeunique,containnospaces,andstartwithanalphanumericcharacter.
coldesc Fielddescription(string)
coltype Fielddatatype
defaultval Defaultfieldvalue
Thefunctionaddsfieldstothetableandtoeachofitsrecords.Ineachrecord,thenewfieldsareassigneddefaultvaluesinaccordwiththeirfielddefinitions.Thefunctionhasnoeffectonexistingfields.Inotherwords,thefunctionaddsfieldstoeachsetofobjectdatadefinedbythetableandattachedtoanobject.
Foranexample,seeAddingFieldstoaTable.
ade_odaddrecordObjectDataFunctions
Attachesdatatoanobject.
(ade_odaddrecordenametable)
ReturnsTornil.
ename AutoCADobjectname.
table Tablename(string)canbeupto25characterslong.Mustbeunique,containnospaces,andstartwithanalphanumericcharacter
Attachingdatatoanobjectisalsocalledattachingatabletoanobject.Thisfunctionattachesanewrecordinaspecifictabletoaspecificobject.Typically,arecordcontainsinformationaboutwhateveritisthattheobjectrepresents.Forexample,ifalineinadrawingrepresentsasectionofpipeinawatersystem,anattachedrecordcouldcontaininformationaboutthatsection.
Whenanewrecordisattached,itsfieldscontaindefaultvaluesthatcorrespondtotheirfielddefinitions.Togetafieldvalue,useade_odgetfield;tochangeit,useade_odsetfield.Fielddefinitionsareincludedinthetabledefinition.Seeade_oddefinetabforinformationabouttabledefinitions.
Youcanattachmorethanonerecordtothesameobjectwithadditionalcallstoade_odaddrecord.Theadditionalrecordscanbemembersofthesameordifferenttables.Ifanobjecthasonlyonerecordfromagiventable,thenumberofthatrecordis0.Ifyouattachasecondrecordfromthesametable,thenumber
ofthatrecordis1,andsoon.Useade_odrecordqtytofindhowmanyrecordsofagiventableareattached.
Forexample,ifasectionofwaterpipeisinspectedatintervals,youcouldattachanumberofrecordsoftheWATERINSPECTIONtabletothesamelineintheWATERdrawing,andeachrecordcouldcontaintheresultofadifferentinspection.
ade_odattachrecordObjectDataFunctions
Attachesanewrecordtoanobject.
(ade_odattachrecordenamerec_id)
ReturnsTornil.
ename AutoCADobjectname.
rec_id RecordIDreturnedbyade_odnewrecord
ade_oddefinetabObjectDataFunctions
Createsanobjectdatatable.
(ade_oddefinetabtab_defn)
ReturnsTornil.
tab_defn Listoftableelements:thetablename,thetabledescription,andasequencefielddefinitions.
Thetablenameisspecifiedbyana-list:
("tablename"."NEWTABLE")
Thenamemustbeunique,containnospaces,andstartwithacharacter.Thenamecanbeupto25characterslong.
Thetabledescriptionisspecifiedthesameway,exceptthatspacesareallowed:
("tabledesc"."NewSampleTable")
Thefielddefinitionsareintroducedbythestring,"columns".Atleastonefielddefinitionisrequired.Eachfielddefinitionisalistofa-lists,andeacha-listconsistsofafieldpropertyandavalue,asfollows:
Fieldproperty Fieldname
colname Fieldname(string)canbeupto31characterslong.Mustbeunique,containnospaces,andstartwithanalphanumericcharacter
coldesc Fielddescription(string)
coltype Fielddatatype
defaultval Defaultfieldvalue
Thefollowingcodecreatesatable.
;Definenewtable(setqtabldefn'(("tablename"."NEWTABLE")("tabledesc"."NewSampleTable")("columns";Defineafield(("colname"."FIELD1")("coldesc"."Field1Description")("coltype"."character")("defaultval"."DefaultValue"));Definemorefieldsasneeded...;Foranexampleofdefiningfields,click .)));Createthenewtable(ade_oddefinetabtabldefn)
Hereisanotherexampleofcreatingatable.
(setqpt1"2,2")(ade_oddefinetab(list'("tablename"."valve_id")'("tabledesc"."ValveStorage")(list"columns"(list'("colname"."LOCATION")'("coldesc"."Valve_id")'("coltype"."point")(cons"defaultval"pt1))))
ade_oddeletefieldObjectDataFunctions
Deletesfieldsfromatable.
(ade_oddeletefieldtabnamefieldlist)
ReturnsTornil.
tabname Tablename(string)canbeupto25characterslong.Mustbeunique,containnospaces,andstartwithanalphanumericcharacter
fieldlist Listoffieldnames(string)
Thefunctiondeletesthefieldsfromthetableandfromeachofitsrecords.Thedatacontainedinthesefieldsisalsodeleted.Inotherwords,itdeletesthefieldsandtheirdatafromeachsetofobjectdatadefinedbythetableandattachedtoanobject.
NoteThefieldlistargumentforade_oddeletefieldisalistoffieldnamesonly.Inthecompanionfunctions,ade_odaddfieldandade_odmodifyfield,itisalistoffielddefinitions.
Theade_oddeletefieldfunctionaffectsallactivedrawingsinthedrawingset.Thereshouldnotbeanyqueriedobjectsforthisoperation.
NoteThisfunctionwillnotoperateunlessyourenduserhassuperuserprivileges.
Thefollowingcodedeletesthreefieldsfromatable.
(ade_oddeletefield"table1"'("field1""field2""field3"))
ade_oddeletetabObjectDataFunctions
Deletesatable.
(ade_oddeletetabtabname)
ReturnsTornil.
tabname Tablename(string)canbeupto25characterslong.Mustbeunique,containnospaces,andstartwithanalphanumericcharacter
Thefunctiondeletesatableandallofitsrecords.Itdeleteseverysetofobjectdatadefinedbythetableandattachedtoanobject,aswellasthedatacontainedintherecords.
Theade_oddeletetabfunctionaffectsallactivedrawingsinthedrawingset.Thereshouldnotbeanyqueriedobjectsforthisoperation.
NoteThisfunctionwillnotoperateunlessyourenduserhassuperuserprivileges.
ade_oddelrecordObjectDataFunctions
Deletesarecord.
(ade_oddelrecordenametablerecnum)
ReturnsTornil.
ename AutoCADentitynameoftheobjecttowhichtherecordisattached.
table Nameofthetabletowhichtherecordbelongs,upto25characterslong(string).Mustbeunique,containnospaces,andstartwithacharacter
recnum Recordnumber(integer).Thenumberofthefirstrecordis0
Thefunctiondeletestherecordfromtheobject.Itdeletesthesetofobjectdatadefinedbythetableandattachedtotheobject.Thisdeletestherecordfromthetableaswellasthedatacontainedintherecord.
Therecordnumberisnecessarybecausemorethanonerecordfromthesametablecanbeattachedtoanobject.Useade_odrecordqtytofindhowmanyrecordsofagiventableareattached.
ade_odfreerecObjectDataFunctions
Freesthememoryclaimedindefininganewrecord.
(ade_odfreerecrec_id)
ReturnsTornil.
rec_id RecordIDreturnedbyade_odnewrecord
WarningYoumustreleaseanewrecordwhenyouarefinishedwithit.
ade_odgetfieldObjectDataFunctions
Getsafieldvalue.
(ade_odgetfieldenametablefieldrecnum)
Returnsafieldvalue(datatypevaries)ornil.
ename AutoCADobjectname.
table Tablename(string)canbeupto25characterslong.Mustbeunique,containnospaces,andstartwithanalphanumericcharacter
field Fieldname(string)canbeupto31characterslong.Mustbeunique,containnospaces,andstartwithanalphanumericcharacter
recnum Recordnumber(integer).Thenumberofthefirstrecordis0
Toidentifyauniquerecord,youneedtospecifythetabletowhichitbelongs,theobjecttowhichitisattached,anditsrecordnumber.Therecordnumberisnecessarybecausemorethanonerecordfromthesametablecanbeattachedtoanobject.Formoreinformationaboutrecordsandrecordnumbers,seeade_odaddrecord.
Thefieldvaluereturnedcanbeoneoffourdatatypes:integer,character,point,orreal.
ade_odgetrecfieldObjectDataFunctions
GetsafieldvalueusingarecordID.
(ade_odgetrecfieldrecIDfield)
Returnsafieldvalue(datatypevaries)ornil.
recID RecordID(real)returnedbyade_odgetrecord
field Fieldname(string)
ThisfunctionusestherecordIDassignedbyade_odgetrecordtogetthevalueofaparticularfield.Thismeansofgettinganobjectdatafieldvalueisgenerallyfasterthananyother.
ade_odgetrecordObjectDataFunctions
GetsarecordID.
(ade_odgetrecordenametablerecnum)
ReturnsarecordID(real)ornil.
ename AutoCADobjectname.
table Tablename(string)
recnum Recordnumber(integer);thefirstrecordnumberis0
ThefunctionassignsanIDtotherecorduniquelydeterminedbythethreearguments.LateryoucanusethisrecordIDwithade_odgetrecfieldtoreturnthevalueofaparticularfieldofthisrecord.Thismeansofgettinganobjectdatafieldvalueisgenerallyfasterthananyother.
ThreeargumentsarenecessarybecauseanAutoCADobjectcanbeassociatedwithmorethanonerecordinatable,inwhichcasetherecordsaredistinguishedbytheirrecordnumbers.Ifthereisonlyonerecord,itsnumberis0.Formoreinformationaboutrecordsandrecordnumbers,seeade_odaddrecord.
ade_odgettablesObjectDataFunctions
Liststhetablesattachedtoanobject.
(ade_odgettablesename)
Returnsalistoftablenames(string)ornil.
ename AutoCADobjectname.
Anobjectcanhaverecordsofmorethanonetableattached.Thisfunctionlistsallthetablesthathaverecordsattachedtotheobject.Seeade_odaddrecordforinformationaboutrecordsattachedtoobjects.
Anobjectcanhavemorethanonerecordfromthesametableattached.Tofindhowmanyrecordsofagiventableareattached,useade_odrecordqty.
ade_odmodifyfieldObjectDataFunctions
Modifiesfieldpropertiesinatable.
(ade_odmodifyfieldtableNamefieldList)
ReturnsTornil.
tableName Tablename(string)canbeupto25characterslong.Mustbeunique,containnospaces,andstartwithanalphanumericcharacter
fieldList Fieldstomodify.Asequenceoffielddefinitions.SeeFieldDefinitionsbelow.
Theade_odmodifyfieldfunctionaffectsallactivedrawingsinthedrawingset.Thereshouldnotbeanyqueriedobjectsforthisoperation.
NoteThisfunctionwillnotoperateunlessyourenduserhassuperuserprivileges.
FieldDefinitions
Thefielddefinitionsareintroducedbythe"columns"string.Eachfielddefinitionisalistofa-lists,andeacha-listconsistsofafieldpropertyandavalue,asfollows:
FieldProperty FieldValue
colname Fieldname(string)canbeupto31characterslong.Mustbeunique,containnospaces,andstartwithanalphanumericcharacter
coldesc Fielddescription(string)
coltype Fielddatatype
defaultval Defaultfieldvalue
Inthefieldlistargument,specifythefieldstomodifyandtheirnewfielddefinitions.Thefunctionactsonthesefieldsonlyandhasnoeffectonanyothers.Foreachfieldyouspecify,thefunctionreplacestheexistingfielddefinitionwiththenewfielddefinitioninthetableandineachofitsrecords.Ineachrecord,themodifiedfieldsareassigneddefaultvaluesthatcorrespondtotheirnewfielddefinitions.Inotherwords,thefunctionreplacesfielddefinitionsineachsetofobjectdatadefinedbythetableandattachedtoanobject.
Thefieldlistargumenthasthesameformatasthefieldlistargumentinade_odaddfield.Theentryforthisfunctionhassourcecodeexamples.
Ifanewfielddefinitionchangesthefieldtype,fieldvaluesinexistingrecordsareconvertedtothenewtypeifpossible.Thisconversionmayalterthevalues.Forexample,ifyouchangethefieldtypefromrealtointeger,existingfieldvaluesareconvertedbytruncatingtheirdecimalparts.
ade_odmodifytabObjectDataFunctions
Redefinesatable.
(ade_odmodifytabtab_defn)
ReturnsTornil.
tab_defn Listoftableelements:thenameofthetableyouwillredefine,anewtabledescription,andasequenceofnewfielddefinitions.
Thetab_defnargumenthasthesameformatasthetab_defnargumentinade_oddefinetab.Theentryforthisfunctionhassourcecodeexamples.
Forthetableyouspecifyinthetab_defnargument,thefunctionreplacestheexistingtabledefinitionwiththenewone.Foreveryobjecttowhichthetableisattached,thecorrespondingfieldsofeachrecordofthetablearereplaced.Theoldfieldsaredeleted,andthenewfieldsareassigneddefaultvaluesinaccordwiththeirfielddefinitions.
Theade_odmodifyfieldfunctionaffectsallactivedrawingsinthedrawingset.Thereshouldnotbeanyqueriedobjectsforthisoperation.
NoteThisfunctionwillnotoperateunlessyourenduserhassuperuserprivileges.
ade_odnewrecordObjectDataFunctions
Definesanewobjectdatarecord.
(ade_odnewrecordtable)
ReturnsanewrecordIDornil.
table Tablename(string),theexistingtabletowhichthenewrecordwillbelong.
Thefunctioncreatesanewrecord,populatesitsfieldswithdefaultvaluesaccordingtothetabledefinition,andreturnsthenewrecordID.
ade_odpresetfieldObjectDataFunctions
Assignsavaluetoafieldinanewrecord.
(ade_odpresetfieldrec_idfieldvalue)
ReturnsTornil.
rec_id RecordIDreturnedbyade_odnewrecord
field Fieldname(string)
value Fieldvalue.
SetsthevalueofafieldinanObjectDatarecorddefinedthroughade_odnewrecord.
ade_odrecordqtyObjectDataFunctions
Countstherecordsattachedtoanobject.
(ade_odrecordqtyenametable)
Returnsarecordcount(integer)ornil.
ename AutoCADobjectname.
table Tablename(string)canbeupto25characterslong.Mustbeunique,containnospaces,andstartwithanalphanumericcharacter.
Thefunctioncountshowmanyrecordsofthesametableareattachedtotheobject.Seeade_odaddrecordformoreinformationaboutattachingrecordstoobjects.
ade_odsetfieldObjectDataFunctions
Setsafieldvalue.
(ade_odsetfieldenametablefieldrecnumvalue)
ReturnsTornil.
ename AutoCADobjectname.
table Tablename(string)canbeupto25characterslong.Mustbeunique,containnospaces,andstartwithanalphanumericcharacter.
field Fieldname(string)canbeupto31characterslong.Mustbeunique,containnospaces,andstartwithanalphanumericcharacter.
recnum Recordnumber(integer);thefirstrecordnumberis0.
value Newfieldvalue.
Toidentifyauniquerecord,youneedtospecifythetabletowhichitbelongs,theobjecttowhichitisattached,anditsrecordnumber.Therecordnumberisnecessarybecausemorethanonerecordfromthesametablecanbeattachedtoanobject.Formoreinformationaboutrecordsandrecordnumbers,seeade_odaddrecord.
ade_odtabledefnObjectDataFunctions
Getsatabledefinition.
(ade_odtabledefntable)
Returnsatabledefinitionornil.
table Tablename(string)canbeupto25characterslong.Mustbeunique,containnospaces,andstartwithanalphanumericcharacter
Thetabledefinitionreturnedbyade_odtabledefnhasthesameformatasthetab_defnargumentinade_oddefinetab.Theentryforthisfunctionhassourcecodeexamples.
ade_odtablelistObjectDataFunctions
Liststhetablesintheproject.
(ade_odtablelist)
Returnsalistoftablenames(string)ornil.
Thelistincludesallobjectdatatablesintheprojectdrawingandinallactivesourcedrawings.
ade_osfexpand
Searchesadirectoryandreturnsalistoffilenames.
(ade_osfexpandpathextensionpattern)
Returnsalistoffilenamesornil.
path Directoryinwhichtosearch(string)ornil.Ifnil,thefunctionsearchestheworkingdirectory
extension Filenameextension(string)ornil.Ifnil,thefunctionuses"dwg".
pattern Wildcardpattern(string)ornil.Ifnil,thefunctionuses"*"(searchforallfilenameswiththegivenextensionandpath).
Forinformationaboutwildcardpatterns,lookup"wild-cardcharacters"ontheIndextabofAutoCADMapHelp.
ade_projgetctgynameCoordinateTransformationFunctions
Identifiesthecategorythatacoordinatesystembelongsto.
(ade_projgetctgynamecscode)
Returnsacoordinatesystemcategory(string)ornil.
cscode Coordinatesystemcode(string),eightcharacters
ade_projgetinfoCoordinateTransformationFunctions
Getsinformationaboutaprojectionsystem.
(ade_projgetinfocscodeinfo_type)
Returnsapieceofprojectionsysteminformationornil.
cscode Coordinatesystemcode(string),eightcharacters
info_type Informationtype(string);seeInformationTypesbelow
InformationTypes
description Description(string).Forexample,"WorldGeodeticSystemof1984Latitude/LongitudeinDegrees".
projection Projection(string).Forexample,"UnityConversion,produce/acceptlat/longs".
datum Datum(string).Forexample,"NorthAmericanDatumof1927,MeanValues".
ade_projgetwscodeCoordinateTransformationFunctions
Getstheprojectdrawing'scoordinatesystemcode.
(ade_projgetwscode)
Returnsacoordinatesystemcode(string)ortheemptystring.
ade_projlistcrdsystsCoordinateTransformationFunctions
Listsavailablecoordinatesystemsinagivencategory.
(ade_projlistcrdsystscategoryname)
Returnsalistofavailablecoordinatesystemsornil
categoryname Coordinatesystemcode(string),eightcharacters.
ade_projlistctgyCoordinateTransformationFunctions
Listsavailablecoordinatesystemcategories.
(ade_projlistctgy)
Returnsalistofcoordinatesystemcategoriesornil.
ade_projptbackwardCoordinateTransformationFunctions
Convertspointcoordinatesfromdestinationcoordinatesystemtosource.
(ade_projptbackwardpt)
Returnscorrespondingsourcevaluesornil.
pt Destinationpointtoconvert,asetof2Dor3Dcoordinatevalues(real).If3D,theZvalueisignored.
Beforeyoucanuseade_projptbackwardtoconvertpoints,youmustfirstidentifythecoordinatesystemsthatyouareconvertingbetween.Useade_projsetsrctosetthesourcesystemandade_projsetdesttosetthedestinationsystem.Theade_projptbackwardfunctionassumesthatthecoordinatevaluesyoupasstoitbelongtothedestinationsystem,anditreturnscorrespondingsourcevalues.Theade_projptforwardfunctiondoestheinverse.
Formoreinformation,seeConvertingCoordinates.
ade_projptforwardCoordinateTransformationFunctions
Convertspointcoordinatesfromsourcecoordinatesystemtodestination.
(ade_projptforwardpt)
Returnscorrespondingdestinationvaluesornil.
pt Sourcepointtoconvert,asetof2Dor3Dcoordinatevalues(real).If3D,theZvalueisignored.
Beforeyoucanuseade_projptforwardtoconvertpoints,youmustfirstidentifythecoordinatesystemsthatyouareconvertingbetween.Useade_projsetsrctosetthesourcesystemandade_projsetdesttosetthedestinationsystem.Theade_projptforwardfunctionassumesthatthecoordinatevaluesyoupasstoitbelongtothesourcesystem,anditreturnscorrespondingdestinationvalues.Theade_projptbackwardfunctiondoestheinverse.
Formoreinformation,seeConvertingCoordinates.
ade_projsetdestCoordinateTransformationFunctions
Setsthedestinationcoordinatesystemforconvertingpoints.
(ade_projsetdestcscode)
ReturnsTornil.
cscode Coordinatesystemcode(string),eightcharacters.
Beforeyoucanuseeitherade_projptforwardorade_projptbackwardtoconvertpoints,youmustfirstidentifythecoordinatesystemsthatyouareconvertingbetween.Useade_projsetdesttosetthedestinationsystemandade_projsetsrctosetthesourcesystem.Theade_projptforwardfunctionassumesthatthecoordinatevaluesyoupasstoitbelongtothesourcesystem,anditreturnscorrespondingdestinationvalues.Theade_projptbackwardfunctiondoestheinverse.
Formoreinformation,seeConvertingCoordinates.
ade_projsetsrcCoordinateTransformationFunctions
Setsthesourcecoordinatesystemforconvertingpoints.
(ade_projsetsrccscode)
ReturnsTornil.
cscode Coordinatesystemcode(string),eightcharacters.
Beforeyoucanuseeitherade_projptforwardorade_projptbackwardtoconvertpoints,youmustfirstidentifythecoordinatesystemsthatyouareconvertingbetween.Useade_projsetsrctosetthesourcesystemandade_projsetdesttosetthedestinationsystem.Theade_projptforwardfunctionassumesthatthecoordinatevaluesyoupasstoitbelongtothesourcesystem,anditreturnscorrespondingdestinationvalues.Theade_projptbackwardfunctiondoestheinverse.
Formoreinformation,seeConvertingCoordinates.
ade_projsetwscodeCoordinateTransformationFunctions
Setsthecoordinatesystemfortheprojectdrawing.
(ade_projsetwscodecscode)
ReturnsTornil.
cscode Coordinatesystemcode(string),eightcharacters
ade_qldelctgyQueryLibraryFunctions
Deletesaquerylibrarycategory.
(ade_qldelctgyctgy_id)
ReturnsTornil.
ctgy_id CategoryID(real)
ade_qldelqueryQueryLibraryFunctions
Deletesaqueryfromthequerylibrary.
(ade_qldelqueryqry_id)
ReturnsTornil.
qry_id QueryID(real)
ade_qlgetctgyinfoQueryLibraryFunctions
Getsinformationaboutaquerycategory.
(ade_qlgetctgyinfoctgy_idinfo)
Returnstherequestedinformationornil.
ctgy_id CategoryID(real)
info Typeofcategoryinformationtoget(string):"name"togetthecategoryname,or"qrylist"togetalistofqueryIDsofthequeriesinthecategory.
Theinformationreturneddependsontheinfoargumentyouuse,butitisalwaysinlistformat.Forexample:
Anexpressionsuchas(ade_qlgetctgyinfosome_id"name")returnsacategoryname,suchas("SomeCategory").Anexpressionsuchas(ade_qlgetctgyinfosome_id"qrylist")returnsalistofqueryIDs,suchas(1.234562.345673.45678).
ade_qlgetqryinfoQueryLibraryFunctions
Getsinformationaboutaquery.
(ade_qlgetqryinfoqry_idinfo)
Returnstherequestedinformationornil.
qry_id QueryID(real).
info Informationtype(string).SeetheInformationTypestablebelow.
InformationTypes
name Queryname.
description Querydescription.
category Categoryname.
qtype Querytype:1=internal,2=external.
filename Foranexternallysavedquery,fullpathname(string).
AquerygetsanameandanIDwhenitissavedtoaquerycategoryofthequerylibrary.AnewquerythatyouhavenotyetsaveddoesnothaveanameoranID.
ade_qllistctgyQueryLibraryFunctions
ListsthequerycategoryIDs.
(ade_qllistctgy)
ReturnsalistofcategoryIDs,oriftherearenocategories,nil.
TofindtheIDofacategoryifitsnameisknown,useade_qllistctgytogetalistofcategoryIDs,andthenuseade_qlgetctgyinfooneachIDinturnuntilyoufindtheIDassociatedwiththename.
ade_qlloadqryQueryLibraryFunctions
Makesasavedquerycurrent.
(ade_qlloadqryqry_id)
ReturnsTornil.
qry_id QueryID(real)
Onceloaded,thequerybecomesthecurrentquery.Ifthereisalreadyacurrentquery,thisqueryreplacesit.
ade_qlqrygetidQueryLibraryFunctions
GetsaqueryID.
(ade_qlqrygetidquery_name)
ReturnsaqueryIDornil.
query_name Queryname(string)
AquerygetsanameandanIDwhenitissavedtoaquerycategoryofthequerylibrary.AnewquerythatyouhavenotyetsaveddoesnothaveanameoranID.
Thequerynameisenoughtoidentifyaqueryuniquely.Thecategorynameisnotrequired.Withinaproject,notwoqueriescanhavethesamename,eveniftheyaresavedindifferentcategories.
ade_qlsetctgynameQueryLibraryFunctions
Changesaquerycategoryname.
(ade_qlsetctgynamectgy_idname)
ReturnsTornil.
ctgy_id QuerycategoryID(real)
name Nameofnewcategory(string),upto31characterslong.Mustbeunique,containnospaces,andstartwithanalphanumericcharacter
Thecategorynamecannotcontainspaces.
ade_qlsetqueryQueryLibraryFunctions
Changesaqueryname,description,orthecategoryitbelongsto.
(ade_qlsetqueryqry_idinfovalue)
ReturnsTornil.
qry_id QueryID(real)
info Typeofinformationtomodify(string).SeetheInformationTypestablebelow.
value Newvalue(typevaries).SeetheInformationTypestablebelow.
InformationTypes
name Nameofquery(string),upto31characterslong.Mustbeunique,containnospaces,andstartwithanalphanumericcharacter.
description Descriptionofquery(string),upto132characterslong.Cancontainspaces.Mustbeuniqueandstartwithanalphanumericcharacter.
category CategoryID.
Thisfunctiondoesnotchangefilenameorstoragetype.
AquerygetsanameandanIDwhenitissavedtoaquerycategoryofthequerylibrary.AnewquerythatyouhavenotyetsaveddoesnothaveanameoranID.
ade_qryclearQueryFunctions
Clearsthecurrentquery.
(ade_qryclear)
ReturnsToranerrorcode.
Thisfunctionclearsthecurrentquery,includinganytopologyparameters,suchastopologynameandresult.
ade_qryexecuteQueryFunctions
Executesthecurrentquery.
(ade_qryexecute)
Returnsthenumberofqueriedobjects(real).Ifnone,itreturns0.0.
Executingaquerymakesanewselectionsetofthequeriedobjectsifthe"MkSelSetWithQryObj"optionisturnedon,asfollows:
(ade_prefsetval"MkSelSetWithQryObj"T)
Thequeryrunsslowerinthiscasebecauseoftheextraworkinvolved.
ThefollowingcodecapturestheIDofaselectionsetcreatedbyexecutingthecurrentquery.
(ade_prefsetval"MkSelSetWithQryObj"T)(if(>(ade_qryexecute)0.0)(setqqueried_objects(ssget"P"))(princ"\nNoobjectsfound."))(ade_prefsetval"MkSelSetWithQryObj"nil)
The"P"argumentinthessgetcallidentifiesthe"previous"selectionset(theobjectscurrentlyormostrecentlyselected).
NoteWheneveryoucreateaselectionset,youreplacethepreviousselectionset.Makesureyouknowwhichobjectsyouaregetting.
ade_qrygetdwgandhandleQueryFunctions
GetsthesourcedrawingIDandoriginalhandleofaqueriedobject.
(ade_qrygetdwgandhandleename)
ReturnsthedrawingIDandhandleofthequeriedobjectornil.
ename AutoCADentityname.
ThisfunctionreturnstheIDofthesourcedrawingfromwhichtheobjectwasqueriedandthehandlebywhichtheobjectisknowninthatdrawing.
ADSRXequivalent
structresbuf*ade_qrygetdwgandhandle
ads_nameename);
ReturnsthedrawingIDandhandleforthequeriedobjectorNULL.
Youmustreleasetheresbuf.
ade_qrygetentlistQueryFunctions
Returnsthelistofentityhandlesforallobjectsthatsatisfythecurrentqueryinaspecificdrawing.
(ade_qrygetentlistdwg_id)
Returnsalistofthehandlesofselectedobjectsornil.
dwg_id DrawingIDofthedrawingtoquery(real)
Thisfunctionexecutesthecurrentqueryandfindsallobjectsthatsatisfyitinthedrawingspecifiedbythedwg_idargument.Theentityhandlesoftheobjectsarereturnedtothecallingfunction.
Onceyouhavethehandletoanobject,youcangettheentitynamewiththeade_qryhandentfunctionanduseittoperformotherfunctions.Forexample,youcoulduseentget(andads_entget)toretrievetheentityanditsdefinitiondata.
ADSRXequivalent
structresbuf*ade_qrygetentlist
ade_iddwg_id);
ReturnsalistofthehandlesofselectedobjectsorNULL.
Youmustreleasetheresbuf.
ade_qrygetreptransformQueryFunctions
Checkswhethertransformationisenabledforthecurrentreportquery.
(ade_qrygetreptransform)
ReturnsTiftransformationisenabledorniliftransformationisdisabledorthereportquerytemplateisnotdefined.
ADSRXequivalent
intade_qrygetreptransform();
ReturnsTRUEorFALSE.
ade_qrygroupQueryFunctions
Groupsasequenceoftwoormorequeryconditions.
(ade_qrygroupcondition_id1condition_id2)
ReturnsTornil.
condition_id1 IDoffirstconditionofthegroup(real)
condition_id2 IDoflastconditionofthegroup(real)
Thisfunctionaffectsthecurrentquery.
Aquerydefinitionconsistsofasequenceofqueryconditions.Withinsuchasequence,youcandefinesubsequencesoftwoormoreconditionsbygroupingthem(byenclosingtheminparentheses).Youcangroupconditionswhenyoufirstdefinethequery.Seethebggroupsandendgroupsparametersofade_qrydefine.Oryoucandoitlaterusingade_qrygroup.
Whenyoucallade_qrygroup,theconditionyouspecifyasthefirstconditionofthegroup(condition_id1)mustbeapredecessortotheoneyouspecifyasthelast(condition_id2).Thefunctiongroupsthefirstandthelastandanyconditionsinbetween.Forexample,considerthefollowingquerydefinition,whichiscomposedofconditionsA,B,C,andD:
AANDBORCORD
Thefunctioncall(ade_qrygroupIDofBIDofD)changesthedefinitionto
AAND(BORCORD)
Toungroupqueries,useade_qryungroup.
ade_qryhandentQueryFunctions
Getstheentitynameforthespecifiedhandle.
(ade_qryhandentdwg_idhandle)
ReturnstheentitynameforthespecifieddrawingIDandhandleornil.
dwg_id IDofthedrawinginwhichtheobjectresides(real)
handle Originalhandleoftheobjectinthespecifieddrawing.
Thisfunctionprovidesaccesstotheentitynameofanobjectinasourcedatabase.
Youmustusetheretrievedentitynameimmediatelybeforeyoucallanyotherfunction(exceptade_expreval)orreturncontroltoAutoCAD.
Onceyouhavetheentitynameofanobject,youcanuseitwithotherfunctions.Forexample,youcoulduseentget(orads_entget)toretrievetheentityanditsdefinitiondata.
Togettheoriginalhandleoftheobjectinthesourcedrawing,usetheade_qrygetentlistfunction.
ToobtainadrawingID,useade_dslist.
TogettheIDofadrawinggivenadrawingfilepath,useade_dwggetid.
Thefollowingcodesampleshowshowyoucancombineade_qrygetentlistandade_qryhandenttocountthenumberofobjectsinthesourcedrawingthat
areoftypeline.
;clearoutoldquery...(ade_qryclear);defineanewquery(ade_qrydefine'("""""""Location"("All")""))
;initializethecount...(setqtotal_count0)
;foreachdrawinginthedrawingset...(foreachdwg_id(ade_dslist)
;ifthedrawingisactive(if(ade_dwgisactivedwg_id)(progn
;gettheobjectswhichsatisfythequery...(setqhandle_list(ade_qrygetentlistdwg_id))(foreachhandlehandle_list(setqename(ade_qryhandentdwg_idhandle))
;ifit'saline,incrementthecounter(if(=(cdr(assoc0(entgetename)))"LINE")(setqtotal_count(1+total_count)))));progn);if);foreach
ADSRXequivalent
intade_qryhandent(
ade_iddwg_id,char*handle,ads_nameresult);
ReturnsRTNORMoranerrorcode.
result OutputtheentitynameforthespecifieddrawingIDandhandle.
ade_qrylistQueryFunctions
ListstheIDsofthecurrentqueryconditions.
(ade_qrylist)
ReturnsalistoftheIDsofthecurrentqueryconditions,or,ifthereisnocurrentquery,nil.
ade_qrysaveQueryFunctions
Savesthecurrentquery.
(ade_qrysavecatnameqryparams)
ReturnsaqueryIDornil.
catname Categoryname(string).Thecategoryiscreatedifitdoesnotexist.
qryparams Listofa-lists,eachcomposedofaninformationtypeandavalue.SeetheInformationTypestablebelow.
InformationTypes
name Queryname(string)
description Querydescription(string)
qtype Howthequeryissaved(integer):1=internal(default),2=external.
filename Foranexternalquery,fullpathname(string).
saveoption Bitcodeforthesaveoptionsyouarechoosing(integer).SeetheSaveOptionstablebelow.
Thefunctionsavesthecurrentquerytotheproject'squerylibraryortoafile.
Aquerysavedtothequerylibraryiscalledaninternalquery.Aquerysavedtoafileiscalledanexternalquery.
Youmustspecifyacategorynameandaqueryname.Inaproject,notwoqueriescanhavethesamename,eveniftheyaresavedindifferentcategories.Thedefaultvalueforadescriptionisthesameasthequeryname.Thedefaultvalueforthestoragetypeisinternal.Ifyouwanttosavethequeryexternally,youmustspecifyafilenameforit.
SaveOptions
1 Keepreferenceinquerylibrary.
2 Savelistofactivedrawings.
4 Savelocationcoordinates.
8 Savecurrentpropertyalterationdefinition.
16 Executeautomatically.
AquerygetsanameandanIDonlyifitisreferencedthequerylibrary.AnewquerythatyouhavenotyetsaveddoesnothaveanameoranID,andneitherdoesanexternalqueryunlessyoukeepareferencetoitinthequerylibrary.
Thefollowingexamplesavesthecurrentquerytothequerylibrarywithoutsavingittoafile.
(ade_qrysave"CATEGORY1"'(("name"."QUERY1")("saveoption".2)))
TheexpressionsavesthequeryinCATEGORY1andnamesitQUERY1.Becausethereisno"qtype"listelement,itsavesthequeryinternallybydefault,
whicheliminatestheneedfora"filename"element.
Thefollowingexamplesavesthecurrentquerytothequerylibraryandalsotoafile.
(ade_qrysave"CATEGORY1"'(("name"."QUERY1")("description"."Query1description")("qtype".2)("filename"."c:\\qryfiles\\Query1.qry")("saveoption".3)))
ade_qrysetaltpropQueryFunctions
Turnspropertyalterationonoroff.
(ade_qrysetaltpropflag)
ReturnsTornil.
flag Specifieswhetherpropertyalterationisonoroff:T=on,nil=off.
Thisfunctionaffectsthecurrentquery.
Ifthereisnocurrentpropertyalterationdefinition,thisfunctionhasnoeffect.Tocreateapropertyalterationdefinition,useade_altpdefine.
ade_qrysetreptransformQueryFunctions
Enablesordisablestransformationforthecurrentreportquery.
(ade_qrysetreptransformflag)
ReturnsTifsuccessful,otherwisenil.
flag Tornil,whereT=transformationenabled,andnil=transformationdisabled.
Thefunctionreturnsnilifthereisnoreportquerytemplate.
ade_qrysettypeQueryFunctions
Setsthequerymode:Preview,Draw,orReport.
(ade_qrysettypeqrytype[multilinetemplfilename])
ReturnsTornil.
qrytype Querymode(string):"preview","draw",or"report",where"preview"=Displayqueriedobjectswithoutretrievingthem,similartoQuickView,"draw"=Getqueriedobjectsfromsourcedrawingsorexternaldatabasesandcopytotheprojectdrawing,and"report"=Directqueriedinformationtoanoutputfile.
multiline Whethertowritereportrowsforsub-objects:Tornil,whereT=Writereportrowsforsub-objects(objectssuchasverticesofpolylinesandattributesofblocks),andnil=Writelinesfortop-levelobjectsonly.Relevantonlyifqrytypeis"report".
templ> Orderedlistofobjectpropertiestoreport(string).Eachlistelementdefinesareportcolumn.Forexample,".type,.layer".Relevantonlyifqrytypeis"report".
filename Pathandfilenameoftheoutputfile(string).Relevantonlyifqrytypeis"report".
Thisfunctionaffectsthecurrentquery.
Thethreeoptionalparameters,multiline,templ,andfilename,arerelevantonlyifthequerymodeis"report".Ifthequerymodeis"preview"or"draw",omitthem.
ThefollowingexamplesetsthequerymodetoReport.
(ade_qrysettype"report"T".type,.layer""output.txt")
ade_qryungroupQueryFunctions
Ungroupsasequenceoftwoormorequeryconditions.
(ade_qryungroupcondition_id1condition_id2)
ReturnsTornil.
condition_id1 ConditionIDofthefirstgroupedcondition(real).
condition_id2 ConditionIDofthelastgroupedcondition(real).
Thisfunctionaffectsthecurrentquery.
Aquerydefinitionconsistsofasequenceofqueryconditions.Withinsuchasequence,therecanbesubsequencesthathavebeengroupedbyenclosingtheminparentheses.Suchgroupsmayhavebeenestablishedwhenthequerywasfirstdefined.Seethebggroupsandendgroupsparametersofade_qrydefine.Ortheymayhavebeenestablishedafterwardbyade_qrygroup.Howeverestablished,youcanuseade_qryungrouptoundoagroup(removeitsenclosingparentheses).
Whenyoucallade_qryungroup,theconditionyouspecifyasthefirstofthegroup(condition_id1)mustbeapredecessortotheoneyouspecifyasthelast(condition_id2).Thefunctionungroupsthefirstandthelastandanyconditionsinbetween.Forexample,considerthefollowingquerydefinition,whichiscomposedofconditionsA,B,C,andD:
AAND(BORCORD)
Thefunctioncall(ade_qryungroupIDofBIDofD)changesthequerydefinitionto
AANDBORCORD
ade_rtdefrangeRangeTableFunctions
Definesarangetable.
(ade_rtdefrangetabnamedescriptionrange_defn)
ReturnsarangetableIDornil.
tabname Rangetablename(string);canbeupto31characterslong.Mustbeunique,containnospaces,andstartwithanalphanumericcharacter
description Rangetabledescription(string)
range_defn Rangetabledefinition(string)
Arangetableallowsyoutoalterpropertiesofqueriedentitiesconditionally.Itcontainsasetofpropertyalterationvaluesfromwhichasinglevalueisselecteddependingonconditionsobtaininginthequeriedentitytobealtered.
Therange_defnargumentisarangetabledefinition,alistofrangeexpressions.Eachrangeexpressionincludes(1)aconditionand(2)apropertyalterationvaluetoreturniftheconditionistrue.Thisinformationisexpressedasalistofthreeelements:arangetableoperatorandacomparisonvalue(whichtogethermakeupthecondition),andthereturnvalue.Youmuststateeachvalueexplicitly.Youcannotsubstituteanexpression.
SeeUsingaRangeTableformoreinformation.
ade_rtdeltableRangeTableFunctions
Deletesarangetable.
(ade_rtdeltabletablename)
ReturnsTornil.
tablename Rangetablename(string);canbeupto31characterslong.Mustbeunique,containnospaces,andstartwithanalphanumericcharacter
ade_rtgetidRangeTableFunctions
GetsarangetableID.
(ade_rtgetidtablename)
ReturnsarangetableIDornil.
tablename Rangetablename(string);canbeupto31characterslong.Mustbeunique,containnospaces,andstartwithanalphanumericcharacter
ade_rtgetpropRangeTableFunctions
Getsthevalueofarangetableproperty.
(ade_rtgetproprt_idproperty)
Returnsapropertyvalue,orlist,ornil.
rt_id RangetableID(real)
property Propertytogetthevalueof(string).SeetheRangeTablePropertiestablebelow.
RangeTableProperties
name Rangetablename(string)
description Rangetabledescription(string)
expr Rangetabledefinition(listofrangeexpressions)
Seeade_rtdefrangeforinformationaboutsettingrangetableproperties.
ade_rtlistRangeTableFunctions
ListstheIDsofallrangetablesdefinedintheproject.
(ade_rtlist)
ReturnsalistofrangetableIDsornil.
ade_saveobjsObjectSavingFunctions
Savesobjectsqueuedforsavingbacktothesourcedrawings.
(ade_saveobjspriorities)
ReturnsTornil.
priorities Listcontainingonetofoursavebackoperationcodes,dependingonthenumberofsavebackoperationsyouarespecifying(integer).Listthecodesinorderoftheirrelativepriority.SeetheSave-BackOperationCodestablebelow.
Save-BackOperationCodes
Code Operation Description
1 CameFrom Savesobjectstotheirsourcedrawings
2 Selective Savesobjectsyouselecttothedrawingsyouspecify
3 Layer Savesobjectstolayersinthesourcedrawingsthatusethesamenamesasthoseinwhichtheobjectslie
4 Area Savesobjectstothesourcedrawingwithinwhoseextentstheylie,evenifonlypartiallywithin
Duringthesavebackoperation,theoptionsareexecutedintheorderspecifiedintheprioritieslist.Thelistmustcontainatleastoneoption.Forexample:
(ade_saveobjs2143)
Tosaveaselectionsettoaspecificdrawing,useade_savetodwg.
ade_savetodwgObjectSavingFunctions
Savesaselectionsettoaspecificdrawing.
(ade_savetodwgsel_setdwg_id)
ReturnsTornil.
sel_set Selectionsetname.
dwg_id DrawingIDofthedestinationdrawing(real)
Tosaveobjectsqueuedforsavingbacktothesourcedrawings,useade_saveobjs.
ade_sqlgetenvstringSQLEnvironmentFunctions
GetsastringdescribingtheSQLenvironment.
(ade_sqlgetenvstringlinktemplate)
ReturnsastringdescribingtheSQLenvironmentornil.
linktemplate Linktemplate(string)
Thisfunctionreturnsastringwiththefollowinginformation:
"DBname.Catalog.Schema.Table"
FormoreinformationaboutlinktemplatesusingSQL,seetheAutoCADonlinedocumentation.
ade_ssfree
Releasesaselectionset.
(ade_ssfreess)
ReturnsTornil.
ss Selectionsettorelease.
SelectionsetsarereturnedbyanumberofVisualLISPfunctions.SeeFunctionsThatReturnSelectionSets.Itisimportanttoreleaseselectionsetsasyoufinishwiththem,becausethenumberallowedislimited.Ifthenumberrunsout,yourapplicationwillfail.
Thefollowingexampleallocatesaselectionsetandthenreleasesit.
(setqss(map_dwgBreakObjsscutboundaryskiptopokeepod))
···
(setqstatus(ade_ssfreess))
ade_usergetUserSecurityFunctions
Getstheloginnameorentitylocknameofthelocaluser.
(ade_userget[for_entity_locks])
Returnsausername(string)ornil.
for_entity_locks Whattodoifthelocaluserisnotloggedintotheapplication(optional):Tornil,whereT=Gettheusernameusedtoidentifytheownerofobjectlockssetlocally,andnil=Returnnil.Omittingthisargumentisthesameassupplyingnil.
Ausernamecanhaveasmanyas32characters.
Ifthelocaluserisloggedintotheapplication,theuser'sapplicationloginnameisusedtoidentifytheownerofobjectlockssetlocally.Ifthelocaluserisnotloggedintotheapplication,theuser'soperatingsystemloginnameisused.
Thisfunctionhelpsyoudetermineiftheownerofaparticularobjectlockisthelocaluser.
ade_usergetrightsUserSecurityFunctions
Getstheaccessrightsofauser.
(ade_usergetrights[username])
Returnsabitcodefortherightsallowed.SeetheUserRightsCodestablebelow.
username Loginname(string),atmost32characters.
Iftheusernameargumentisomittedornil,thefunctionreturnstherightsofthecurrentuser.
UserRightsCodes
Code UserRights
1 Superuser(inwhichcasetheotherbitsdon'tmatter).
2 Permissiontoalterthedrawingset.
4 Permissiontoeditobjects.
8 Permissiontoexecuteadrawquery.
16 PermissiontoeditFeatureClassdefinition.
Iftheusernameargumentisomittedornil,andthereisnocurrentuser,thefunctionreturnsabitcodewithallbitsset,becausetheno-current-usercondition
ispossibleonlyifthesystemoption"ForceUserLogin"issettonil,inwhichcaseallusershaveallrightsexceptthosereservedforasuperuser.
Onlyasuperusercanspecifyaloginnameotherthantheirown.Iftheusernameargumentisnottheloginnameofthecurrentuser,andthecurrentuserdoesnothavesuperuserrights,thefunctionreturnsnil,andthemessage"Accessisdenied"isaddedtotheerrorstack.
ade_userlistUserSecurityFunctions
Liststhecurrentusers.
(ade_userlist)
Returnsalistofuserloginnamesornil.
ade_usersetUserSecurityFunctions
Logsinauser.
(ade_userset[username[password]])
ReturnsTiftheuserisloggedinsuccessfully,otherwisenil.
username Loginname(string).
password Password(string).
Ifeitherargumentisomitted,theUserLogindialogboxdisplays.Ifaloginnamewasspecified,itappearsinthedialog'sLoginNamefield.
Ifbothargumentsarespecified,buttheusercannotbeloggedin,oneofthefollowingmessagesisaddedtotheerrorstack:
Invalidusername.Invalidpassword.
Ifthedrawingsetincludesactivedrawingscontaininglockedentities,thecurrentusercannotbechanged.Ifyouattempttologinadifferentuserunderthoseconditions,thefollowingerrormessageisaddedtotheerrormessagestack:
Cannotloginagainwhendrawingsarelocked/active.
ade_usersetrightsUserSecurityFunctions
Setstheaccessrightsforauser.
(ade_usersetrightsusernameuserrights)
ReturnsTonsuccess,otherwisenil.
username Loginname(string)
userrights Abitcodefortherightstoallow.SeetheUserRightsCodestablebelow.
UserRightsCodes
Code UserRights
1 Superuser(inwhichcasetheotherbitsdon'tmatter).
2 Permissiontoalterthedrawingset.
4 Permissiontoeditobjects.
8 Permissiontoexecuteadrawquery.
16 PermissiontoeditFeatureClassdefinition.
Thisfunctioncannotexecuteunlessthecurrentuserhassuperuserrights,anditcannotchangetherightsofthecurrentuserinanycase.Ifanordinaryuserisloggedinwhenthisfunctioniscalled,orasuperuserisloggedinandthe
functioncallwouldchangetherightsofthecurrentuser,thefunctionreturnsnil,andthefollowingmessageisaddedtotheerrormessagestack:
Can'tchangerightsofthecurrentuser.
ade_version
GetstheversionnumberoftheDataExtensionprogramminginterface.
(ade_version)
Returnsaversionnumber(string)ornil.
Atruntime,thisfunctionreturnstheversionnumberoftheDataExtension(ADE)programminginterfacewithwhichyourapplicationiscommunicating.Forexample("2.024").
CoordinateTransformationFunctions
Thecoordinatetransformationfunctionsbeginwithade_proj.
ade_projgetctgyname
Identifiesthecategorythatacoordinatesystembelongsto.
ade_projgetinfo
Getsinformationaboutaprojectionsystem.
ade_projgetwscode
Getstheprojectdrawing'scoordinatesystemcode.
ade_projlistctgy
Listsavailablecoordinatesystemcategories.
ade_projlistcrdsysts
Listsavailablecoordinatesystemsinagivencategory.
ade_projptbackward
Computesnewcoordinatesforasourcepoint.
ade_projptforward
Computesnewcoordinatesforadestinationpoint.
ade_projsetdest
Setsthedestinationcoordinatesystem.
ade_projsetsrc
Setsthesourcecoordinatesystem.
ade_projsetwscode
Setstheprojectdrawing'scoordinatesystem.
DrawingFunctions
Thefunctionsfordrawingmanagementbeginwithade_dwg.
ade_dwgactivate
Activatesadrawing.
ade_dwgactualpath
Returnsthefullpathofadrawing.
ade_dwgaliaspath
Returnsthealiaspathofadrawing.
ade_dwgattriblist
Returnsalistofattributetagsforthespecifiedblockname.
ade_dwgdeactivate
Deactivatesadrawing.
ade_dwggetid
GetsthedrawingIDofadrawing.
ade_dwggetsetting
Getsadrawingsettingvalue.
ade_dwghaslocks
Checksifadrawinghaslockedobjects.
ade_dwgindex
Appliesspecifiedindexoperationstoadrawing.
ade_dwgindexdef
Specifieswhichindexesaretobecreatedorremoved.
ade_dwgisactive
Checksifadrawingisactive.
ade_dwgistoplevel
Checksifadrawingisdirectlyattachedtotheprojectdrawing.
ade_dwgproplist
Listsallvaluesfoundinadrawingforagivendrawingproperty.
ade_dwgquickview
Displaysaquickviewofadrawing.
ade_dwgselectdlg
DisplaystheSelectDrawingsdialogbox.
ade_dwgsetof
Identifiesthedrawingstowhichagivendrawingisattached.
ade_dwgsetsetting
Setsadrawingsettingvalue.
ade_dwgunlock
Removesallobjectlocksfromadrawing.
ade_dwgzoomextents
Zoomstotheextentsoftheactivedrawings.
DrawingSetFunctions
Thefunctionsfordrawingsetmanagementbeginwithade_ds.
ade_dsattach
Attachesadrawingtotheproject.
ade_dsdetach
Detachesadrawingfromtheproject.
ade_dsisnested
Checksifadrawinghasnesteddrawings.
ade_dslist
Liststhedrawingsattachedtoagivendrawing.
ade_dsproplist
Listsallvaluesfoundinthedrawingsetforagivendrawingproperty.
DriveAliasFunctions
Thedrivealiasfunctionsbeginwithade_alias.
ade_aliasadd
Createsadrivealias.
ade_aliasdelete
Deletesadrivealias.
ade_aliasgetlist
Listsalldrivealiasesintheproject.
ade_aliasupdate
Assignsanewdriveandpathtoadrivealias.
ErrorMessageFunctions
Thefunctionsforhandlingerrormessagesbeginwithade_err.
ade_errclear
Clearstheerrorstack.
ade_errcode
Getstheerrorcodeforaspecificerrorontheerrorstack.
ade_errgetlevel
Getsthesystemerrorlevel.
ade_errmsg
Getstheerrormessageforaspecificerrorontheerrorstack.
ade_errpush
Pushesanerrormessagetothestack.
ade_errpushstatement
Pushesastatementtothestack.
ade_errqty
Returnsthenumberoferrormessagesonthestack.
ade_errsetlevel
Setsthesystemerrorlevel.
ade_errshowdlg
DisplaystheMapMessagesdialogbox,whichshowsalistoferrormessagesonthestack.
ade_errstatement
Getstheerroneousstatementforaspecificerroronthestack.
ade_errtype
Getsthetypeofaspecificerrorinthestack.
ExpressionEvaluationFunction
Theexpressionevaluationfunctionbeginswithade_exp.
ade_expreval
EvaluatesanAutoCADMapexpression.
ObjectDataFunctions
Thefunctionsforobjectdatamanagementbeginwithade_od.
ade_odaddfield
Addsfieldstoatable.
ade_odaddrecord
Attachesdatatoanobject.
ade_odattachrecord
Attachesanewrecordtoanobject.
ade_oddefinetab
Createsanobjectdatatable.
ade_oddeletefield
Deletesfieldsfromatable.
ade_oddeletetab
Deletesatable.
ade_oddelrecord
Deletesarecord.
ade_odfreerec
Freesthememoryclaimedindefininganewrecord.
ade_odgetfield
Getsafieldvalue.
ade_odgetrecfield
GetsafieldvalueusingarecordID.
ade_odgetrecord
GetsarecordID.
ade_odgettables
Liststhetablesattachedtoanobject.
ade_odmodifyfield
Modifiesfieldpropertiesinatable.
ade_odmodifytab
Redefinesatable.
ade_odnewrecord
Definesanewobjectdatarecord.
ade_odpresetfield
Assignsavaluetoafieldinanewrecord.
ade_odrecordqty
Countstherecordsattachedtoanobject.
ade_odsetfield
Setsafieldvalue.
ade_odtabledefn
Getsatabledefinition.
ade_odtablelist
Liststhetablesintheproject.
ObjectEditingFunctions
Thefunctionsforobjecteditingbeginwithade_edit.
ade_editdefcen
Definesanewlabelpointforanobject.
ade_editlockederased
Getstheobjectsinthesavesetthathavebeenerased.
ade_editislocked
Getslockinformationaboutanobjectifitislocked.
ade_editlocked
Getstheobjectsinthesavesetthathavebeenmodified.
ade_editlockobjs
Locksasetofobjectsandaddsthemtothesaveset.
ade_editnew
Getstheobjectsinthesavesetthatarenew.
editunlockobjs
Unlocksasetofobjectsandremovesthemfromthesaveset.
ObjectSavingFunctions
Theobjectsavingfunctionsbeginwithade_save.
ade_saveobjs
Savesobjectsqueuedforsavingbacktothesourcedrawings.
ade_savetodwg
Savesaselectionsettoaspecificdrawing.
OptionFunctions
Theoptionfunctionsbeginwithade_pref.
ade_prefgetval
Getsanoptionsetting.
ade_prefsetval
Setsanoption.
PropertyAlterationFunctions
Thefunctionsforspecifyinghowobjectsretrievedinaqueryshouldbealteredbeginwithade_altp.
ade_altpclear
Clearsthecurrentpropertyalterationdefinition.
ade_altpdefine
Createsapropertyalterationexpression.
ade_altpdelprop
Deletesapropertyalterationexpression.
ade_altpgetprop
Getsapropertyalterationexpression.
ade_altplist
ListstheIDsofthecurrentpropertyalterationexpressions.
ade_altpsetprop
Modifiesapropertyalterationexpression.
QueryFunctions
Thefunctionsforquerymanagementbeginwithade_qry.
ade_qryclear
Clearsthecurrentquery.
ade_qrydefine
Definesaquery.
ade_qryexecute
Executesthecurrentquery.
ade_qrygetcond
Getsaquerycondition.
ade_qrygetdwgandhandle
GetsthesourcedrawingIDandoriginalhandleofaqueriedobject.
ade_qrygetentlist
Returnsentityhandlesforobjectsthatsatisfythecurrentquery.
ade_qrygetreptransform
Checkswhethertransformationisenabledforthecurrentreportquery.
ade_qrygroup
Groupsqueryconditions.
ade_qryhandent
Getstheentitynameforthespecifiedhandle.
ade_qrylist
ListstheIDsofthecurrentqueryconditions.
ade_qrysave
Savesthecurrentquery.
ade_qrysetaltprop
Turnspropertyalterationonoroff.
ade_qrysetcond
Modifiesaquerycondition.
ade_qrysetreptransform
Enablesordisablestransformationforthecurrentreportquery.
ade_qrysettype
Setsthequerymode:Preview,Draw,orReport.
ade_qryungroup
Ungroupsqueryconditions.
QueryLibraryFunctions
Thefunctionsforquerylibrarymanagementbeginwithade_ql.
ade_qldelctgy
Deletesaquerylibrarycategory.
ade_qldelquery
Deletesaqueryfromthequerylibrary.
ade_qlgetctgyinfo
Getsinformationaboutaquerycategory.
ade_qlgetqryinfo
Getsinformationaboutaquery.
ade_qllistctgy
ListsthequerycategoryIDs.
ade_qlloadqry
Makesasavedquerycurrent.
ade_qlqrygetid
GetsaqueryID.
ade_qlsetctgyname
Changesaquerycategoryname.
ade_qlsetquery
Changesaqueryname,description,orthecategoryitbelongsto.
RangeTableFunctions
Thefunctionsforrangetablemanagementbeginwithade_rt.
ade_rtdefrange
Definesarangetable.
ade_rtdeltable
Deletesarangetable.
ade_rtgetid
GetsarangetableID.
ade_rtgetprop
Getsthevalueofarangetableproperty.
ade_rtlist
ListstheIDsofallrangetablesdefinedintheproject.
SQLEnvironmentFunctions
TheSQLenvironmentfunctionsbeginswithade_sqlorade_key.
ade_keycolumnlist
Returnsalistofthekeycolumnnamesforthespecifiedlinkpathname.
ade_sqlgetenvstring
GetsastringdescribingtheSQLenvironment.
TextLabelFunction
Thetextlabelfunctionbeginswithade_ent.
ade_entsetlocation
Setsanewentitylabelpoint.
UserSecurityFunctions
Theusersecurityfunctionsbeginwithade_user.
ade_userget
Getstheloginnameorentitylocknameofthelocaluser.
ade_usergetrights
Getstheaccessrightsofthespecifieduser.
ade_userlist
Liststhecurrentusers.
ade_userset
Logsinauser.
ade_usersetrights
Setstheaccessrightsforthespecifieduser.
OtherFunctions
Miscellaneousade_xxfunctions.
ade_entsetlocation
Setsanewentitylabelpoint.
ade_expreval
EvaluatesanAutoCADMapexpression.
ade_ssfree
Releasesaselectionset.
ade_osfexpand
Searchesadirectoryandreturnsalistoffilenames.
ade_version
GetstheversionnumberoftheDataExtensionprogramminginterface.
map_dwgbreakobjMapToolFunctions
Breakslinearobjectswheretheycrossboundaries.
(map_dwgbreakobjsscutboundaryskiptopokeepod)
Returnsaselectionsetofobjectscutbytheoperationornil.
sscut Selectionsetofobjectstocut.
boundary Objectnameofasingleobjectoraselectionsetofmultipleobjects.Validobjects:line,polyline,circle,arc
skiptopo Skipflag:1Skipobjectsreferencedbyatopology0Trimobjectsreferencedbyatopology
keepod Keepflagthatsetswhethertokeepobjectdataofclippedobjectsinresultobject:1Retainallobjectdataonanyclippedobject0Dropobjectdataonanyclippedobject
Thisfunctioncutslinearobjects,suchaslines,polylines,circles,andarcs,thatcrosstheselectedboundary.Unlikethemap_dwgtrimobjfunction,thisfunctiondoesnotdeletethepartsoftheobjectoneithersideoftheboundary.Forexample,youcouldmarkaboundaryanddivideonemapintotwosectionmapsalongthisboundary.
Thefollowingexamplepromptsyoutoselectanobjecttobreakandmake
choicesaboutthebreakoperation.Itincludeserrorreporting.
(prompt"\nSelectobjecttobreak:")(setqsscut(ssget))(ifsscut(progn(setqboundary(car(entsel"\nSelectboundaryobject")))(ifboundary(progn(initget"YesNo")(setqkword(getkword"\nSkipobjectsreferencedbyatopologyYes/No<Yes>:"))(if(or(nullkword)(=kword"Yes"))(setqskiptopo1)(setqskiptopo0))(initget"YesNo")(setqkword(getkword"\nRetainobjectdataYes/No<Yes>:"))(if(or(nullkword)(=kword"Yes"))(setqkeepod1)(setqkeepod0))(setqresult(map_dwgbreakobjsscutboundaryskiptopokeepod))(ifresult(prompt"\nObject(s)breaksuccessfully.")(progn(setqnberr(ade_errqty)i0)(repeatnberr(prompt(strcat"\nError"(rtosi20)"of"
(rtosnb20)":"(ade_errmsgi)))(setqi(1+i)))))))))
map_dwgtrimobjMapToolFunctions
Trimslinearobjectsinsideoroutsideofaspecifiedboundary.
(map_dwgtrimobjssclipboundaryinoroutskiptopokeepodbitflag)
Returnsaselectionsetofobjectstrimmedbytheoperationornil.
ssclip Selectionsetofobjectstotrim.
boundary Entitynameofaboundaryobject.Validobjects:asinglecircleorasingleclosed2Dpolyline
inorout Trimflag:1Trimoutsideboundary0Triminsideboundary
skiptopo Skipflag:1Skipobjectsreferencedbyatopology0Trimobjectsreferencedbyatopology
keepod Keepflagthatsetswhethertokeepobjectdataoftrimmedobjectsinresultobject:1Dropobjectdatafromalltrimmedobjects0Retainobjectdataonalltrimmedobjects
bitflag Bitflagthatsetsthewaytohandleobjectsthatcannotbetrimmed:0Deletetheseobjectswithinorontrimboundary1Ignoretheseobjectswithinorontrimboundary
2Referencetheinsertionpointofanyoftheseobjectswithinorontrimboundary
map_pltblkattsPlottingFunctions
Getsalistofblockattributes.
(map_pltblkattsname)
Returnsalistofattributesornil.
name Layoutblockname(string)
map_pltblklistPlottingFunctions
Getsalistofvalidplotlayoutsforthecurrentworksession.
(map_pltblklist)
Returnsthenamesoftheblocksinalistornil.
Thisfunctionreturnstheplotlayout(block)namesthatareusableasplotlayouts.Toqualify,ablockmusthaveatleastoneuniqueviewportononeofitslayers.Thatis,iftheblockhasmorethanoneviewport,itmusthaveonelayerthatcontainsonlyoneviewport.
Theuniqueviewportcanshareitslayerwithobjectsofothertypes,suchaslines,polylines,blocks,andtext.
map_pltblkvpsPlottingFunctions
Returnsalistofvalidviewportlayersinaspecifiedlayoutblocks.
(map_pltblkvpsname)
Returnsalistofthevalidviewportlayersorniliftheblocknameorlayoutblockisinvalid.
name Layoutblockname(string)
map_pltcleanupPlottingFunctions
Restoressettingsalteredbymap_pltinit.
(map_pltcleanup)
ReturnsTornil.
Thisfunctionrestorescertainsettingstothestatetheywereinbeforemap_pltinitwascalled.Seemap_pltInitforalistofaffectedsettings.Beforeyoucanuseotherplotfunctions,youmustcallmap_pltinitagain.
map_pltcurrdefPlottingFunctions
Selectsorcreatesaplotset.
(map_pltcurrdefname)
ReturnsTornil.
name Nameoftheplotset(string)
Ifaplotsetcallednamedoesnotexistinthecurrentworksessionorifthefunctionmap_pltdefreadwasnotcalled,thisfunctioncreatesanewplotsetcalledname.
Usemap_pltcurrsettodefinetheattributesoftheplotset.
Iftheplotsetnameexistsandthefunctionmap_pltdefreadwascalled,thisfunctionloadsacopyofnameintomemory.Usemap_pltcurrGetandmap_pltcurrSettoexamineorchangeitsattributes.
NoteOnlyoneplotsetcanbecurrent.
map_pltcurrdelPlottingFunctions
Resetsaplotsetattributetoitsdefaultvalue.
(map_pltcurrdelattr)
ReturnsTornil.
attr Nameoftheattributetoreset(string)
map_pltcurrgetPlottingFunctions
Getsanattributevalueforthecurrentplotset.
(map_pltcurrgetattr)
Returnsthevalueofthespecifiedattributeornil.
attr Nameoftheplotsetattributetoretrieve(string)
Thisfunctionretrievesthevalueofaspecificattributeforthecurrentplotset.Thedatatypeofthereturnvaluedependsupontheattribute.Tosetplotsetattributes,usemap_pltdefget.
map_pltcurrsavePlottingFunctions
Appendsthecurrentplotsetdefinitiontotheplotsetlist.
(map_pltcurrsave)
ReturnsTornil.
Thisfunctionappendsthecurrentplotsetdefinitiontotheplotsetlistofthecurrentworksession.Thislistisnotsavedintheworksessionuntiltheuserexecutesasavewithacalltomap_pltdefsave.
Toeditandsaveaplotsetdefinition
1. Gettheplotsetdefinitionwithmap_pltdefreadandmap_pltcurrdef.2. Makethenecessarychanges.
3. Savethedefinitioninthelistwithmap_pltcurrsave.4. Savethelistinthecurrentworksessionwithmap_pltdefsave.5. Savetheworksession.
Ifyoudonotsavebeforetheendoftheprocessing,anotherapplicationcanoverwriteyourchangeswithacalltomap_pltcurrdef.
map_pltcurrsetPlottingFunctions
Setsthevalueofanattributeforthecurrentplotset.
(map_pltcurrsetattrvalue)
ReturnsTornil.
attr Nameoftheplotattributetoset(string)
value Valuefortheplotsetattribute(typevaries)
Thisfunctionsetsthevalueofthespecifiedattribute.Thevaluedatatypedependsupontheattribute.Tosetplotattributes,usemap_pltdefget.
map_pltdefdeletePlottingFunctions
Deletesaplotsetdefinition.
(map_pltdefdeletename)
ReturnsTornil.
name Plotsetname(string)
Thefunctionupdatestheplotdefinitiondictionaryinthecurrentworksession.
map_pltdefgetPlottingFunctions
Getsthevalueofanattributeoftheplotsetdefinition.
(map_pltdefgetnameattr)
Returnsthevalueofthespecifiedattributeornil.
name Plotsetname(string)
attr Nameoftheplotsetattributetoretrieve(string).
Togetthevalueofanattributeforthecurrentplotset,usemap_pltCurrGet.
Thedatatypeofthereturnvaluedependsontheattribute.
map_pltdeflistPlottingFunctions
Getsthenamesofavailableplotsetdefinitions.
(map_pltdeflist)
Returnsalistofplotsetnamesornilifnoplotsetsareavailable.
Thisfunctionreturnstheavailableplotsetdefinitions(strings)intheplotdefinitiondictionaryinthecurrentworksession.
Beforeusingthisfunction,youmustcallmap_pltdefread.
map_pltdefreadPlottingFunctions
Readsinaplotsetdefinition.
(map_pltdefread)
ReturnsTifplotsetdefinitionsareavailabletoreadornil.
Thisfunctionprovidesaccesstoplotsetsintheplotdefinitiondictionaryforthecurrentworksession.
WarningIfyoudonotcallmap_pltdefsave,anewcalltomap_pltdefreadwilleraseyournewplotsetdefinitionoryourchangestoanexistingplotset.
map_pltdefsavePlottingFunctions
Writesthecurrentplotsetdefinitiontotheplotdefinitiondictionary.
(map_pltdefsave)
ReturnsTifplotsetdefinitionsareavailabletosaveornil.
Thisfunctionstorestheplotsetdefinitionlistinthecurrentworksession.
Ifyoudonotcallthisfunction,anewcalltomap_pltdefreadwilleraseyournewplotsetdefinitionoryourchangestoanexistingplotset.
map_pltdefvalidPlottingFunctions
Performsacursorycheckofthevalidityofaplotset.
(map_pltdefvalidname)
ReturnsTornil.
name Nameoftheplotset(string)
Thefunctionperformsacursorycheckofthegivenplotsettoseeifallrequiredattributeshavebeenset.Itdoesnotattachandquerytheboundarydrawing.Whenusedwithinadialogbox,thiscallcanquicklycheckonaplotset'susability.
Ifthecheckfails,youcanusedataextensionerrormessagefunctions(ade_err[xx])toretrieveerrorsfromtheerrorstack.
Toperformanextensivecheck,usethemap_pltdefverifyfunction.
map_pltdefverifyPlottingFunctions
Performsanextensivecheckofthevalidityofaplotset.
(map_pltdefverifyname)
ReturnsTiftheplotsetisvalidornil.
name Nameoftheplotset(string)
Thisfunctionmakessurethatnoerrorsoccurwhenplottingtakesplace.Sincethecheckincludesqueryingforallboundaryobjects,itcouldtakesometime.
Toperformacursorycheck,usethemap_pltdefvalidfunction.
Ifthecheckfails,youcanusedataextensionerrormessagefunctions(ade_err[xx])toretrieveerrorsfromtheerrorstack.
map_pltdisplayPlottingFunctions
Generatestheplotdisplayforthespecifiedboundary.
(map_pltdisplaybndryname)
ReturnsTornil.
bndryname Nameforaboundaryobject(string)
Thisfunctionpreparesthedisplaytoplotforthegivenplotsetdefinitionandboundaryobjectname.Generatingtheplotdisplayforthespecifiedboundaryincludes
Switchingtopapermode(ifnecessary)InsertingthelayoutblockMappingboundaryobjectdatatolayoutblockattributes(ifapplicable)Executingthequery(ies)tocollecttheobjectstoplotTrimmingtheobjectstotheboundary(ifapplicable)Displayingtheobjectsintheviewport
Youmustcallmap_pltdisplaybeforeyoucallmap_pltplot.
map_pltexecutePlottingFunctions
Plotstheplotsetforthespecifiedplotsetname.
(map_pltexecutename)
ReturnsTornil.
name Nameofplotsettoexecute(string)
Thisfunctiongeneratesandissuesplotsforeachdefinedboundary.
Togetalistofavailableplotsetnames,usemap_pltdeflist.
map_pltinitPlottingFunctions
Initializesenvironmentforplotting.
(map_pltinit)
ReturnsTalways.
Thisfunctionmustbecalledbeforeanyotherplottingfunctions.Themap_pltinitfunctionmodifiesthefollowingsettingsandchecksthattheplotsetdescriptionfileexists:
AutoCADVariables
Variable Setting
CMDECHO 0
EXPERT 1
AutoCADMapOptions
Option Setting
DontAddObjectsToSaveSet T
ActivateDwgsOnAttach T
MkSelSetWithQryObj T
Torestorethesesettingstotheiroriginalvalues,usemap_pltcleanup.Beforeyoucanuseotherplotfunctions,youmustcallmap_pltinitagain.
Seeade_prefgetvalforacompletelistofAutoCADMapoptions.
map_pltplotPlottingFunctions
Executesthecurrentplotscript.
(map_pltplot)
ReturnsTornil.
Thefunctionplotsthecurrentscreendisplay.LiketheAutoCADPLOTcommand,itexecutestheplotscriptofthescreendisplay'splotsetdefinition.
Youmustcallmap_pltdisplaybeforeyoucallthisfunction.
map_pltrestorePlottingFunctions
Restoresdisplayalteredbymap_pltdisplay.
(map_pltrestore)
ReturnsTornil.
map_topoauditMapTopologyFunctions
Checkswhetheratopologyiscorrect.
(map_topoaudittpm_id)
ReturnsTornil.
tpm_id UniqueIDforatopology(real).TopologymustbeopenforRead
Thefunctionauditsthegeometryofatopologytodeterminewhetherthegeometricalrelationshipsdefinedbythetopologyobjectdataarecorrect.Itshowsthelocationoferrors.
Thefollowingexamplechecksatopologynamed"parcels"andprovideserrorreporting.
(setqtpm_id(tpm_acopen"parcels"))(iftpm_id(progn(setqresult(map_topoAudittpm_id))(tpm_acclosetpm_id)))
(if(nullresult)(progn(setqi0nberr(ade_errqty))(repeatnberr(prompt
(strcat"\nError"(rtosi20)"of"(rtosnberr20)":"(ade_errmsgi)))(setqi(1+i)))))
map_topocloseMapTopologyFunctions
Convertsallpolygonsinatopologytoclosedpolylines.
(map_topoclosetoponamelayergroupodataaselink)
Returnsaselectionsetofclosedpolylinescreatedbythefunction.
toponame Uniquenameforatopology(string).Topologymustbeclosed.
layer Targetlayerforclosedpolylines(string).Iflayernameisincorrect(forexample"@@"),polylinesarecreatedinthecurrentlayer
group Groupflagforcomplexpolygons:1or01groupcomplexpolygons0donotgroupcomplexpolygons
odata Objectdataflagthatsetswhethertocopyobjectdataonthepolygoncentroidtotheresultingpolyline:1or01copyobjectdataonthecentroid0ignoreobjectdataonthecentroid
aselink ASElinkflagthatsetswhethertocopyASElinkdataonthecentroidtotheresultingpolyline:1or01copyASElinkdataonthecentroid0ignoreASElinkdataonthecentroid
map_topocompleteMapTopologyFunctions
Completesallobjectsinaloadedpartialtopology.
(map_topocompletetoponame)
Returnsaselectionsetofallobjectsretrievedtocompletethetopology.
toponame Uniquenameforatopology(string).Topologymustbeclosed.
Thisfunctionperformsaquerytoretrieveobjectsintotheworksession.Thetpm_infocompletefunctiondetermineswhetherthetopologyiscompletelyrepresentedintheworksession.
Thisfunctioncanonlycompleteobjectsimportedfromanexistingsourcedrawing.Forapolygontopology,thisfunctionimportslinks,nodes,andacentroid,ifitismissing,fromthesourcedrawing.Foranetworktopology,thisfunctionimportslinksandnodes.Foranetworktopology,itimportsonlynodes.
map_topostatMapTopologyFunctions
Getsstatisticsforatopology.
(map_topostattpm_id)
Returnsalistcontainingthestatisticsforthespecifiedtopology,ornil.
tpm_id UniqueIDforatopology(real).Topologymustbeopenforread
Thisfunctionreturnsalistalistofdottedpairsornil.
Thefollowingdottedpairsapplytoalltopologytypes:
(node_count.#nodes)(link_count.#links)(polygon_count.#polygons)((min_x.#n)(min_y.#n))((max_x.#n)(max_y.#n))
NoteThisfunctionisnotdesignedtocountpolygonsinapartialtopology.Ifthetopologyinquestionispartial,thepolygon_countstatisticmaybeoverstated.Thisisbecausemap_topostatcountsnotonlythepolygonsinthepartialtopology,butalsoanypolygonsthatsharecommonedgeswiththeminthecompletetopology,eveniftheadjacentpolygonsarenotactuallypresentinthecurrentdrawing.
Thefollowingdottedpairsapplytonetworktopologies:
(length_total.#n)(length_average.#n)(length_min.#n)(length_max.#n)(length_variance.#n)(length_deviation.#n)
Thefollowingdottedpairsapplytopolygontopologies:
(area_total.#n)(area_average.#n)(area_min.#n)(area_max.#n)(area_variance.#n)(area_deviation.#n)(perimeter_total.#n)(perimeter_average.#n)(perimeter_min.#n)(perimeter_max.#n)(perimeter_variance.#n)(perimeter_deviation.#n)
BoundaryFunctions
Themapboundaryfunctionsbeginwithmap_dwg.
map_dwgBreakObj
Breaksobjectswheretheycrossboundaryedges.
map_dwgTrimObj
Trimslinearobjectsinsideoroutsideofaspecifiedboundary.
PlottingFunctions
Themapplottingfunctionsbeginwithmap_plt.
map_pltBlkAtts
Getsalistofblockattributes.
map_pltBlkList
Returnsasortedlistofblocknamesthatareusableasplotlayouts.
map_pltBlkVps
Returnsalistofvalidviewportlayersinlayoutblocks.
map_pltCleanup
Restoressettingsalteredbymap_pltInit.
map_pltCurrDef
Selectsorcreatesaplotset.
map_pltCurrDel
Resetsaplotsetattributetoitsdefaultvalue.
map_pltCurrGet
Retrievesthevalueforaspecificattributeforthecurrentplotset.
map_pltCurrSave
Appendsthecurrentplotsetdefinitiontotheplotsetlist.
map_pltCurrSet
Setsthevalueofanattributeforthecurrentplotset.
map_pltDefDelete
Deletesaplotsetdefinition.
map_pltDefGet
Getsthevalueofanattributeoftheplotsetdefinition.
map_pltDefList
Returnsalistofavailableplotsetdefinitionsintheproject.
map_pltDefRead
Readsinaplotsetdefinitionfromtheplotdefinitiondictionaryfortheproject.
map_pltDefSave
Writesthecurrentplotsetdefinitiontotheplotdefinitiondictionary.
map_pltDefValid
Teststheplotsetdefinitionforvalidity.
map_pltDefVerify
Validatesthegivenplotsettopreventplottingerrors.
map_pltDisplay
Generatestheplotdisplayforthespecifiedboundary.
map_pltExecute
Executesaplot,givenaspecifiedplotset.
map_pltInit
Initializesenvironmentforplotting.
map_pltPlot
Executestheplotscriptofthecurrentplotsetdefinition.
map_pltRestore
Restoresdisplayalteredbymap_pltDisplay.
TopologyFunctions
Themaptopologyfunctionsbeginwithmap_topo.
map_topoAudit
Checksthegeometricalrelationshipsdefinedbythetopologyobjectdata.
map_topoClose
Convertsallpolygonsinatopologytoclosedpolylines.
map_topoComplete
Completesallobjectsinaloadedpartialtopology.
map_topoStat
Getsthestatisticsforatopology.
tpm_accloseAccessFunctions
Closesatopology.
(tpm_acclosetpm_id)
ReturnsTornil.
tpm_id TopologyID(real)returnedbytpm_acopen
Whenyoucloseatopology,itremainsinmemoryuntilyouunloadit.
tpm_acexistAccessFunctions
Checkswhetheratopologyexists.
(tpm_acexisttoponame[source[loaded]])
ReturnsTifthetopologyexistsornil.
toponame Topologyname(string)
source SourceflagTornil:TChecktopologiesinthecurrentandsourcedrawingsnilCheckthecurrentdrawingonly(default)
loaded LoadedinmemoryflagTornil:TCheckonlytopologiesinmemorynilCheckalltopologies(default)
tpm_acloadAccessFunctions
Loadsatopologyintomemory.
(tpm_acloadtoponame[source])
ReturnsTornil.
toponame Topologyname(string)
source SourceflagTornil:TReadfromsourcedrawingsonlynilReadfromcurrentdrawingonly(default)
Beforeloadingatopology,youmustfirsttestforitsexistencewithtpm_acexist.
Topologyinformationisstoredinthedrawing,butthetopologyisnotautomaticallyloadedwhenyouopenthedrawing.Ifyouwant,forexample,toquery,edit,oroverlayatopology,youmustloaditintomemory.Onceloaded,thetopologyremainsinmemoryuntilyouunloadit.
tpm_acopenAccessFunctions
Opensatopology.
(tpm_acopentoponame[write_access])
ReturnsthetopologyIDornil.
toponame Topologyname(string)
write_access Accessstatus;Tornil:TWritenilReadonly(default)
Thetpm_acopenfunctionopensatopologyandcreatesanewtpm_idthatprovidesaccesstoit.
Ifyourapplicationopensatopologywithwriteaccess,youruseristheonlyonewhocaneditthistopology.Nootherusercanevenopenit.Ifyourapplicationopenstopologywithreadaccess,otheruserscanopenitalso,butwithreadaccessonly.Tofindouttheaccessstatusofanalready-opentopology,usetpm_infostatus.
Ifyouusetpm_acopentotestthestatusofatopology,alwaysclosethetopologywithtpm_acclosetoensurethatyoudonotleavethetopologyopenwithmultipleIDspointingtoit.
Atopologyloadedfromasourcedrawingcannotbeopenedforwriteaccess.Tofindoutifatopologywasloadedfromacurrentdrawing,use
tpm_infocurrent.
ImportantYoumuststorethetopologyIDwhenitisreturnedbytpm_acopen,andmakesurethatyoudonotloseit.IfyoudonothavetheIDofanopentopology,youhavenowaytogetit,andyoucannotclosethetopology.YouralternativesaretoquitAutoCADMaporstartanewdrawing.
tpm_acqtyAccessFunctions
Countstopologies.
(tpm_acqty[source[loaded]])
Returnsatopologycount(integer)ornil.
source SourceflagTornil:TCounttopologiesincurrentandsourcedrawingsnilCounttopologiesincurrentdrawingonly(default)
loaded LoadedinmemoryflagTornil:TCountonlytopologiesinmemorynilCountalltopologies(default)
tpm_acunloadAccessFunctions
Unloadsatopologyfrommemory.
(tpm_acunloadtoponame)
ReturnsTornil.
toponame Topologyname(string)
Beforeatopologycanbeunloaded,alltopologyIDsthatreferenceitmustbeclosedwithtpm_acclose.
tpm_acupgradeopenAccessFunctions
Allowswriteaccessforatopologythatisopenwithoutit.
(tpm_acupgradeopentpm_id)
ReturnsTornil.
tpm_id TopologyID(real)returnedbytpm_acopen
Ifatopologyisalreadyopenwithwriteaccess,youcannotupgradeaccesswiththisfunction.Youcannotupgradeaccesstowriteforasourcetopology.
tpm_anabufferAnalyzingFunctions
Createsabufferspacearoundatopology.
(tpm_anabuffersource_idoffsetvar_id[result_name][result_desc])
ReturnsTornil.
source_id SourcetopologyID(real)
offset Bufferoffset(string),astandardDataExtensionexpression
var_id TopologyvariablesID(real)
result_name Resultingtopologyname(string)ornil
result_desc Resultingtopologydescription(string)ornil
ThetopologyvariablesIDreferencesasetoftopologyvariables.
Thisfunctiondrawsoneormorebufferperimeters.Iftheresultargumentisomittedornil,thebufferedtopologiesareAutoCADobjectsonly.Otherwisethefunctioncreatesanewtopologythatisloadedbutnotopen.
Thesourcetopologymustbeloadedandopen.TheRead/Writeaccessofthesourcetopologydoesnotaffectthisfunction.
Youcanbufferanyofthethreetopologytypes,node,network,orpolygon.
tpm_anadissolveAnalyzingFunctions
Mergesconnectedtopologyelementsthathavethesamevalueinthespecifiedfield.
(tpm_anadissolvesource_idfieldvar_id[result_name][result_desc][objtable][objcolumn])
ReturnsTornil.
source_id SourcetopologyID(real).Polygonornetworktopologyonly.
field Dissolvefieldname(string),astandardDataExtensionexpression.Forexample,:Value@Tab1,.Layer.
var_id TopologyvariablesID(real).
result_name Nameofnewtopology(string);topologyisloadedbutnotopen.Ifargumentisomittedornil,thedissolveresultsinacollectionofAutoCADobjects.
result_desc Resultingtopologydescription(string)ornil.
objTable Objectdatatablename(string)ornil.
objColumn Objectdatafieldname(string)ornil.
ThetopologyvariablesIDreferencesasetoftopologyvariables.
Thefunctionworksforpolygonornetworktopologies.Ifitfindstwoormoreattachedobjectsthathavethesamevalueinthespecifieddissolvefield,itdissolvesthem.
Dissolvingpolygonsdeletestheircentroidsandsharedlinksandcreatesanewpolygonwithanewcentroid.Dissolvinglinksdeletessharednodes.Thelinksaremergedintoonepolyline.
Thefunctionwritestheshareddissolvefieldvaluetotheobjectdatatableandfieldthatyouspecifyandattachesthetabletotheresultobject.Ifthistabledoesnotexist,thefunctioncreatesit.Ifthetableyouspecifyisalreadyattachedtooneofthesourceobjects,atablewithdefaultvaluesisattachedtotheresultobject.
tpm_anaoverlayAnalyzingFunctions
Overlaystwotopologies.
(tpm_anaoverlayoverlay_idoverlay_datasource_idsource_dataopervar_id[obj_table][obj_tabledesc][result_name][result_desc])
ReturnsTornil.
overlay_id OverlaytopologyID(real)oftopology1.Mustbeapolygontopology.
overlay_data OverlaydataexpressioncomposedofAutoCADMapexpressionsandoutputobjectdatacolumnsornil.SeetheOverlayDataExpressionssectionbelow.
source_id SourcetopologyID(real)oftopology2.Mustbeapolygontopology.
source_data OverlaydataexpressioncomposedofAutoCADMapexpressionsandoutputobjectdatacolumnsornil.SeetheOverlayDataExpressionssectionbelow.
oper Overlayoperation(integer).SeetheOverlayOperationstablebelow.
var_id IDoftopologyvariablesforbuildingtheresulttopology(real).
obj_table Nameofthenewobjectdatatablethatwillcontainthefinaldata(createdbythefunction).Cannotbean
existingtable.
obj_tabledesc Objectdatatabledescription.
result_name Resulttopologyname(string).OmitiffunctionresultsproducesAutoCADobjectsinsteadofatopology.
result_desc Resulttopologydescription(string).
Thesourcetopologymustbeofpolygontypeforunionandpasteoperations.Forallotheroperations,itcanbeofanytopologytype,suchasnode,network,andpolygon.
ThetopologyvariablesIDreferencesasetoftopologyvariables.
OverlayDataExpressions
Theoverlay_dataandsource_dataargumentsareoverlaydataexpressions.Theyhavethefollowingformat:
(list(listexpr1colname1coldesc1coltype1)(listexpr2...)...)
OverlayDataExpressionArguments
expr1 AutoCADMapexpression(string).
col_name1 Objectdatacolumnname(string).
col_desc1 Objectdatacolumndescription(string).
col_type1 Objectdatacolumntype(integer):1through4,where1=integer,2=real,3=character,and4=point.
OverlayOperations
1 Intersect
2 Union
3 Identity
4 Erase
5 Clip
6 Paste
ResultTopology
Iftheresult_nameargumentisomittedornil,theresultisacollectionofAutoCADobjects.Otherwise,itisanewtopologythatisloadedbutnotopen.
Youmustspecifythelistofdatavaluestocomefromeachinputtopologyandthespecificdataforeach.
Additionally,youmustspecifythenameoftheresultobjectdatatableintheobjTableparametertocontainthefinaldata.Ifyoudonotspecifyaresulttable,nodataisattachedtotheresultingtopologyelements.Thefunctioncreatesthistable.Iftheresulttableyouspecifyalreadyexists,thefunctionreturnsanerrorandcancelstheoverlayprocess.
Dataderivedbytheoverlayprocessisalsoattachedtotheresultobjectdatatable.Thisdataiswrittenforeachtopologyelementintheresultingtopology.Itiswrittenforeachpolygonifthesourceisapolygontopology,foreachlinkifitisanetworktopology,orforeachnodeifitisanodetopology.Thetablealwaysincludesthefollowingfields:
FieldNamesinResultObjectDataTable
TOPO_ID ElementIDofthenewelementintheresulttopology
T1_ID ElementIDoftheparentpolygonintheoverlay
topology
T1_PERCENTAREA Areaofthenewpolygonintheresulttopologycomparedtotheareaoftheparentpolygonintheoverlaytopology.Writtenonlyifbothoverlayandresultarepolygontopologies
T2_ID ElementIDofparentelementinthesourcetopology.Theparentelementcanbeanode,link,orpolygon.
T2_PERCENTAREA Areaofthenewpolygonintheresultingtopologycomparedtotheareaoftheparentpolygoninthesourcetopology.Writtenonlyifbothsourceandresultarepolygontopologies
Theresulttableincludesthesefieldsalongwiththefieldsthatyouspecifyintheargumentsyousupplyfortheoverlay_dataandsource_dataparameters.EachfieldnameisprefixedwithT1_orT2_toindicatewhichtopologyitsdatacomesfrom.
Forexample,ifyouspecifyFIELD1,FIELD2andFIELD3fromtableSOILforthefirsttopologyandFIELD1,FIELD4andFIELD5fromtableWATERforthesecond,theresulttablehasthefollowingfields:
T1_SOIL_FIELD1T1_SOIL_FIELD2T1_SOIL_FIELD3T1_WATER_FIELD1T1_WATER_FIELD4T1_WATER_FIELD5
Thefollowingcodeoverlaystwotopologies.Thenamest1andlist1refertotheoverlaytopology.
(setqt1(tpm_acopen"top1"));apolygontopology(setqt2(tpm_acopen"top2"))(setqv(tpm_varalloc))(setqlist1(list(list".LAYER""OVERLAY_LAYER"""3)))(setqlist2(list(list".LAYER""SOURCE_LAYER"""3)))(tpm_anaoverlayt1list1t2list21v"OVERLAY_TABLE"nil"OVERLAY_TOPO");Result_descargumentomitted
tpm_cleanactionlistdelCleanupFunctions
Deletesacleanupactionfromtheactionlist.
(tpm_cleanactionlistdelclean_var_idindex)
ReturnsTornil.
clean_var_id CleanupvariablesID(real)returnedbytpm_varalloc
index Positioninthelistoftheactiontodelete(integer)
Theclean_var_idargumentreferencespropertiesforthecleanupoperationthatyouarepreparingtoinitiate(seeCleanupVariables).Thesepropertiesincludetheactionlist.
Theindexargumentisazero-basedpositionintheactionlist.Avaluegreaterthanorequaltothelistsizeorlessthan0returnsanerror.
ADSRXEquivalent
inttpm_cleanactionlistdel
ade_idclean_var_id,longindex);
ReturnsRTNORMoranerrorcode.
tpm_cleanactionlistqtyCleanupFunctions
Getsthenumberofcleanupactionsintheactionlist.
(tpm_cleanactionlistqtyclean_var_id)
Returnsthenumberofcleanupactions(real)ornil.
clean_var_id CleanupvariablesID(real)returnedbytpm_varalloc
Theclean_var_idargumentreferencespropertiesforthecleanupoperationthatyouarepreparingtoinitiate(seeCleanupVariables).Thesepropertiesincludetheactionlist.
ADSRXEquivalent
inttpm_cleanactionlistqty
ade_idclean_var_id,long*qty);
ReturnsRTNORMoranerrorcode.
qty Outputsthenumberofcleanupactions
TheADSRXfunctionpassesthenumberofcleanupactionsthroughaparameter
(asalong)insteadofreturningit(asareal)astheAutoLISPfunctiondoes.
tpm_cleanallocCleanupFunctions
Allocatesthecleanupmodel.
(tpm_cleanalloc)
ReturnsthecleanupmodelID(real)ornil.
Tocleantheobjectsbeforetheybecometheelementsofatopology,youmustconstructamodeloftheseobjectsandtheirrelationships.Youcanusethismodeltodiscoverandrepairdrawingerrorsthatwouldpreventtopologycreation.
tpm_cleananchorssCleanupFunctions
Getsacleanupmodel'sanchoredentities.
(tpm_cleananchorssclean_var_id)
Returnsaselectionsetofanchoredentitiesornil.
clean_var_id CleanupvariablesID(real)returnedbytpm_varalloc
Callthisfunctionaftercallingtpm_cleaninit.
ADSRXEquivalent
inttpm_cleananchorss
ade_idclean_var_id,ads_namess);
ReturnsRTNORMoranerrorcode.
ss Anchoredentities,aselectionset
tpm_cleancancelCleanupFunctions
Cancelsthecleanupprocess.
(tpm_cleancancelclean_id)
ReturnsTornil.
clean_id CleanupmodelIDreturnedbytpm_cleanalloc
Thefunctionclearsthecleanupmodelwithoutupdatingthedrawing.Dooneofthefollowing:
Becausethemodelisstillallocated,youcancalltpm_cleaninitusingthesamecleanupmodelID.Youcanthenusetpm_cleanstarttostartthecleanupprocess.
Becausetpm_cleancanceldoesnotcancelinitializedvalues,youcanclearthecleanupmodelandcontinuewithoutcallingtpm_cleaninit.
tpm_cleancompleteCleanupFunctions
Testsforgroupstoclean.
(tpm_cleancompleteclean_id)
ReturnsTifnomoregroupsneedcleaningornil.
clean_id ModelIDreturnedbytpm_cleanalloc.
Youmustcallthisfunctionaftertpm_cleangroupnexttodetermineifanothergroupneedscleaning,becausetpm_cleangroupnextdoesnotprovidethisinformation.
Youmustusuallyexecuteseveralcleanuploops,becausefixingoneerrorsometimescausesothers.Afteryouprocessallthegroupsintheselectionset,calltpm_cleanstarttoreturntothebeginning,andthencalltpm_cleancompletetotestifcleaningiscomplete.Repeattheloopuntilcleaningiscomplete.
tpm_cleanendCleanupFunctions
Concludesthecleanupprocess.
(tpm_cleanendclean_id)
ReturnsTornil.
clean_id ModelID(real)returnedbytpm_cleanalloc
Thefunctionresetsthecleanupmodelandupdatesthedrawing.Itfixeserrorsmarkedwiththetpm_cleanerrorfixfunction.Themodelisstillallocated.Itispossibletocalltpm_cleaninitusingthesamecleanupmodelID.
Eacherrorhassomedefaultmethod,whichtpm_cleanendusesduringerrorfixing.Tochangethismethod,usetpm_cleanerrorset.
tpm_cleanerrorcurCleanupFunctions
Setsthenexterrortocleaninthecurrentgroup.
(tpm_cleanerrorcurclean_idindex)
ReturnsTornil.
clean_id ModelID(real)returnedbytpm_cleanalloc
index Indexoftheerrortoclean.Theindexofthefirsterroris0
Thenexterrortocleanisalsocalledthecurrenterror.
tpm_cleanerrordrawCleanupFunctions
Createsatemporarymarkerforthecurrenterror.
(tpm_cleanerrordrawclean_id)
ReturnsTornil.
clean_id ModelID(real)returnedbytpm_cleanalloc
Unlikethepersistentmarkersdrawnbytpm_cleanerrormark,thesemarkersaredeletedwhenthedrawingredraws.
tpm_cleanerrorfixCleanupFunctions
Fixesthecurrenterror.
(tpm_cleanerrorfixclean_id)
ReturnsTornil.
clean_id ModelID(real)returnedbytpm_cleanalloc
Thisfunctionmarksthecurrenterrortofix.Itfixestheerrorsinthecleanupmodel,butdoesnotfixthedrawing.Theobjectsinthedrawingarenotfixeduntilyoucalltpm_cleanend.
Eacherrorhasadefaultmethodthattpm_cleanendusesduringerrorfixing.Youcanusetpm_cleanerrorsettochangethismethod.Forexample,thedefaultmethodforthedanglingnodeerroristoerasethelink.Ifyoucalltpm_cleanerrorsetforthiserror,thedanglingnodeismovedtoanewposition,butisnoterased.
tpm_cleanerrorgetCleanupFunctions
Getsthecoordinatesofthecurrenterrorpoint.
(tpm_cleanerrorgetclean_id)
Returnsatwo-dimensionalpointornil.
clean_id ModelID(real)returnedbytpm_cleanalloc
Theerrorpointisamisplacednode.Forexample,foralineundershoot,theendoftheunattachedlineistheerrorpoint.
Tospecifytheerrortoget,usetpm_cleanerrorcur.
tpm_cleanerrormarkCleanupFunctions
Createsapersistentmarkerforthecurrenterror.
(tpm_cleanerrormarkclean_id)
ReturnsTornil.
clean_id ModelID(real)returnedbytpm_cleanalloc
Unlikethetemporarymarkerdrawnbytpm_cleanerrordraw,thesemarkersareAutoCADobjects,andtheybecomepartofthedrawinguntilyouperformanothercleanup.AutoCADMapautomaticallyerasespersistentmarkersfromanypreviouscleanupprocess.
tpm_cleanerrorsetCleanupFunctions
Setsthecoordinatesofanerrorfixpoint.
(tpm_cleanerrorsetclean_idcoords)
ReturnsTornil.
clean_id ModelID(real)returnedbytpm_cleanalloc
coords 2Dpoint.
Youcanusethisfunctiontochangethedefaultmethodusedbytpm_cleanendduringerrorfixing.Forexample,thedefaultmethodforthedanglingnodeerroristoerasethelink.Ifyoucalltpm_cleanerrorsetforthiserror,thedanglingnodeismovedtothenewposition,butisnoterased.
Youcanalsousethisfunctiontomergeaclusterofpointstothepointyouspecify.
Totellthecleanenginewhicherrortoset,usetpm_cleanerrorcur.
tpm_cleanfreeCleanupFunctions
Freesthecleanupmodel.
(tpm_cleanfreeclean_id)
ReturnsTornil.
clean_id ModelID(real)returnedbytpm_cleanalloc
tpm_cleangroupdrawCleanupFunctions
Createstemporarymarkersforallerrorsofthecurrentgroup.
(tpm_cleangroupdrawclean_id)
ReturnsTornil.
clean_id ModelID(real)returnedbytpm_cleanalloc
tpm_cleangroupfixCleanupFunctions
Fixesallerrorsofthecurrentgroup.
(tpm_cleangroupfixclean_id)
ReturnsTornil.
clean_id ModelID(real)returnedbytpm_cleanalloc
Thisfunctionmarkserrorsintheentirecurrentgroupforfixing.Itfixestheerrorsinthecleanupmodel,butdoesnotfixthedrawing.Theobjectsinthedrawingarenotfixeduntilyoucalltpm_cleanend.
Tomarkonlythecurrenterror,usetpm_cleanerrorfix.
tpm_cleangroupmarkCleanupFunctions
Createspersistentmarkersforallerrorsofthecurrentgroup.
(tpm_cleangroupmarkclean_id)
ReturnsTornil.
clean_id ModelID(real)returnedbytpm_cleanalloc
tpm_cleangroupnextCleanupFunctions
Goestothenexterrorgroup.
(tpm_cleangroupnextclean_id)
ReturnsTornil.
clean_id ModelID(real)returnedbytpm_cleanalloc
ThefunctionalwaysreturnsT,andfailsonlywhentheclean_idparameterisinvalid.Itcannotinformyouwhentherearenomoregroupstoclean.Tocheckforthiscondition,usetpm_cleancomplete.
tpm_cleangroupqtyCleanupFunctions
Countstheerrorsinthecurrentgroup.
(tpm_cleanqroupqtyclean_id)
Returnstheerrorcount(real)ornil.
clean_id ModelID(real)returnedbytpm_cleanalloc
IntheADSRXequivalentfunction,theerrorcounttypeislong.Becausethis32-bitdatatypeisnotavailableinVisualLISP,theVisualLISPfunctionusesthe32-bittypereal.
tpm_cleangroupsubtypeCleanupFunctions
Determinesthesubtypeofthecurrentgroup.
(tpm_cleangroupsubtypeclean_id)
Returnsasubtypecodeornil.
clean_id ModelID(real)returnedbytpm_cleanalloc
SubtypeCodes
1 Degenerateentities(subtypeofEraseShortObjects)
2 Shortentities(subtypeofEraseShortObjects)
3 Shortsegments(subtypeofEraseShortObjects)
4 Vertexisneartosegment(subtypeofExtendUndershoots)
5 Vertexisneartovertex(subtypeofExtendUndershoots)
Codes1through3aresubtypesoftheshorttype.Codes4and5aresubtypesoftheundershoottype.Thisfunctionisusefulforshortandundershooterrorsonly.
DegenerateEntitiesAdegeneratepolylinehasonlyonevertex.Thisinvalidvertextypesometimesresultsfromthedrawingcleanupprocess,andcanberemovedbyfurtherdrawingcleanup.
tpm_cleanincludessCleanupFunctions
Getsacleanupmodel'sIncludeset.
(tpm_cleanincludessclean_var_id)
ReturnstheIncludeset,theselectionsetofentitiestobecleaned.
clean_var_id CleanupvariablesID(real)returnedbytpm_varalloc
Callthisfunctionaftercallingtpm_cleaninit.
ADSRXEquivalent
inttpm_cleanincludess
ade_idclean_var_id,ads_namess);
ReturnsRTNORMoranerrorcode.
ss Entitiestobecleaned,aselectionset
tpm_cleaninitCleanupFunctions
Initializesthecleanupmodel.
(tpm_cleaninitclean_idvar_idss)
ReturnsTornil.
clean_id CleanupmodelID(real)returnedbytpm_cleanalloc
var_id CleanupvariablesID(real)returnedbytpm_varalloc
ss Selectionsetornil(seenotebelowaboutINCLUDEOBJS_AUTOSELECT)
Youcanfreetheselectionsetafterthecleanupmodelhasbeeninitialized.
Thefunctionreadsthecleanupsettingsandtheselectedentitiesintothecleanupmodel.
IfthecleanupvariableINCLUDEOBJS_AUTOSELECTissetto1(selectall),allentitiesinthedrawingwillbeincluded,regardlessofthessargument,inwhichcasethisargumentcanbenilinsteadofaselectionset,asthefollowingcodesampleillustrates.
(setqclean_id(tpm_cleanalloc))(setqvar_id(tpm_varalloc))(tpm_varsetvar_id"INCLUDEOBJS_AUTOSELECT"1)(setqssIncludenil)
(tpm_cleaninitclean_idvar_idssInclude)
IfthecleanupvariableINCLUDEOBJS_LAYERSissetto"*"(alllayers),allssentitieswillbeincluded.Ifitcontainsalistoflayers,ssentitieswillbeincludedonlyiftheyresideonthoselayers.
ThecleanupvariablesIDreferencesasetofcleanupvariables.
tpm_cleaninitanchorsetCleanupFunctions
Specifiesanchoredentitiesforthecleanupmodel.
(tpm_cleaninitanchorsetclean_idclean_var_idssanchor)
Returnstornil.
clean_id CleanupmodelID(real)returnedbytpm_cleanalloc
clean_var_id CleanupvariablesID(real)returnedbytpm_varalloc
ssanchor Entitiestobeanchored,aselectionset
Anchoredentitiesremainfixedinpositionduringthecleanupprocess.Youcanfreetheselectionsetafteranchoredentitieshavebeenspecified.
Calltpm_cleaninitanchorsetbeforecallingtpm_cleaninit.
Theclean_var_idargumentreferencespropertiesforthecleanupoperationthatyouarepreparingtoinitiate(seeCleanupVariables).
IfthecleanupvariableANCHOROBJS_LAYERSissetto"*"(alllayers),allssAnchorentitieswillbeanchored.Ifitcontainsalistoflayers,ssAnchorentitieswillbeanchoredonlyiftheyresideonthoselayers.
ADSRXEquivalent
int
tpm_cleaninitanchorsetade_idclean_id,ade_idclean_var_id,ads_namessAnchor);
ReturnsRTNORMoranerrorcode.
tpm_cleanprofileloadCleanupFunctions
Loadsadrawingcleanupprofile.
(tpm_cleanprofileloadclean_var_idfilename)
ReturnsTornil.
clean_var_id CleanupvariablesID(real)returnedbytpm_varalloc
filename Fullpathand.dpffilename(string)
NoteLoadingaprofilewillresetallpropertiesreferencedbytheclean_var_idargument.
ADSRXEquivalent
inttpm_cleanprofileload
ade_idclean_var_id,char*filename);
ReturnsRTNORMoranerrorcode.
tpm_cleanprofilesaveCleanupFunctions
Savesadrawingcleanupprofile.
(tpm_cleanprofilesaveclean_var_idfilename)
ReturnsTornil.
clean_var_id CleanupvariablesID(real)returnedbytpm_varalloc
filename Fullpathand.dpffilename(string)
ADSRXEquivalent
inttpm_cleanprofilesave
ade_idclean_var_id,char*filename);
ReturnsRTNORMoranerrorcode.
tpm_cleanstartCleanupFunctions
Startsthecleanupprocess.
(tpm_cleanstartclean_id)
ReturnsTornil.
clean_id CleanupmodelID(real)returnedbytpm_cleanalloc
Thefunctionfindsthefirstgrouptypeorsubtypethatcontainserrors.Seetpm_cleangrouptypeandtpm_cleangroupsubtypeforlistsoftypes.
Cleanupisaniterativeprocess.Dependingoncleanupoptionsandprocessingorder,youmayneedtorunthecleanuploopseveraltimestoachievethedesiredresults.Afterselectingthegroupstoprocesswithtpm_cleangrouptypeandprocessingallthegroupsintheselectionset,calltpm_cleancompletetotestifcleaningiscomplete.Ifcomplete,calltpm_cleanstartandrepeatthecleanuploop.
tpm_editaddelemEditingFunctions
Addsanelementtoatopology.
(tpm_editaddelemtpm_idtypeelem)
ReturnsTornil.
tpm_id TopologyID(real).
type Elementtypecode(integer):1,2,or3,where1=Node,2=Link,and3=Polygon.
elem Elementtoadd.Dependingonthetypeargument,specifyoneofthefollowing:If1,specifyapointortheentitynameofapointobject.If2,specifytheentitynameofalineobject.If3,specifyaselectionset.
ThetopologymustbeopenwithWriteaccess.Ifyouaddanodetoalink,thelinkissplit.
tpm_editdelelemEditingFunctions
Deletesanelementfromatopology.
(tpm_editdelelemtpm_idelem_id[delobjs])
ReturnsTornil.
tpm_id TopologyID(real)
elem_id ElementID(real)
delobjs Tornil:TDeleteobjectfromthedrawingalsonilDeleteobjectfromthetopologyonly
Thisfunctiondeleteselementsfromatopology.ItdoesnoterasecorrespondingentitiesinthedrawingunlessthedelobjsargumentisT.
WarningDeletinganelementcancauseotherdeletions.
Ifyoudeleteanode,youdeleteanylinkorpolygonthatcontainsit.Ifyoudeletealink,youdeleteonlythenodesbelongingtothatlink.Ifthelinkbelongstoonepolygononly,youdeletethepolygon.Ifthelinkissharedbytwopolygons,youmergethepolygons.Ifyoudeleteapolygon,youdeleteanynodeorlinkbelongingtothatpolygononly.
tpm_editmodelemEditingFunctions
Modifiesatopologyelement.
(tpm_editmodelemtpm_idelem_idnew_val)
ReturnsTornil.
tpm_id TopologyID(real)
elem_id ElementID(real)
new_val Listconsistingofacodeforthepropertytomodifyandanewvaluefortheproperty.SeePropertiesandValuesbelow.
PropertiesandValues
(10.point) Newcoordinatesofnodeorcentroid(point)
(40.f_res) Resistanceofnode(real),orforwardresistanceoflink
(41.r_res) Reverseresistanceoflink(real)
(70.dir) Linkdirection(integer):-1Reverse0Bidirectional1Forward
Thefollowingexampleassignsnewcoordinatestothefirstnodeinanode
topology.
(setqnode_ss(ssget))(setqvar_id(tpm_varalloc))(setqresult(tpm_mntbuildvar_id"test""testdescr"1node_ss))(setqtpm_id(tpm_acopen"test"T));openforwrite(setqelem_id(tpm_elemidtpm_id10));getsfirstnode(setqresult(tpm_editmodelemtpm_idelem_id(cons10(list1.01.00.0))))
tpm_editupdelemEditingFunctions
Updatesatopologyelement.
(tpm_editupdelemtpm_idelem_id)
ReturnsTiftheobjectwassuccesfullyupdatedornilifitwasnot.
tpm_id TopologyID(real)
elem_id ElementID(real)
ThisfunctionupdatesatopologyelementsothatitreflectsthecurrentstateofthecorrespondingentityinAutoCAD.ThisfunctionisnormallyusedinconjunctionwithAutoCADNotificationsothatchangesmadeinAutoCADcanbereflectedinthetopologymodel.
tpm_elemadjElementInformationFunctions
Compilesalistofadjacentelementsforthespecifiedelement.
(tpm_elemadjtpm_idelem_idadj_type)
ReturnsalistofelementIDsornil.
tpm_id TopologyID(real)
elem_id ElementID,receivedfromtpm_elemid
adj_type Typeofadjacentelements(int).Values:1Node2Pink3Polygon
tpm_elemfindElementInformationFunctions
Findsanelementwithinatopology.
(tpm_elemfindtpm_idtypepattern)
ReturnsanelementID(real)ornil.
tpm_id TopologyID(real)
type Typeofelementtofind(int).Values:1Node2Link3Polygon
pattern Pointorentityname.Ifpatternisapoint,inwhichcasetypemustbe1,thefunctionreturnsthenearestpointorlink,ortheenclosingpolygon.Ifpatternisanentityname,inwhichcasetypecanhaveanyvalue,thefunctionreturnsthecorrespondingobject.
ThefollowingexamplegetsapointfromtheuserandfindsthenearestnodeinthetopologynamedParcel.
(setqpt(getpoint))(setqtopo_id(tpm_acopen"Parcel"))(setqnode_id(tpm_elemfindtopo_id1pt))
TheresultisanodeID,suchas4.71389e+007.
tpm_elemgetElementInformationFunctions
Listsinformationaboutanelementofatopology.
(tpm_elemgettpm_idelem_id)
Returnsalistofdottedpairsornil.
tpm_id TopologyID(real)
elem_id ElementID(tpm_id)returnedbytpm_elemid
Foreachdottedpairinthelistthatisreturned,thefirstvalueisanintegercodefortheinformationtype,andthesecondvalueistheinformation.Thelistformatdependsontheelementtype:node,link,orpolygon.
InformationListFormatforNodes
Type Information
0 PersistenttopologyID(real).
-1 Elementtypecode(integer).Withnodelists,always1,meaningnodeelement.
-2 Entitynameofthenodeobject(real).
10 Coordinatesofthenodeobject(point).
40 Noderesistance(real).Relevantonlyfornodesbelongingtonetwork
orpolygontopologies.
InformationListFormatforLinks
Type Information
0 PersistenttopologyID(real).
-1 Elementtype(integer).Withlinklists,always2,meaninglinkelement.
-2 Entitynameofthelinkobject(real).
1 TopologyIDofstartnode(real).
2 TopologyIDofendnode(real).
3 TopologyIDofleftpolygon(real).Relevantonlyifthelinkbelongstoapolygontopology.Linksinapolygontopologycanbelongtotwoadjacentpolygons,oneontheleft,andoneonetheright.
4 TopologyIDofrightpolygonthatsharesthislink(real).Relevantonlyifthelinkbelongstoapolygontopology.
40 Forwardresistanceofthelink(real).
41 Reverseresistanceofthelink(real).
70 Linkdirection(integer):-1,0,or1,where-1=Reverse,0=Bidirectional,and1=Forward.
InformationListFormatforPolygons
Type Information
0 PersistenttopologyID(real).
-1 Elementtype(integer).Withpolygonlists,always3,meaningpolygonelement.
-2 Entitynameofthepolygoncentroid(real).
10 Coordinatesofthepolygoncentroid(point).
50 Perimeterofthepolygon(real).
51 Areaofthepolygon(real).
Whenatopologyisbuilt,itisgivenasetofobjectdatafields.Theirpurposeistocontaintheinformationlistedintheprecedingtables.
tpm_elemidElementInformationFunctions
GetstheIDofanelement.
(tpm_elemidtpm_idtypeindex)
ReturnsanelementID(real)ornil.
tpm_id TopologyID(real)
type Elementtype(integer).Values:1Node2Pink3Polygon
index Elementindex(real).Theindexofthefirstelementis0
tpm_elemqtyElementInformationFunctions
Countstopologyelements.
(tpm_elemqtytpm_idtype)
Returnsanelementcount(real)ornil.
tpm_id TopologyID(real)
type Elementtype(int).Values:1Node2Link3Polygon
IntheADSRXequivalenttothisfunction,theelementcounttypeislong.Becausethis32-bitdatatypeisnotavailableinVisualLISP,theVisualLISPfunctionusesreal,another32-bittype.
tpm_elemssElementInformationFunctions
Createsaselectionsetofelementsofagiventype.
(tpm_elemsstpm_idtype)
Returnsaselectionsetornil.
tpm_id TopologyID.
type Elementtype(int).Values:1Node2Pink3Polygon
tpm_infobuildvarTopologyInformationFunctions
Getstheconfigurationvaluesofatopology.
(tpm_infobuildvartpm_idvar_id)
ReturnsTornil.
tpm_id TopologyID(real)
var_id TopologyvariablesID(real)
ThetopologyvariablesIDreferencesasetoftopologyvariablesinwhichtostorethevaluesthatthisfunctiongets.
Ifnotopologyvariablesareallocated,calltpm_varalloctoallocateasetofthemandreturntheirID.
Toreadthevaluesthatthisfunctiongets,usetpm_vargetortpm_varlist.Tobuildanewtopologyusingthesevariables,usetpm_mntbuild.
Thefollowingcodeopensatopology,readsitsconfigurationvalues,andgetsitsnodelayer.
(setqtpm_id(tpm_acopen"SampleTopo"))(setqvar_id(tpm_varalloc))(tpm_infobuildvartpm_idvar_id)(tpm_acclosetpm_id)(setqnlayer(tpm_vargetvar_id"NODE_LAYER"))
tpm_infocompleteTopologyInformationFunctions
Testsifapolygontopologyiscomplete.
(tpm_infocompletetpm_id)
ReturnsTifthetopologyiscomplete,nil.
tpm_id TopologyIDofapolygontopology.
Usethisfunctiontoverifythatapolygontopologyiscompletebeforeperforminganelementtrace,overlay,orothertopologyoperation.Thisfunctionappliesonlytopolygontopologies.
Atopologyisconsideredcompleteifallnecessaryentitiesexistinthecurrentdrawing.Itisconsideredincompleteifatleastonepolygonisincomplete.
Aquerycanbringanincompletetopologyintothecurrentdrawing.Becausethisparthasthesamenameasthecompletetopologythatitcamefrom,thepartcouldbemistakenforthewhole.Althoughyoucanexecuteanytopologyoperationonanincompletetopology,theresultmaynotbewhatyouintend.
tpm_infocorrectTopologyInformationFunctions
Testswhetheratopologyiscorrectandperformsageometricalaudit.
(tpm_infocorrecttpm_id)
ReturnsTornil.
tpm_id TopologyID.
Iftopologyentitiesarechangedusingdrawingtools,thetopologyinformationismodifiedaccordingtothegeometricalchanges.Ifthisisimpossible,thetopologybecomesincorrect.Usethisfunctiontoverifythatatopologyiscorrectbeforeperforminganelementtrace,overlay,orothertopologyoperation.Seealsotpm_infomodified.
Tofixanincorrecttopology,tryunloadingandreloadingit.Ifitdoesnotreload,youmustusetopologyedittofixthetopology.Ifthisdoesnotwork,rebuildthetopology.
NoteThisfunctionindicateswhenanerroroccurs,butdoesnotshowitslocation.
tpm_infocurrentTopologyInformationFunctions
Checksthesourcefromwhichthetopologywasloaded.
(tpm_infocurrenttpm_id)
ReturnsTifthetopologyisloadedfromthecurrentdrawing,ornilifitcomesfromsourcedrawings.
tpm_id TopologyID.
tpm_infodescTopologyInformationFunctions
Getsatopologydescription.
(tpm_infodesctpm_id)
Returnsatopologydescription(string)ornil.
tpm_id TopologyID(real)
tpm_infomodifiedTopologyInformationFunctions
Checksiftopologyelementshavebeenmodifiedusingdrawingtools.
(tpm_infomodifiedtpm_id)
ReturnsTifanyelementshavebeenmodified,otherwisenil.
tpm_id TopologyID.
Iftopologyelementshavebeenmodifiedusingdrawingtools,thenpossiblytheyarenolongercorrecttopologies.Seealsotpm_infocorrect.
tpm_infonameTopologyInformationFunctions
Getsatopologyname.
(tpm_infonametpm_id)
Returnsatopologyname(string)ornil.
tpm_id TopologyID(real)
tpm_infostatusTopologyInformationFunctions
CheckswhetherthetopologyisopenforReadorWriteaccess.
(tpm_infostatustpm_id)
ReturnsTifthetopologyisopenforWriteornilifopenforRead.
tpm_id TopologyID(real)
tpm_infotypeTopologyInformationFunctions
Getsatopologytype.
(tpm_infotypetpm_id)
Returnsatopologytypecode(int)ornil.
tpm_id TopologyID(real)
Topologytypecodes:1=node,2=network,3=polygon.
tpm_infoversionTopologyInformationFunctions
Getsatopologyversion.
(tpm_infoversiontpm_id)
Returnsatopologyversion(string)ornil.
tpm_id TopologyID(real)
Atopology'sversionistheDataExtensionversion(ADE)inwhichthetopologywascreated.Forexample,"2.026".Thisfunctiongetsthesameresultastpm_iterversion.Thedifferenceisthattpm_infoversionrequiresatopologyID,anditworksonlyontopologiesthatareopen.
tpm_iterdescTopologyIteratingFunctions
Getsatopologydescription.
(tpm_iterdesciter_id)
Returnsatopologydescription(string)ornil.
iter_id IteratorID.
Thefunctiongetsadescriptionofthetopologythattheiteratorpointsto.
ForanexamplethatshowshowyoucanuseTopologyIteratingfunctionstofindallthetopologiesthesystemknowsabout,seetpm_iterstart.
tpm_iternameTopologyIteratingFunctions
Getsatopologyname.
(tpm_iternameiter_id)
Returnsatopologyname(string)ornil.
iter_id IteratorID(real)
Thefunctiongetsthenameofthetopologythattheiteratorpointsto.
ForanexamplethatshowshowyoucanuseTopologyIteratingfunctionstofindallthetopologiesthesystemknowsabout,seetpm_iterstart.
tpm_iternextTopologyIteratingFunctions
Movestheiteratortothenexttopology.
(tpm_iternextiter_id)
ReturnsTornilifanothertopologyisnotpresent.
iter_id IteratorID(real)
Thefirsttimethisfunctioniscalledaftertpm_iterstart,itsetstheiteratoronthefirsttopologydefinition.
ForanexamplethatshowshowyoucanuseTopologyIteratingfunctionstofindallthetopologiesthesystemknowsabout,seetpm_iterstart.
tpm_iterstartTopologyIteratingFunctions
Allocatingatopologyiterator.
(tpm_iterstart[source[loaded]])
ReturnsaniteratorID(real)ornil.
source Sourceflag(int):TIteratethroughthecurrentandsourcedrawingsnilIteratethroughthecurrentdrawingonly(default)
loaded Loadedinmemoryflag(int):TIteratethroughtopologiesinmemoryonlynilIteratethroughalltopologies(default)
Thisfunctionallocatesaniteratorandpositionsitbeforethefirsttopologydefinition.Thisbehaviorhasimplicationstorememberwhenyouusethefunction.
Becausetpm_iterstartalwaysgeneratesaniteratorID,evenifthedrawinghasnotopologiestoiteratethrough,thefunctionfailsonlywhenitisoutofmemory.
Becausetpm_iterstartpositionstheiteratorbeforethefirsttopologydefinition,thefunctioncannotindicatewhetheranytopologiesexistinthedrawing.Theonlywaytodeterminewhetherthedrawinghastopologiesistocalltpm_internext,whichfailsifnotopologyexistsbeyondthecurrentpositionoftheiterator.
Youcanhavemorethanoneiteratorrunningatthesametime.
ThisexampleshowshowyoucanuseTopologyIteratingfunctionstofindallthetopologiesthesystemknowsabout.
(setqitr_id(tpm_iterstart))(if(nullitr_id)(prompt"\nERROR:Unabletostarttopologyiterator.")(while(notdone)(if(null(tpm_iternextitr_id))(setqdoneT)(progn(setqlst(list(tpm_iternameitr_id)(tpm_itertypeitr_id)(tpm_iterdescitr_id)))(setqtpmlist(conslsttpmlist)));progn);if);while);if
tpm_iterstopTopologyIteratingFunctions
Freesaniterator.
(tpm_iterstopiter_id)
ReturnsTornil.
iter_id IteratorID(real)
tpm_itertypeTopologyIteratingFunctions
Getsatopologytype.
(tpm_itertypeiter_id)
Returnsatopologytypecode(int)ornil.
iter_id IteratorID(real)
Thefunctiongetsthetypeofthetopologythattheiteratorispointingto.Thetopologytypecodesare1=node,2=network,3=polygon.
ForanexamplethatshowshowyoucanuseTopologyIteratingfunctionstofindallthetopologiesthesystemknowsabout,seetpm_iterstart.
tpm_iterversionTopologyIteratingFunctions
Getsatopologyversion.
(tpm_iterversioniter_id)
Returnsatopologyversion(string)ornil.
iter_id IteratorID(real)
Thefunctiongetstheversionofthetopologythattheiteratorispointingto.TheversionofatopologyistheversionofADEinwhichitwascreated,forexample,"2.026".Thefunctiongetsthesameresultastpm_infoversion.Thedifferenceisthattpm_infoversionrequiresatopologyID,andsoitworksonlyontopologiesthatareopen.
tpm_mntbuildBuildingandErasingFunctions
Buildsatopology.
(tpm_mntbuildvar_idnamedesctypenode_ss[link_sscntr_ss])
ReturnsTornil.
var_id TopologyvariablesID(real)
name Topologyname(string)
desc Topologydescription(string)
type Topologytypecode(int):1Node2Network3Polygon
node_ss Entityselectionsetofnodesornil
link_ss Entityselectionsetoflinksornil.Omitfornodetopology
cntr_ss Entityselectionsetofcentroidsornil.Omitfornodeandnetworktopology
ThetopologyvariablesIDreferencesasetoftopologyvariables.
Thenewtopologyisloaded,butclosed.Youmustopenitwithtpm_acopen.
ThefollowingAutoCADobjecttypesareacceptablefortopologyelements:
Forlinks:line,arc,circle,2Dand3DpolylineFornodesandcentroids:point,insert,andtext
Anodetopologycancontainonlynodes.Anetworktopologycancontainnodesorlinks,butnotcentroids.Apolygontopologycancontainallthree.
Whenthetopologyisbuilt,alllinksareassignedadefaultdirectionofbidirectional(avalueof0).Theforwardandreverseresistancevaluesarethelengthofthelink.Nodesareassignedaresistanceof0.
Whenatopologyisbuilt,itisgivenasetofobjectdatafields.Thesefieldscontaininformationabouttheelementsofthetopology.
tpm_mnteraseBuildingandErasingFunctions
Erasesaclosedtopologyfromthecurrentdrawing.
(tpm_mnterasetoponame)
ReturnsTornil.
toponame Topologyname(string)
Thisfunctioncaneraseaclosedtopologywhetherornotitisloaded.
tpm_mntrebuildBuildingandErasingFunctions
Rebuildsatopology.
(tpm_mntrebuildtoponame)
ReturnsTornil.
toponame Topologyname(string)
Therebuilttopologyisloaded,butclosed.Youmustopenitwithtpm_acopen.
Rebuildingatopologyrestoresallitsobjectdatafieldstotheirdefaultvalues.Anyobjectdatafieldsmodifiedafterthetopologywasbuiltarelost.SeeTopologyObjectData.
Whetheryouneedtorebuildatopologyafteryouchangeitdependsuponthefunctionsusedtomakethechanges.
IfchangesweremadeusingAutoCADdrawingandeditingfunctions,youmayneedtorebuildthetopology.
IftheAutoCADalterationsintroduceanerror,therebuildcouldfail.Ifthishappens,youmustcleantheobjectsagainandusetpm_mntbuild.Youcanusetpm_infocorrecttocheckforerrorsbeforeattemptingtpm_mntrebuild.
IfchangesweremadeusingTopologyfunctions,youdonothavetorebuildthetopology.Thisappliestoobjectsalteredwithfunctionssuchastpm_editaddelem,tpm_editdelelem,andtpm_editmodelem.
tpm_mntrenameBuildingandErasingFunctions
Renamesatopology.
(tpm_mntrenametoponamenewnamenewdesc)
ReturnsTornil.
toponame Topologyname(string).
newname Newtopologyname(string).
newdesc Newtopologydescription(string)
tpm_qrygetresdescTopologyQueryFunctions
Getsthedescriptionofthequeryresulttopology.
(tpm_qrygetresdesc)
Returnsatopologydescription(string)ornilifthereisnoresulttopologyorithasnodescription.
tpm_qrygetrestopoTopologyQueryFunctions
Getsthenameofthequeryresulttopology.
(tpm_qrygetrestopo)
Returnsatopologyname(string)ifthereisaresulttopologyornilifthereisnot.Ifnoresulttopologyisdefined,thennoobjectsareaddedtothecurrentdrawingwhenthequeryexecutes.
Ifthenameofthequeryresulttopologystartswith*,theresulttopologyisatemporarytopology
tpm_qrygettoponameTopologyQueryFunctions
Getsthenameofthequerysourcetopology.
(tpm_qrygettoponame)
Returnsatopologyname(string)ifthereisaquerysourcetopologyornilifthereisnot.Ifthereisaquerysourcetopology,thecurrentqueryisatopologyquery.Ifthereisnot,thecurrentqueryisastandarddataextensionquery.
tpm_qrysetrestopoTopologyQueryFunctions
Definesororundefinesaqueryresulttopology.
(tpm_qrysetrestoporesult_nameresult_desc)
ReturnsTornil.
result_name Nameofthequeryresulttopology(string)ornil
result_desc Descriptionofthequeryresulttopology(string)ornil
Adescriptionisoptional.Itspresenceorabsencehasnoeffectonthequery.Regardingthename:
Ifnonameisspecified,thennoqueryresulttopologyisdefined.Ifadefinitionalreadyexists,itiscanceled.Ifthenamebeginswithanasterisk(*),thenextqueryresultisatemporarytopology.Ifthenamebeginswithanyotheracceptablecharacter,thenextqueryresultisastandardtopology.
tpm_qrysettoponameTopologyQueryFunctions
Definesorundefinesatopologyquery.
(tpm_qrysettoponametoponame)
ReturnsTornil.
toponame Nameoftopologytoquery(string)ornil
Thisfunctiondetermineswhetherthecurrentqueryisatopologyqueryorastandarddataextensionqueryasfollows:
Ifthetoponameargumentisnil,thecurrentquerybecomesastandarddataextensionquery.
Ifthetoponameargumentisaname,thecurrentquerybecomesatopologyquery.Butifyouspecifyatopologythatdoesnotexist,asubsequentcalltoade_qryexecutereturnsnil.
tpm_traceallocNetworkTracingFunctions
Allocatesthetracingmodel.
(tpm_tracealloctpm_id[node_reslink_dirlink_forward_reslink_reverse_res])
ReturnsthetracingmodelID(real)ornil.
tpm_id TopologyID(real)
node_res Expressionfornoderesistance(string):nil=Defaultresistance
link_dir Expressionforlinkdirection(string):nil=Defaultdirection
link_forward_res Expressionforforwardlinkresistance(string):nil=Defaultresistance
link_reverse_res Expressionforreverselinkresistance(string):nil=Defaultresistance
Thisfunctionsetsthevaluesforthespecifiedtopologytotheparametersyouenter.Thevaluesstoredintopologyobjectdatawhenthetopologywascreatedareusedasdefaultsifyouomitparameters.Youcanenteranyvalidexpressionthatevaluatestoanumericresult.
Thetracingmodelcanbeusedonlywithanetworkorpolygontopology.
Whenyouenteravalueotherthannilforanyoftheoptionalresistancearguments,thisvalueisusedforallobjectsinthetopologyoftheappropriatetype.Itoverridesthecorrespondingvalueattachedtotheobject.Forexample,ifnode_resissettonil,thetracingmodelusesthevalueattachedtotopologyobjectdatawhencalculatingthetrace.Ifnode_resissetto10.0,allnodesinthetopologyareoverriddenwiththevalueof10.0whenthetraceiscalculated.
Ifyouwanttoomittheoptionalparameters,youcaneitherenterniltoinvokeadefaultvalueorleaveouttheparameteraltogether,aswithotherVisualLISPfunctions.However,beforeyouomitoptionalparameters,notethedependencyrelationshipsindicatedbybracketedgroups.Forexample,ifyouwanttousethelink_dirparameter,youmustenteranode_resparameter.
Important!WhenusingtheTopologyAPItoperformanetworktrace,suchasaBestRouteanalysis,thesourcetopologyusedtocreatethetracetopologyshouldnotbeunloadedoreraseduntilafterallAPIcallsrelatingtothetracehavebeenmade.Thisisbecausethetracetopologyreferencesthenodesandlinksinthesourcetopology.Itdoesnotcreateitsown.So,inordertodoanythingwiththeelementsofthetrace,thesourcetopologymustremainloaded.
Forexample,thefollowingBestRoutecodewillsilentlyfail:
;topo_idisthenetTopotopology(tmp_id)(setqtopo_id(tpm_acopentopo_nameT))
;createthetracemodel(setqnetwork_trace_id(tpm_tracealloctopo_id))
;createthebestroute(setqbestroute(tpm_tracebestroutetopo_idnetwork_trace_id7.01.04.09.05.06.08.0))
;removethenetTopotopology;THISSHOULDNOTBEDONEUNTILAFTERBESTROUTETOPOQUERIESAREDONE.(tpm_acclosetopo_id)(tpm_acunloadtopo_name)
;thisnextcallfailsbecausetheelementinfoisonthesourcetopology(setqBestRouteTraceElement(tpm_tracebestroutescannetwork_trace_id3))
Thesimplesolutionistodeferthecallstotpm_accloseandtpm_acunloaduntilafteralltpm_tracebestroutescancalls.
tpm_traceelemeditNetworkTracingFunctions
Modifiesatracingmodelelement.
(tpm_traceelemedittrace_idelem_idnew_val)
ReturnsTornil.
trace_id ModelID(returnedbytpm_tracealloc)
elem_id ElementID(real)
new_val Listconsistingofacodeforthepropertytomodifyandanewvaluefortheproperty.SeePropertiesandValuesbelow.
PropertiesandValues
(40.f_res) Resistanceofnode(real),orforwardresistanceoflink
(41.r_res) Reverseresistanceoflink(real)
(70.dir) Linkdirection(integer):-1Reverse0Bidirectional1Forward
tpm_traceelemgetNetworkTracingFunctions
Listsinformationaboutatracingmodelelement.
(tpm_traceelemgettrace_idelem_id)
Returnsaninformationlistornil.
trace_id TracingmodelID(real)returnedbytpm_tracealloc
elem_id TraceelementID(real)
Thelistformatdependsontheelementtype.Foreacha-list,thefirstcomponentisanintegercodefortheinformationtype,andthesecondistheinformation.
ListFormatforNodes
(-1.elem_code) Elementtypecode(integer).Withnodelists,always1,meaningnodeelement.
(40.resistance) Noderesistance(real).
ListFormatforLinks
(-1.elem_code) Elementtypecode(integer).Withlinklists,always2,meaninglinkelement.
(1.topo_id) TopologyIDofstartnode(real).
(2.topo_id) TopologyIDofendnode(real).
(40.fwd_resist) Forwardresistance(real).
(41.rev_resist) Reverseresistance(real).
(70.link_dir) Linkdirection(integer):-1,0,or1.-1=Reverse0=Bidirectional1=Forward
tpm_traceelemidNetworkTracingFunctions
ReturnstheIDoftheselectedelement.
(tpm_traceelemidtrace_idtypeindex)
ReturnsanelementID(real)ornil.
trace_id TracingmodelID(real)returnedbytpm_tracealloc
type Elementtype:1Node2Link
index Elementindex.Thefirstelement'sindexis0
ThisfunctionreturnstheIDoftheelementselected.Usethisfunctiontofindthetraceresultinthesourcetopologyafterperformingatracewithtpm_traceshortortpm_traceflood.
ThisexampleperformsashortpathtraceandgetstheIDofthefirstlinkoftheresultpath.
;opentopologytotrace(setqtpm_id(tpm_acopen"nettopo"nil));createthemodel(setqtrc_id(tpm_tracealloctpm_id));findshortestpath
(tpm_traceshorttrc_idstart_idend_id);numberoflinksinpath(setqqty(tpm_traceqtytrc_id2));getfirstlinkofpath(setqid(tpm_traceelemidtrc_id20))
tpm_tracefloodNetworkTracingFunctions
Calculatesfloodpaths.
(tpm_tracefloodtrace_idstartmaxres)
ReturnsTornil.
trace_id TracingmodelID,returnedbytpm_tracealloc(real)
start ElementIDofstartnode(real)
maxres Maximumallowedaccumulatedpathresistance(real)
Theaccumulatedresistancevalueisthetotalresistanceofthenodesandlinksthatmakeupthefloodtrace.
tpm_tracefreeNetworkTracingFunctions
Freesatracingmodel.
(tpm_tracefreetrace_id)
ReturnsTornil.
trace_id TracingmodelID(real)returnedbytpm_tracealloc
tpm_traceqtyNetworkTracingFunctions
Countstheselectedelementsafteratrace.
(tpm_traceqtytrace_idtype)
Returnsanelementcount(real)ornil.
trace_id TracingmodelID,returnedbytpm_tracealloc.
type Elementtype(integer):1Node2Link
tpm_tracesetmaxresNetworkTracingFunctions
Setsmaximumresistancefortheshortestpathalgorithm.
(tpm_tracesetmaxrestrace_idmaxres)
ReturnsTornil.
trace_id TracingmodelID(real),returnedfromtpm_tracealloc
maxres Maximumallowedaccumulatedpathresistance(real)
Thisfunctionsetsanaccumulatedresistancevalueforpathtracing.
Fortheshortestpathtracetosucceed,thetotalcalculatedresistancecannotbegreaterthanthevaluesetforthemaximumresistanceorlessthanthevaluesetfortheminimumresistance.Seetpm_tracesetminres.Seetpm_traceshort.
tpm_tracesetminresNetworkTracingFunctions
Setsminimumresistancefortheshortestpathalgorithm.
(tpm_tracesetminrestrace_idminres)
ReturnsTornil.
trace_id TracingmodelID(real),returnedfromtpm_tracealloc
minres Minimumaccumulatedallowedpathresistance(real)
Thisfunctionsetsanaccumulatedresistancevalueforpathtracing.Fortheshortestpathtracetosucceed,thetotalcalculatedresistancecannotbegreaterthanthevaluesetforthemaximumresistanceorlessthanthevaluesetfortheminimumresistance.Seetpm_tracesetmaxres.Seetpm_traceshort.
tpm_traceshortNetworkTracingFunctions
Calculatestheshortestpathbetweentwonodes.
(tpm_traceshorttrace_idstartend)
ReturnsTornil.
trace_id TracingmodelID(real),returnedbytpm_tracealloc
start ElementIDofstartnode(real)
end ElementIDofendnode(real)
Fortheshortestpathtracetosucceed,thetotalcalculatedresistancecannotbegreaterthanthevaluesetforthemaximumresistanceorlessthanthevaluesetfortheminimumresistance.Seetpm_tracesetminresandtpm_tracesetmaxres.Theaccumulatedresistancevalueisthetotalresistanceofthenodesandlinksthatmakeuptheshortestpath.
tpm_traceshortscanNetworkTracingFunctions
GetstheIDofalinkornodeintheshortestpath.
(tpm_traceshortscantrace_idflag)
ReturnsatopologyID(real)ornil.
trace_id TracingmodelID(real),returnedbytpm_tracealloc
flag Pathelementcode(integer):0Currentelement1Firstelement2Lastelement3Nextelement4Previouselement
Firstusetpm_traceshorttocalculateashortestpath.
tpm_traceshortvalNetworkTracingFunctions
Calculatestheresistanceoftheshortestpath.
(tpm_traceshortvaltrace_id)
Returnsaresistance(real)ornil.
trace_id TracingmodelID(real)returnedbytpm_tracealloc
Beforecallingthisfunction,usetpm_traceshorttocalculatetheshortestpath.
tpm_varallocVariablesFunctions
Allocatesasetofconfigurationvariables.
(tpm_varalloc)
ReturnsaconfigurationvariablesID(real)ornil.
Configurationvariablesarecomposedofcleanupvariables,cleanupactionvariables,andtopologyvariables.Thevariablesareinitializedtotheirdefaultvalues.Foralistofthesevariablesandtheirdefaultvalues,seeConfigurationVariables.
Youcanallocatemorethanonesetofconfigurationvariables.
tpm_varfreeVariablesFunctions
Freesasetofconfigurationvariables.
(tpm_varfreevar_id)
ReturnsTornil.
var_id ConfigurationvariablesID(real)
Configurationvariablesarecomposedofcleanupvariables,cleanupactionvariables,andtopologyvariables.Thevariablesareinitializedtotheirdefaultvalues.Foralistofthesevariablesandtheirdefaultvalues,seeConfigurationVariables.
tpm_vargetVariablesFunctions
Getsthevalueofaconfigurationvariable.
(tpm_vargetvar_idvar_name)
Returnsavariablevalueornil.
var_id ConfigurationvariablesID(real)
var_name Variablename(string)
Configurationvariablesarecomposedofcleanupvariables,cleanupactionvariablesandtopologyvariables.Thevariablesareinitializedtotheirdefaultvalues.Foralistofthesevariablesandtheirdefaultvalues,seeConfigurationVariables.
Thefollowingcodeopensatopology,storesthetopology'sconfigurationvaluesinanewsetofvariables,andgetsthevalueofNODE_LAYER.
(setqtpm_id(tpm_acopen"SampleTopo"))(setqvar_id(tpm_varalloc))(tpm_infobuildvartpm_idvar_id)(tpm_acclosetpm_id)(setqnlayer(tpm_vargetvar_id"NODE_LAYER"))
tpm_varlistVariablesFunctions
Getsallthevaluesinaasetofconfigurationvariables.
(tpm_varlistvar_id)
Returnsalistofname-valuepairsornil.
var_id ConfigurationvariablesID(real)
Eacha-listhasthisformat:
(variablename.value)
Configurationvariablesarecomposedofcleanupvariables,cleanupactionvariables,andtopologyvariables.Thevariablesareinitializedtotheirdefaultvalues.Foralistofthesevariablesandtheirdefaultvalues,seeConfigurationVariables.
tpm_varsetVariablesFunctions
Setsthevalueofaconfigurationvariable.
(tpm_varsetvar_idvar_namevar_value)
ReturnsTornil.
var_id ConfigurationvariablesID(real)
var_name Variablename(char)
var_value Variablevalue.
Configurationvariablesarecomposedofcleanupvariables,cleanupactionvariables,andtopologyvariables.Thevariablesareinitializedtotheirdefaultvalues.Foralistofthesevariablesandtheirdefaultvalues,seeConfigurationVariables.
Foranexamplethatshowshowtousetpm_varsetandtpm_varget,seetpm_varget.
AccessFunctions
Thefunctionsforaccessingtopologiesbeginwithtpm_ac.
tpm_acclose
Closesatopology.
tpm_acexist
Checksifatopologyexists.
tpm_acload
Loadsatopologyintomemory.
tpm_acopen
Opensatopology.
tpm_acqty
Countstopologies.
tpm_acunload
Unloadsatopologyfrommemory.
tpm_acupgradeopen
Changesaccessfromreadonlytowrite.
AnalyzingFunctions
Thefunctionsforanalyzingtopologiesbeginwithtpm_ana.
tpm_anabuffer
Createsabufferspacearoundatopology.
tpm_anadissolve
Mergestopologyelementswiththesamevalueinthespecifiedfield.
tpm_anaoverlay
Overlaystwotopologies.
BuildingandErasingFunctions
Thefunctionsfortopologymaintenancebeginwithtpm_mnt.
tpm_mntbuild
Buildsatopology.
tpm_mnterase
Erasesatopologyfromtheprojectdrawing.
tpm_mntrebuild
Rebuildsatopology.
tpm_mntrename
Renamesatopology.
CleanupFunctions
Thefunctionsforcleaningtopologyobjectsbeforebuildingthetopologybeginwithtpm_clean.
tpm_cleanactionlistdel
Deletesacleanupactionfromtheactionlist.
tpm_cleanactionlistgetat
Getsthecleanupactionatagivenlistposition.
tpm_cleanactionlistins
Insertsacleanupactionintheactionlist.
tpm_cleanactionlistqty
Getsthenumberofcleanupactionsintheactionlist.
tpm_cleanalloc
Allocatesthecleanupmodel.
tpm_cleananchorss
Getsacleanupmodel'sanchoredentities.
tpm_cleancancel
Cancelsthecleanupprocesswithoutupdatingthedrawing.
tpm_cleancomplete
Testsforanextgrouptobecleaned.
tpm_cleancreatedss
Getscreatedentitiesfollowingacleanupprocess.
tpm_cleanend
Completesthecleanupprocessandupdatesthedrawing.
tpm_cleanerrorcur
Setsthenexterrortocleaninthecurrentgroup.
tpm_cleanerrordraw
Createsatemporarymarkerforthecurrenterror.
tpm_cleanerrorfix
Fixesthecurrenterror.
tpm_cleanerrorget
Getsthecoordinatesofthecurrenterror.
tpm_cleanerrormark
Createsapersistentmarkerforthecurrenterror.
tpm_cleanerrorset
Setsthecoordinatesofanerrorfixpoint.
tpm_cleanfree
Freesthecleanupmodel.
tpm_cleangroupdraw
Createstemporarymarkersforallerrorsofthecurrentgroup.
tpm_cleangroupfix
Fixesallerrorsofthecurrentgroup.
tpm_cleangroupmark
Createspersistentmarkersforallerrorsofthecurrentgroup..
tpm_cleangroupnext
Goestothenexterrorgroup.
tpm_cleangroupqty
Countstheerrorsinthecurrentgroup.
tpm_cleangroupsubtype
Determinesthesubtypeofthecurrentgroup.
tpm_cleangrouptype
Determinesthetypeofthecurrentgroup.
tpm_cleanincludess
Getsacleanupmodel'stargetentities.
tpm_cleaninit
Initializesthecleanupmodel.
tpm_cleaninitanchorset
Specifiesanchoredentitiesforthecleanupmodel.
tpm_cleanmodifiedss
Getschangedentitiesfollowingacleanupprocess.
tpm_cleanprofileload
Loadsadrawingcleanupprofile.
tpm_cleanprofilesave
Savesadrawingcleanupprofile.
tpm_cleanstart
Startsthecleanupprocess.
tpm_cleanunchangedss
Getsunchangedentitiesfollowingacleanupprocess.
EditingFunctions
Thefunctionsforeditingtopologyelementsbeginwithtpm_edit.
tpm_editaddelem
Addsanelementtoatopology.
tpm_editdelelem
Deletesanelementfromatopology.
tpm_editmodelem
Modifiesatopologyelement.
tpm_editupdelem
Updatesatopologyelement.
ElementInformationFunctions
Thefunctionsformanagingtopologyelementsbeginwithtpm_elem.
tpm_elemadj
Compilesalistofadjacentelements.
tpm_elemfind
Findsanelement.
tpm_elemget
Listsinformationaboutanelement.
tpm_elemid
GetstheIDofanelement.
tpm_elemqty
Countstopologyelements.
tpm_elemss
Createsaselectionsetofelementsofagiventype.
TopologyIteratingFunctions
Thefunctionsforiteratingthroughtopologiesbeginwithtpm_iter.
Manyhavecounterpartsinthetopologyinformationfunctions(tpm_info[xx]).Theiteratingfunctionscanqueryanytopology,loadedorunloaded,openorclosed.Theinformationfunctionsqueryonlytopologiesthatareopen.
tpm_iterdesc
Getsatopologydescription.
tpm_itername
Getsatopologyname.
tpm_iternext
Movestheiteratortothenexttopology.
tpm_iterstart
Createsatopologyiterator.
tpm_iterstop
Freesatopologyiterator.
tpm_itertype
Getsatopologytype.
tpm_iterversion
Getstheversionofatopology.
NetworkTracingFunctions
Thefunctionsfornetworktracingbeginwithtpm_trace.
tpm_tracealloc
Allocatesatracingmodel.
tpm_tracebestroute
Calculatesthebestround-triproute.
tpm_tracebestroutescan
GetstheelementIDofalinkornodeinthebestroute.
tpm_tracebestrouteval
Calculatestheresistanceofthebestroute.
tpm_traceelemedit
Modifiesatracingelement.
tpm_traceelemget
Getsinformationaboutatracingelement.
tpm_traceelemid
GetsthetopologyIDofatracingelement.
tpm_traceflood
Tracesafloodpathfromaspecifiedpoint.
tpm_tracefree
Freesatracingmodel.
tpm_traceqty
Countstheselectedelementsafteratrace.
tpm_tracesetmaxres
Setsmaximumresistancefortheshortestpathalgorithm.
tpm_tracesetminres
Setsminimumresistancefortheshortestpathalgorithm.
tpm_traceshort
Calculatestheshortestpathbetweentwonodes.
tpm_traceshortscan
GetsthetopologyIDofalinkornodeintheshortestpath.
tpm_traceshortval
Calculatestheresistanceoftheshortestpath.
TopologyInformationFunctions
Thefunctionsforgettinginformationabouttopologiesbeginwithtpm_info.
Manyhavecounterpartsinthetopologyiteratingfunctions(tpm_iter[xx]).Theinformationfunctionscanqueryonlytopologiesthatareopen.Theiteratingfunctionscanqueryanytopology,loadedorunloaded,openorclosed.
tpm_infobuildvar
Storestheconfigurationvaluesofatopology.
tpm_infocomplete
Testsifatopologyiscomplete.
tpm_infocorrect
Testsifatopologyiscorrect.
tpm_infocurrent
Checksthesourcefromwhichatopologywasloaded.
tpm_infodesc
Getsatopologydescription.
tpm_infomodified
Checksiftopologyelementshavebeenmodifiedusingdrawingtools.
tpm_infoname
Getsatopologyname.
tpm_infostatus
CheckswhetheratopologyisopenforReadorWrite.
tpm_infotype
Getsatopologytype.
tpm_infoversion
Getsatopologyversion.
TopologyQueryFunctions
Thefunctionsforqueryingtopologiesbeginwithtpm_qry.
tpm_qrygetresdesc
Getsthedescriptionofthequeryresulttopology.
tpm_qrygetrestopo
Getsthenameofthequeryresulttopology.
tpm_qrygettoponame
Getsthenameofthequerysourcetopology.
tpm_qrysetrestopo
Definesororundefinesaqueryresulttopology.
tpm_qrysettoponame
Definesorundefinesatopologyquery.
TopologyVariablesFunctions
Thefunctionsformanagingconfigurationvariablesbeginwithtpm_var.
tpm_varalloc
Allocatesasetofconfigurationvariables.
tpm_varfree
Freesasetofconfigurationvariables.
tpm_varget
Getsthevalueofaconfigurationvariable.
tpm_varlist
Getsallthevaluesinasetofconfigurationvariables.
tpm_varset
Setsthevalueofaconfigurationvariable.
MarkerShapes
Drawingcleanupmarkersareavailableinthefollowingshapes.
ShapeCode Shape
1 Octagon
2 Triangle
3 Rhombus
4 Square
TopologyObjectData
Atopologyisgiventhefollowingsetofobjectdatafieldswhenitisbuilt.Thesefieldscontaininformationabouttheelementsofthetopology.
WarningAlthoughitispossibletouseDataExtensionObjectDatafunctions(ade_od[xx])tomodifythesefields,itisnotagoodideatodoso.Thetopologyfunctionsassumethesefieldsaremanagedbythemalone.
Element FieldName Default
Node ID(int)
Node RESISTANCE(real) 0.0
Link ID(int)
Link START_NODE(int)
Link END_NODE(int)
Link DIRECTION(int) 0(Bidirectional)
Link DIRECT_RESISTANCE(real) Length
Link REVERSE_RESISTANCE(real) Length
Link LEFT_POLYGON(int)
Link RIGHT_POLYGON(int)
Centroid ID(int)
Centroid AREA(real)
Centroid PERIMETER(real)
Centroid LINKS_QTY(int)
ThedefaultresistancevalueLengthisinterpretedasfollows,dependingontheAutoCADentitytype:
Entitytype Length
Line Linelength
Pline Totalplinelength
Arc Calculatedarclength
Circle Calculatedcircumference
Thedefaultlinkdirectionvalueis0(bi-directional).Theotherpossibledirectionvaluesare1(forward),or-1(reverse).Theforwarddirectionforlinesisfromstartpointtoendpoint.Forcirclesandarcs,theforwarddirectioniscounter-clockwise.
LocationQuery
Thisexampledefinesandexecutesalocationquery.
(mapcar'ade_dwgdeactivate(ade_dslist))(setqade_tmpprefval(ade_prefgetval"ActivateDwgsOnAttach"))(ade_prefsetval"ActivateDwgsOnAttach"T)(ade_dsattach"E:\\ADEDWG\\ARCS2.DWG")(ade_dsattach"E:\\ADEDWG\\CIRCLES2.DWG")(ade_dsattach"E:\\ADEDWG\\DONUTS.DWG")(ade_dsattach"E:\\ADEDWG\\MAKE.DWG")(ade_dsattach"E:\\ADEDWG\\POLYLINE.DWG")(ade_prefsetval"ActivateDwgsOnAttach"ade_tmpprefval)(ade_qryclear)(ade_qrysettype1)(ade_qrydefine'("""""""Location"(1)""))(ade_qryexecute)
PropertyQueries
Thefollowingexamplesdefineandexecutepropertyqueries:
(mapcar'ade_dwgdeactivate(ade_dslist))(setqade_tmpprefval(ade_prefgetval"ActivateDwgsOnAttach"))(ade_prefsetval"ActivateDwgsOnAttach"T)(ade_dsattach"E:\\ADEDWG\\ARCS2.DWG")(ade_dsattach"E:\\ADEDWG\\CIRCLES2.DWG")(ade_dsattach"E:\\ADEDWG\\DONUTS.DWG")(ade_dsattach"E:\\ADEDWG\\LINES2.DWG")(ade_dsattach"E:\\ADEDWG\\MAKE.DWG")(ade_dsattach"E:\\ADEDWG\\POLYGONS.DWG")(ade_dsattach"E:\\ADEDWG\\POLYLINE.DWG")(ade_prefsetval"ActivateDwgsOnAttach"ade_tmpprefval)(ade_qryclear)(ade_qrysettype2)(ade_qrydefine'("""""""Property"("color""=""5")""))(ade_qryexecute)
(mapcar'ade_dwgdeactivate(ade_dslist))(setqade_tmpprefval(ade_prefgetval"ActivateDwgsOnAttach"))(ade_prefsetval"ActivateDwgsOnAttach"T)(ade_dsattach"AUTO:\\AQP5.DWG")(ade_dsattach"AUTO:\\AQP5A.DWG")(ade_dsattach"AUTO:\\MAKE.DWG")(ade_prefsetval"ActivateDwgsOnAttach"ade_tmpprefval)(ade_qryclear)
(ade_qrysettype"draw")(ade_qrydefine'("""""""Property"("objtype""=""SPLINE")""))(ade_qrydefine'("OR""""""Property"("objtype""=""ELLIPSE")""))(ade_qryexecute)
LocationQuerywithPropertyAlteration
Thisexampledefinesandexecutesalocationquerywithpropertyalteration.
(mapcar'ade_dwgdeactivate(ade_dslist))(setqade_tmpprefval(ade_prefgetval"ActivateDwgsOnAttach"))(ade_prefsetval"ActivateDwgsOnAttach"T)(ade_dsattach"E:\\ADEDWG\\AQFA3.DWG")(ade_prefsetval"ActivateDwgsOnAttach"ade_tmpprefval)(ade_qryclear)(ade_qrysettype"draw")(ade_qrydefine'("""""""Location"("all")""))(ade_altpclear)(ade_altpdefine"Height""2")(ade_altpdefine"Style""Y")(ade_altpdefine"TextValue""test")(ade_altpdefine"Layer""newlyr")(ade_altpdefine"Rotation""0.5")(ade_altpdefine"Color""blue")(ade_qryexecute)
LocationQuerywithPropertyAlteration:BeforeandAfter
Thisexampleshowstwoversionsofapropertyalterationquery.Thesecondexampleisaneditedversionofthefirst.Notehowchangestotheargumentsintheade_altpdefinecallscausedifferentpropertyalterationeffects.
OriginalVersion
(mapcar'ade_dwgdeactivate(ade_dslist))(setqade_tmpprefval(ade_prefgetval"ActivateDwgsOnAttach"))(ade_prefsetval"ActivateDwgsOnAttach"T)(ade_dsattach"E:\\ADEDWG\\ARCS2.DWG")(ade_dsattach"E:\\ADEDWG\\CIRCLES2.DWG")(ade_dsattach"E:\\ADEDWG\\DONUTS.DWG")(ade_dsattach"E:\\ADEDWG\\ESPMR.DWG")(ade_dsattach"E:\\ADEDWG\\LINES2.DWG")(ade_dsattach"E:\\ADEDWG\\POLYGONS.DWG")(ade_dsattach"E:\\ADEDWG\\POLYLINE.DWG")(ade_prefsetval"ActivateDwgsOnAttach"ade_tmpprefval)(ade_qryclear)(ade_qrysettype"draw")(ade_qrydefine'("""""""Location"("all")""));ade_altpdefinecalls(ade_altpdefine"Color""5")(ade_altpdefine"Layer""NEWLYR")(ade_altpdefine"Elevation""-2")(ade_altpdefine"Thickness""1.5")(ade_altpdefine"Linetype""CENTER")
(ade_qryexecute)
EditedVersion
(mapcar'ade_dwgdeactivate(ade_dslist))(setqade_tmpprefval(ade_prefgetval"ActivateDwgsOnAttach"))(ade_prefsetval"ActivateDwgsOnAttach"T)(ade_dsattach"E:\\ADEDWG\\ARCS2.DWG")(ade_dsattach"E:\\ADEDWG\\CIRCLES2.DWG")(ade_dsattach"E:\\ADEDWG\\DONUTS.DWG")(ade_dsattach"E:\\ADEDWG\\ESPMR.DWG")(ade_dsattach"E:\\ADEDWG\\LINES2.DWG")(ade_dsattach"E:\\ADEDWG\\POLYGONS.DWG")(ade_dsattach"E:\\ADEDWG\\POLYLINE.DWG")(ade_prefsetval"ActivateDwgsOnAttach"ade_tmpprefval)(ade_qryclear)(ade_qrysettype"draw")(ade_qrydefine'("""""""Location"("all")""));changesinade_altpdefinecalls(ade_altpdefine"Color""BLUE")(ade_altpdefine"Layer""XYZ")(ade_altpdefine"Elevation""7")(ade_altpdefine"Thickness""1.5")(ade_altpdefine"Linetype""CENTER")(ade_qryexecute)
ComplexQuery
Thefollowingquerydefinitioncombinesalocationbufferfenceconditionandapropertyconditionwitharangetabledefinition,andpropertyalterationisperformedonthequeryresult.
(mapcar'ade_dwgdeactivate(ade_dslist))(setqade_tmpprefval(ade_prefgetval"ActivateDwgsOnAttach"))(ade_prefsetval"ActivateDwgsOnAttach"T)(setqdwg_id(ade_dsattach"E:\\ADEDWG\\POPS.DWG"))(ade_prefsetval"ActivateDwgsOnAttach"ade_tmpprefval)(ade_qryclear)(ade_qrysettype"draw");locationbufferfence(ade_qrydefine'("""""""Location"("bufferfence""inside"3.000000(4.4262177.9913790.000000)(2.3850545.5307880.000000)(4.6480833.9125620.000000)(5.9127165.7081280.000000)(7.7542003.8238920.000000)(8.0204393.6465520.000000))""))(ade_qrydefine'("OR""""""Property"("objtype""=""ARC,CIRCLE")""));rangetable(ade_rtdefrange"Rtable""Rangetabledependinguponobjecttype"'(("=""CIRCLE""LAYER-CIRCLE")("=""ARC""LAYER-ARC")
("OTHERWISE""""LAYER-OTHERS")))(ade_altpclear)(ade_altpdefine"Layer""(Range.TYPERtable)")(ade_altpdefine"Color""YELLOW")(ade_qryexecute)
TopologyIDs
TopologyfunctiondocumentationusesanumberofdifferentkindsofIDs,aslistedinthefollowingtable.
AlthoughtheseIDsareallthesametype,ade_id,wegivethemdifferentnamesinthedocumentationaccordingtotheirpurpose.
Type Name Identifies UsedorReturnedBy
ade_id clean_id Acleanupmodel tpm_clean[xx]
ade_id elem_id Atopologyelement tpm_editdelelemtpm_editmodelemtpm_elemadjtpm_elemgettpm_traceelemedittpm_traceelemget
ade_id iter_id Atopologyiterator tpm_iter[xx]
ade_id overlay_id Anoverlaytopology tpm_anaoverlay
ade_id source_id Asourcetopology tpm_anabuffertpm_anadissolvetpm_anaoverlay
ade_id tpm_id Atopology tpm_acclosetpm_acopen
tpm_acupgradeopentpm_editaddelemtpm_editdelelemtpm_editmodelemtpm_elemadjtpm_elemfindtpm_elemgettpm_elemidtpm_elemqtytpm_elemsstpm_info[xx]tpm_mntbuildtpm_mntrebuildtpm_tracealloctpm_traceelemgetmap_topoAuditmap_topoStat
ade_id trace_id Atracingmodel tpm_trace[xx]
ade_id var_idclean_var_idact_var_id
ConfigurationvariablesTopologyvariablesCleanupvariablesCleanupactionvariables
tpm_anabuffertpm_anadissolvetpm_anaoverlaytpm_clean[xx]tpm_infobuildvartpm_mntbuildtpm_var[xx]
LocationExpressions
Locationexpressionsareusedasquerycondargumentsinade_querydefinecallsthatdefineLocationconditions.
ThereareanumberofformatstochoosefromwhenwritingLocationexpressions.Theyarelistedbelow.TheformattousedependsontheLocationtype,whichisidentifiedineachofthefollowingformatsbythefirstargument.Theotherargumentsaredescribedbelow.
Location-All
("all")
Location-Bufferfence
("bufferfence"searchtypeoffsetpt1pt2...ptN)
Location-Circle
("circle"searchtypecenterptradius)
Location-Fence
("fence"pt1pt2...ptN)
Location-Point
("point"pt)
Location-Polygon
("polygon"searchtypept1pt2...ptN)
Location-Polyline-Bufferfence
("polyline""bufferfence"searchtypeoffsetename)
Location-Polyline-Fence
("polyline""fence"ename)
Location-Polyline-Polygon
("polyline""polygon"searchtypeename)
Location-Window
("window"searchtypept1pt2)
LocationExpressionParameters
searchtype Searchtypekeyword(string):"inside"or"crossing".
offset Bufferoffsetdistance(real).
ename AutoCADentityname,orasetofpoints,or"?".If"?",whenthequeryexecutes,itpromptstheusertoclickasetofpoints.
ptptNcenterpt A2Dor3Dpoint(alistofreals).Ifa3Dpoint,theZcoordinateisignored.
radius Radius(real).
LocationExamples
ThefollowingexamplesdefineLocationconditions.ThefirstisaLocation-Allcondition:
(ade_qrydefine'("AND""(""NOT""Location"("All")""))
ThesecondisaLocation-Windowcondition:
(ade_qrydefine'("AND""""""Location"("window""crossing"(1.02.0)(3.04.0))""))
AndthethirdisaLocation-Polylinecondition.
(ade_qrydefine(list"AND""(""""Location"(list"polyline""bufferfence""inside"20.0(entlast))""))
ThefollowingthreeexamplesofLocation-Polylineconditionsspecifytheenameargumentindifferentways.Thefirstsuppliesanentityname:
(ade_qrydefine(list"""""""Location"(list"polyline""polygon""crossing"(entlast))""))
Thesecondsuppliesasetofpoints:
(ade_qrydefine'("""""""Location"("polyline""polygon""crossing"(
1;1=Polylineopen,0=Polylineclosed
(001);Directionofnormalvector:;(001)identifiestheZaxis,;i.e.,thispolygonisparallelto;theXYplane
0.000000;Bulgefactorofavertex(4.4262177.9913790.000000);Coordinatesofavertex
0.000000(2.3850545.5307880.000000)
0.000000(4.6480833.9125620.000000)
0.000000(5.9127165.7081280.000000)
0.000000
(7.7542003.8238920.000000)
0.000000(8.0204393.6465520.000000)))""))
Andthethirdpromptstheusertoclickasetofpoints:
(ade_qrydefine'("""""""Location"("polyline""polygon""crossing""?")""))
SQLExpressions
SQLexpressionsareusedasquerycondargumentsinade_querydefinecallsthatdefineSQLconditions.
Theyhavethefollowingformat:
(linkpathnamesqlcondition)
SQLExpressionParameters
linkpathname Linktemplate(string).
sqlcondition SQLcondition(string).
ThesqlconditionargumentshouldcontainonlytheWHEREclauseofanSQLstatement(forexample,"last_name='Smith'").Toselecttheentiretable,letthesqlconditionargumentbetheemptystring("").
(ade_qrydefine'("AND""""""Sql"("EMPLN3""")""))
ObjectDataFieldTypes
Thedatatypesforobjectdatafieldsareasfollows.Thetypenamesinthefirstcolumnarethecoltypeargumentsforuseinfielddefinitions.
Type Description
integer From–2,147,483,648through2,147,483,647
character Anyalphanumericstring,includingtheemptystring,""
point Listofthreerealnumbers,separatedbycommas,thatrepresentapointwithanX,Y,andZvalue,enclosedinquotes(astringvalue)
real From–1.7E308through+1.7E308
AddingFieldstoaTable
Thefollowingsampleaddsonefieldofeachdatatypetoanexistingtable.
;Definenewfields(setqnewfields'("columns";Defineacharacterfield(("colname"."NEWFIELD1")("coldesc"."NewField1Description")("coltype"."character")("defaultval"."DefaultValue"));Defineanintegerfield(("colname"."NEWFIELD2")("coldesc"."NewField2Description")("coltype"."integer")("defaultval".1));Defineapointfield(("colname"."NEWFIELD3")("coldesc"."NewField3Description")("coltype"."point")("defaultval"."4.426217,7.991379,1.726213"));Definearealfield(("colname"."NEWFIELD4")("coldesc"."NewField4Description")("coltype"."real")("defaultval".1.2345))));Addnewfieldstoexistingtable(ade_odaddfield"OLDTABLE"newfields);
RangeTableOperators
Youcanusethefollowingcomparisonoperatorsinrangetableexpressions:
<><=>=/=otherwise
Whenthefirstelementintherangeexpressionis"otherwise",thesecondelementmustbetheemptystring("").Forexample:("otherwise""""red").Althoughyoudonotspecifyacomparisonvaluewhenyouusetheotherwiseoperator,asecondlistelementisstillrequired.
NoteThenot-equaloperator,representedhereby"/=",isrepresentedby"<>"inotherDataExtensionfunctions.
FunctionsthatReturnSelectionSets
Thefollowingfunctionsreturnselectionsets.
tpm_elemssade_editlockedade_editnewade_editlockederasedmap_dwgbreakobjmap_dwgtrimobjmap_topoclosemap_topocomplete
PlotSetAttributes
Thistableshowsplotsetattributenames,descriptions,examples,anddefaultvalues.
Attribute Description Default
name Queryname(string),e.g.,"plotset2" ""
desc Description(string),e.g.,"CompletePlotSet" ""
pnam Plottername(string),e.g.,"HPLaserJetIIIonLPT1"
""
pscr Plotscript(string),e.g.,"e,n,y" ""
block Nameofplotlayout,ablockname(string),e.g.,"TBLOCK"
""
atts Listofattributesfortheblock(stringlist),e.g.,"TITLE"
nil
vlayer Mainviewportlayer(string),e.g.,"VPORT2" ""
vdispl Layerstodisableforthemainviewport(stringlist),e.g.,"0"
nil
kflg Enablesthereferenceviewport:TornilTEnablednilDisabled
T
Notethattherearetwodependentattributes,"klayer"and"kdispl"
klayer Keyviewportlayer(string),e.g.,"VPORT1",thelayerofthereferenceviewport,whichmustbeadifferentlayerfromthelayerusedforthemainviewport(attribute"vlayer");ifthefunctionmap_pltblkvpsreturnsonlyoneviewportlayer,itshouldbeusedforthemainviewport
""
kdispl Keydisplaylayers(stringlist),e.g.,"BOUNDARY",alistoflayerstobedisplayedinthereferencedviewport.Thisshouldnotbenilif"kflg"isenabled.Validlayersareallthelayersreturnedbyade_dsproplistusingtheoption"layer"
nil
kscl Keyviewportscalefactor(real) 0.25
dwgs Listofsourcedrawings(stringlist),e.g.,"DRAWING1.DWG""DRAWING2.DWG"
nil
dact Forcedrawingactiveatplottime:Tornil T
qcat Listofquerycatalogs(stringlist),pairedwithqnamlistentries,e.g.,"Queries"
nil
qnam Listofquerynames(stringlist),pairedwithqcatlistentries,e.g.,"Query_One"
nil
bdwg Boundarydrawing(string),e.g.,"BOUNDARY.DWG"
""
bnds Boundaries(stringlist),theboundaryorboundariestousebyprovidingthevalueforthefieldassignedin"bnamf",e.g.,"Boundary#3"
nil
blyr Boundarylayer(string),thenameofthelayertheboundaryisplacedon.Itcanbeanylayerofthe
""
boundarydrawing.Forexample,"BOUNDARY"
bnamt Boundarynametable(string),thenameoftheobjectdatatableattachedtotheboundaryobject,e.g.,"BOUNDARIES"
""
bnamf Boundarynamefield(string),thenameofthefieldtouse(fromthetableassignedin"bnamt")forthe"bnds"attribute,e.g.,"name"
""
bodfs Boundaryfields(stringlist),thelistoffieldnamestobemappedtoattributesinthetitleblock,e.g.,"name"(seedetailsandexamplefollowingthistable);thetitleblockisassignedusingtheattributesfromtheblockassignedin"block"
nil
sflg Plottospecifiedscale:Tornil nil
scale Plotscale(string),e.g.,"1:2000" 1:1
clip Clipobjectsagainstboundary(flag):Tornil
nil
pbnd Plotboundary(flag):TornilTPlotboundarypolylinesareplottednilPlotboundarypolylinesareerasedbeforeplotting
nil
bbuf Bufferboundary:Tornil nil
btyp Buffertype:"true"or"rect""true"Offsetstheminimumboundingrectangleforamapboundarypolyline"rect"Specifiesanoffsetofanexistingplotboundaryline
true
bdist Bufferdistance(real) 0.10
Mappingofobjectdatafieldstoblockattributesismanagedbythetwoplotattributes"bodfs"and"atts".Themappingisbestexplainedbyexample.Supposethefollowingconditions:
Theboundaryobjectdatatable,definedbythe"bnamf"attribute,hasthefollowingfields:Field1,Field2,Field3,andField4.
Thelayoutblock,definedbythe"block"attribute,hasthefollowingattributes:Attr1,Attr2,Attr3,Attr4,andAttr5.YouwantthevalueofField1toappearinplaceofAttr2,thevalueofField2inplaceofAttr3,andvalueofField4inplaceofAttr1.
Todefinethedesiredmapping,setthe"bodfs"attributeto("field1""field2""field4")andthe"atts"attributeto("attr2""attr3""attr1").Whenplottingisdone,valuesofthefieldsfromtheobjectdatatableattachedtotheboundary'sclosedpolylinewillbeassignedtothespecifiedblockattributes.Thenumberofelementsineachlistfor"bodfs"and"atts"mustbethesame.