TR0140(v1.5)May23,20081WorkspaceManagerAPIReferenceSummaryTechnicalReferenceTR0140(v1.5)May23,2008ThisreferenceprovidesaconcisereferenceoftheWorkspaceAPIaspartoftheAltiumDesignerRunTimeLibrary.TheWorkSpaceManagerApplicationProgrammingInterfacereferencecoverstheWorkspacemanagerobjectinterfacesfromtheWorkspaceManagerObjectModel.Theworkspacemanagerinterfacesexistaslongthereareassociatedexistingobjectsinmemory,thuswhenwritingascriptorservercode,youhavetheresponsibilityofcheckingwhethertheinterfaceyouwishtoqueryexistsornotbeforeyouproceedtoinvoketheinterface'smethods.Youwillhavetoensurethatthedesignprojectiscompiledfirstotherwisetheworkspacemanagerinterfacesareinaninvalidstateandwillbereturningnilvalues.Theworkspacemanagerprovidesabridgebetweensourcedocuments(suchasSchematicdocuments)anditscorrespondingprimaryimplementationdocuments(suchasPCBdocuments).Thisworkspacemanagerprovidesyouinformationonhowaprojectisstructured,andinformationonnetsanditsassociatednetawareobjectsofsourceandimplementationdocuments.TheIWorkSpaceinterfacedealswithprojects,documentsandobjectsontheopendocuments.Touseworkspaceinterfaces,theprojectneedstobecompiledfirstrefreshingallthelinkagesandnetsuptodate.MainWorkspaceManagerinterfaces•TheIDMObjectinterfaceisagenericinterfaceusedforallotherWorkSpaceinterfaces.•TheIWorkSpaceinterfaceisthetoplevelinterfaceandcontainsmanyinterfaceswithin.ForexampletheIWorkSpaceinterfacehasaDM_OpenProjectfunctionwhichreturnsacurrentlyopenorcurrentlyfocussedIProjectinterface.•TheIProjectinterfacerepresentsthecurrentprojectinAltiumDesigner.•TheIDocumentinterfacerepresentsadocumentinAltiumDesigner.LogicalandPhysicalDocumentsAnimportantnote,therearelogicalandphysicaldocuments;thesetermsareusedtodifferentiatethedocumentsinmulti-channelprojects.Amultichanneldesignmeansthatasinglesheetisreferencedrepeatedlyforachanneldesign.Thissheetiscalledalogicaldocument.Aphysicaldocument(usuallyaPCBdocument)hascomponentswithuniquenameswithinaroomwhichismappedtoachannelonaSchematicsheet.SoamultichanneldesigntranslatestomultipleroomswithcomponentswithuniquephysicaldesignatorsonaPCB.AphysicaldesignatorofaPCBcomponentiscalculatedtohavethehierarchypathofaschematicprojectaswellasthelogicaldesignatoroftheassociatedSchematiccomponenttoensurethatthisdesignatorforthePCBcomponentisunique.ExampleObtainingtheprojectpathfromthecurrentIProjectinterface.//GetWSMinterface(theshelloftheWorkSpaceManagerinterface).WSM:=GetWorkSpace;IfWSM=NilThenExit;Document:=WSM.DM_Document;IfDocument=NilTheExit;Project:=Document.DM_Project;ScriptExamplesTherearescriptexamplesinthe\Examples\Scripts\WSMfolderSeealsoWorkSpaceManagerAPIReference2TR0140(v1.5)May23,2008WorkSpaceManagerInterfaceOverviewWorkSpaceManagerInterfacesWorkSpaceManagerEnumeratedTypesWorkSpaceManagerFunctionsWorkspaceManagerObjectModelTohaveaccesstotheworkspaceinterfaceobjectwhichrepresentstheworkspacemanagerinAltiumDesigner,youneedtoinvoketheGetWorkspacefunctionfirst.ThisfunctionreturnsyoutheIWorkspaceinterfaceobject.Anobjectinterfaceisjustameansofaccesstoanobjectinmemory.Theworkspacemanagerprovidesabridgebetweensourcedocuments(suchasSchematicdocuments)anditscorrespondingprimaryimplementationdocuments(suchasPCBdocuments).ThisworkspacemanagerprovidesyoutheabilitytomanipulatethecontentsofadesignprojectinAltiumDesigner.AfewofWorkspacemanagerObjectInterfacesTheIDMObjectinterfaceisagenericinterfaceusedforallotherWorkSpaceinterfaces.TheIWorkSpaceinterfaceisthetoplevelinterfaceandcontainsmanyinterfaceswithin.ForexampletheIWorkSpaceinterfacehasaDM_OpenProjectfunctionwhichreturnsacurrentlyopenorcurrentlyfocussedIProjectinterface.TheIProjectinterfacerepresentsadesignprojectinAltiumDesigner.TheIPartinterfacerepresentsapartofamulti-partcomponent.ThiscomponentisrepresentedbytheIComponentinterface.TheIDocumentinterfacerepresentsadocumentinAltiumDesigner.TheIECOinterfaceisusedfortheEngineeringChangeOrdersysteminPCBandSchematicservers.TheINetinterfaceisacontainerstoringNetawareobjects(whichareINetIteminterfaces)thathavethesamenetproperty.SothereareINetinterfacesrepresentingnetsonadocument.TheINetIteminterfaceistheancestorinterfacefortheCross,Pin,Port,Netlabel,SheetentryandPowerObjectinterfaces.Theseinterfaceobjectshaveanetpropertyandthustheseobjectscanbepartofanet.DocumentinterfaceOverviewTheIDocumentinterfacerepresentstheexistingdocumentinAltiumDesigner.AdocumentcanbeaSchematic,PCB,VHDL,PCBLibrarydocumentetc.TheDM_DocumentKindmethodoftheIDocumentinterfacewheninvokedreturnsyouthedocumenttype.Adocumentcanbepartofaprojectorfreedocumentsproject.Anexistingdocumentcanbequeriedtoreturntheprojectinterfacethisdocumentisassociatedwith.NotesTheIDocumentinterfaceisastandaloneinterface.IDocumentmethodsDM_BusCountDM_BusesDM_ChannelClassCountDM_ChannelClassesDM_ChannelIndexDM_ChannelPrefixDM_ChannelRoomNamingStyleDM_ChildDocumentCountDM_ChildDocumentsDM_CompileDM_ComponentClassCountIDocumentpropertiesWorkSpaceManagerAPIReferenceTR0140(v1.5)May23,20083DM_ComponentClassesDM_ComponentCountDM_ComponentsDM_ConstraintGroupCountDM_Con