API Help
Eplan.EplApi.DataModel.Topology Namespace / Segment Class
Members Example

In This Topic
    Segment Class
    In This Topic
    Represent object which can route topology connections.
    Inheritance Hierarchy

    System.Object
       Eplan.EplApi.DataModel.StorableObject
          Eplan.EplApi.DataModel.Placement
             Eplan.EplApi.DataModel.SymbolReference
                Eplan.EplApi.DataModel.FunctionBase
                   Eplan.EplApi.DataModel.Function
                      Eplan.EplApi.DataModel.Topology.Segment

    Syntax
    Remarks
    To create valid topology all elements to which segment is connected have to be have their representation type set to Eplan.EplApi.DataModel.DocumentTypeManager.DocumentType.Topology.
    Example
    The following example shows how to create basic topology from two functions.
    //get symbol variant for topology functions
    string strSymbolLibName = "SPECIAL";
    string strSymbolName = "CABSTND";
    int nVariant = 0;
    Symbol oFunctionsTopologicPageSymbol = new Symbol(new SymbolLibrary(m_oTestProject, strSymbolLibName), strSymbolName);
    SymbolVariant oFunctionsTopologicPageSymbolVariant = new SymbolVariant();
    oFunctionsTopologicPageSymbolVariant.Initialize(oFunctionsTopologicPageSymbol, nVariant);
    
    //create topology representation of oFunction1
    Function oTopologyFunc1 = new Function();
    oTopologyFunc1.Create(m_oTestProject, oFunction1.FunctionDefinition);
    oTopologyFunc1.SymbolVariant = oFunctionsTopologicPageSymbolVariant;
    oTopologyFunc1.Page = oTopologyPage;
    oTopologyFunc1.Location = new PointD(100, 100);
    oTopologyFunc1.ManualPlacementType = DocumentTypeManager.DocumentType.Topology;
    oTopologyFunc1.IsMainFunction = false;
    oTopologyFunc1.Name = oFunction1.Properties.FUNC_FULLDEVICETAG;
    new NameService().AdjustVisibleName(oTopologyFunc1);
    
    //create topology representation of oFunction2
    Function oTopologyFunc2 = new Function();
    oTopologyFunc2.Create(m_oTestProject, oFunction2.FunctionDefinition);
    oTopologyFunc2.SymbolVariant = oFunctionsTopologicPageSymbolVariant;
    oTopologyFunc2.Page = oTopologyPage;
    oTopologyFunc2.Location = new PointD(200, 100);
    oTopologyFunc2.ManualPlacementType = DocumentTypeManager.DocumentType.Topology;
    oTopologyFunc2.IsMainFunction = false;
    oTopologyFunc2.Name = oFunction2.Properties.FUNC_FULLDEVICETAG;
    new NameService().AdjustVisibleName(oTopologyFunc2);
    
    //get symbol variant for topology corners
    strSymbolLibName = "SPECIAL";
    strSymbolName = "CABSP";
    nVariant = 0;
    Symbol oCornerSymbol = new Symbol(new SymbolLibrary(m_oTestProject, strSymbolLibName), strSymbolName);
    SymbolVariant oCornerSymbolVariant = new SymbolVariant();
    oCornerSymbolVariant.Initialize(oCornerSymbol, nVariant);
    
    //create corner 1
    Function oCorner1 = Function.Create(oCornerSymbolVariant, oTopologyPage) as Function;
    oCorner1.ManualPlacementType = DocumentTypeManager.DocumentType.Topology;
    oCorner1.Location = new PointD(100.0, 150.0);
    
    //create corner 1
    Function oCorner2 = Function.Create(oCornerSymbolVariant, oTopologyPage) as Function;
    oCorner2.ManualPlacementType = DocumentTypeManager.DocumentType.Topology;
    oCorner2.Location = new PointD(200.0, 150.0);
    
    //create segments
    Segment oSegment1 = new Segment();
    oSegment1.Create(m_oTestProject, oTopologyFunc1, oCorner1);
    oSegment1.Page = oTopologyPage;
    
    Segment oSegment2 = new Segment();
    oSegment2.Create(m_oTestProject, oCorner1, oCorner2);
    oSegment2.Page = oTopologyPage;
    
    Segment oSegment3 = new Segment();
    oSegment3.Create(m_oTestProject, oCorner2, oTopologyFunc2);
    oSegment3.Page = oTopologyPage;
    
    //update start and end points of segments
    new TopologyService().UpdatePage(oTopologyPage);
    
    
    Public Constructors
     NameDescription
    Public ConstructorDefault constructor.  
    Top
    Public Properties
     NameDescription
    Public PropertyDetermines if connection point data are saved locally at the part placement. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyThe value determines if target is taken from net-based routing or not. (Inherited from Eplan.EplApi.DataModel.SymbolReference)
    Public PropertySets the ArticleReference at the reference position of the ArticleReference. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyReturns Eplan.EplApi.DataModel.ArticleReferences that are referenced by Function. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyReturns Eplan.EplApi.DataModel.Articles that are referenced by Function, and only those that are stored in project database. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyReturns a block which this SymbolReference object is part of. If this object is not a part of any block, this property returns NULL. (Inherited from Eplan.EplApi.DataModel.SymbolReference)
    Public PropertyThe property gives the search direction of the full device tag, when the visible device tag name is empty. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyReturns flag, if this function can give connection designations to other functions (is meant for the Device-Tag-Editor, where sometimes there can be edited more connection designations than the actual function has) (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyCheck if the Function can have Eplan.EplApi.DataModel.Articles. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyReturns the Category of the Function. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyArray of connection points data. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyReturns Eplan.EplApi.DataModel.Connections that have the Functions as a start function or end function. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyReturns contact image assign to this function or null. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyGets or sets a value indicating where contact image is displayed for this function. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyReturns an array of objects cross-referenced with this object (i.e. having the same name - in case of functions - or otherwise associated) (Inherited from Eplan.EplApi.DataModel.StorableObject)
    Public PropertyReturns the project as number. The number is unique for all open projects in one session. The number changes when the project is closed and opened again. (Inherited from Eplan.EplApi.DataModel.StorableObject)
    Public PropertySets display sequence. The drawing order flag will be used to sort elements according to drawing order within a group. If elements chare the same value the drawing order will result from order of the data model. Default value is 67. (Inherited from Eplan.EplApi.DataModel.Placement)
    Public PropertyReturns end point of this segment.  
    Public PropertyReturns the second of two Eplan.EplApi.DataModel.SymbolReferences connected by this segment.  
    Public PropertyReturns the Eplan.EplApi.DataModel.FunctionDefinition of the Function. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyIf this object is the main function of a device or a cable, this property returns an array of transient object (of Connection or Function type) that represent function templates contained by the device or the cable. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyAn array of the symbols's connection points (Inherited from Eplan.EplApi.DataModel.SymbolReference)
    Public PropertyAn array of Eplan.EplApi.DataModel.SymbolReference.GraphicalConnection objects representing all auto-connecting lines connected to the pins of the symbol. This property may be useful to check graphical layout of connections associated with the symbol (including T-nodes, corners, etc.). (Inherited from Eplan.EplApi.DataModel.SymbolReference)
    Public PropertyReturns a group that the Placement object belongs to. If the Placement object doesn't belong to any group, NULL is returned. (Inherited from Eplan.EplApi.DataModel.Placement)
    Public PropertyDetermines if connection points to graphical terminals mapping is the default mapping, according to the symbol. Please refer to the line "Symbol connection point" in dialog "Connection point logic" in GUI. This property returns ... true, if all Symbol connection points are mapped to the respective connection point of the Function. false, if the mapping on the Function was changed in regard to the Symbol. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyReturns true if the symbol's logical area is a polyline (consisting of segments) rather than just a rectangle. (Inherited from Eplan.EplApi.DataModel.SymbolReference)
    Public PropertyGets/Sets, if the function separates potentials. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyReturns identifying name of the Function. (Inherited from Eplan.EplApi.DataModel.FunctionBase)
    Public PropertyReturns true if this is a Function object that covers a function template in a device. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertySet or checks if device of this function is fixed. (Inherited from Eplan.EplApi.DataModel.Function)
    Public Property

    Determines if the the StorableObject is locked.

    The StorableObject is locked when it was explicitly or implicitly locked.

    (Inherited from Eplan.EplApi.DataModel.StorableObject)
    Public PropertyGets/Sets a flag which indicates a main function of the device. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyReturns true if the list of name's properties is empty (Inherited from Eplan.EplApi.DataModel.FunctionBase)
    Public PropertyReturns, if the function is netconnecting. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyReturns true if the placement is placed (Inherited from Eplan.EplApi.DataModel.Placement)
    Public PropertyDetermines if StorableObject is read-only (Inherited from Eplan.EplApi.DataModel.StorableObject)
    Public PropertyGets/Sets visibility of the object as set in its properties dialog. (Inherited from Eplan.EplApi.DataModel.Placement)
    Public PropertyReturns true if this is a transient Function object repesenting an uncovered function template of a device. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyDetermines whether changes made on this template will be stored after UpdateLocalTemplate is called. (Inherited from Eplan.EplApi.DataModel.Function)
    Public Property

    Determines if the the StorableObject is transient.

    The StorableObject is transient when it was created by default constructor and:

    it is a Eplan.EplApi.DataModel.Page and it was not assigned a Eplan.EplApi.DataModel.Project,

    it is a Eplan.EplApi.DataModel.Placement or any class derived from it and was not assigned a Eplan.EplApi.DataModel.Page.

    (Inherited from Eplan.EplApi.DataModel.StorableObject)
    Public PropertyDetermines if StorableObject is correct database object and is not deleted. (Inherited from Eplan.EplApi.DataModel.StorableObject)
    Public PropertyGet or set the placement's location. (Inherited from Eplan.EplApi.DataModel.FunctionBase)
    Public PropertyGets/Sets an array of segments that the symbol's logical area may consist of. (Inherited from Eplan.EplApi.DataModel.SymbolReference)
    Public PropertyGets custom placement type. Placement type express how function will be shown on schema. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyReturns the name of the FunctionBase. (Inherited from Eplan.EplApi.DataModel.FunctionBase)
    Public PropertyName of the Function. (Inherited from Eplan.EplApi.DataModel.FunctionBase)
    Public PropertyReturns an array of nested functions of the given main function. Nested-functions property returns functions whose identifying device tag contains the device tag of the parent + nested part of device tag. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyReturns the object identifier as number. The number is unique for all objects of this type. (Inherited from Eplan.EplApi.DataModel.StorableObject)
    Public PropertyReturns the page the Placement is on, or assigns a Page object to the placement. If the placement was previously assigned to another page, it is removed from old one and assigned to the page given as an argument. (Inherited from Eplan.EplApi.DataModel.Placement)
    Public PropertyGets parent function (a main function having the same identifying name or, in case of sub-terminals, the main terminal of a multi-level terminal). For main functions it returns NULL. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyGets/Sets an array of the function's connection points. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyEplan.EplApi.DataModel.Planning.PlanningSegment assigned to this function. (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertyReturns the project the StorableObject belongs to. (Inherited from Eplan.EplApi.DataModel.StorableObject)
    Public Property.NET Property enabling access to EPLAN properties of the Segment object.  
    Public PropertyReturns Eplan.EplApi.DataModel.Graphics.PropertyPlacements assigned to the SymbolReference. (Inherited from Eplan.EplApi.DataModel.SymbolReference)
    Public PropertyReturns Eplan.EplApi.DataModel.SymbolReference.PropertyPlacementsSchemas assigned to this SymbolReference. (Inherited from Eplan.EplApi.DataModel.SymbolReference)
    Public PropertyReturns start point of this segment.  
    Public PropertyReturns the first of two Eplan.EplApi.DataModel.SymbolReferences connected by this segment.  
    Public PropertyReturns an array of sub-functions of the given main function. Sub-functions are all functions having the same identifying device tag (property 20005) which are not main (a.k.a. auxiliary functions). (Inherited from Eplan.EplApi.DataModel.Function)
    Public PropertySpecifies Eplan.EplApi.DataModel.MasterData.SymbolVariant assigned to this SymbolReference. (Inherited from Eplan.EplApi.DataModel.SymbolReference)
    Public PropertySet configuration type to select different variants for point or destination wiring (Inherited from Eplan.EplApi.DataModel.SymbolReference)
    Public PropertyReturns the type of the object as number. (Inherited from Eplan.EplApi.DataModel.StorableObject)
    Public PropertyReturn true if the instance uses the local property instances, otherwise it uses the ones of the variant. (Inherited from Eplan.EplApi.DataModel.SymbolReference)
    Public PropertyReturns the visible name of the FunctionBase. (Inherited from Eplan.EplApi.DataModel.FunctionBase)
    Public PropertyReturns visible name of the Function. (Inherited from Eplan.EplApi.DataModel.FunctionBase)
    Public PropertyCheck if object is currently write protected or sets Manual write protection (Inherited from Eplan.EplApi.DataModel.Function)
    Top
    Public Methods
     NameDescription
    Public MethodOverloaded. Adds a new Eplan.EplApi.DataModel.ArticleReference to the Function. (Inherited from Eplan.EplApi.DataModel.Function)
    Public MethodCreates new connection point position. (Inherited from Eplan.EplApi.DataModel.Function)
    Public MethodAssigns this function to another, which means that values of this function's properties are copied to the target object and the function itself is removed from the project. (Inherited from Eplan.EplApi.DataModel.Function)
    Public MethodConverts the symbol representing this object into a group of graphical placements. (Inherited from Eplan.EplApi.DataModel.SymbolReference)
    Public MethodCopy Placement and insert the Copy into destination group Placement will be copied into the same Project as the destination group If this placement is transient, the copy will be persistent, if the destination group is also persistent. Group or Page, where the placement will be inserted (Inherited from Eplan.EplApi.DataModel.Placement)
    Public MethodOverloaded. Creates new unplaced segment and assign to it start and end symbol.  
    Public MethodOverloaded. Creates new transient unplaced segment and assign to it start and end symbol.  
    Public MethodDestructor for deterministic finalization of Segment object. (Inherited from Eplan.EplApi.DataModel.StorableObject)
    Public MethodOperator of comparison implementation. Checks if two StorableObjects refer to the same object in the project. (Inherited from Eplan.EplApi.DataModel.StorableObject)
    Public MethodPlacement bounding box. Bounding box is a rectangle which contain this placement. It can be also used to determine placement size. (Inherited from Eplan.EplApi.DataModel.Placement)
    Public MethodGets graphical representation of the Function. (Inherited from Eplan.EplApi.DataModel.Function)
    Public MethodServes as the default hash function. (Inherited from Eplan.EplApi.DataModel.StorableObject)
    Public MethodReturns a rectangle which is the logical area of the object derived from SymbolReference. For objects having symbols consisting of segments, this method returns the bounding box of the polyline created by those segments. (Inherited from Eplan.EplApi.DataModel.SymbolReference)
    Public MethodGets name prototype properties id with separators. (Inherited from Eplan.EplApi.DataModel.FunctionBase)
    Public MethodSets properties which are used for building name of object. (Inherited from Eplan.EplApi.DataModel.FunctionBase)
    Public MethodGets list of property placements of given type. (Inherited from Eplan.EplApi.DataModel.SymbolReference)
    Public MethodChecks if a specific write protection kind was set. (Inherited from Eplan.EplApi.DataModel.Function)
    Public Method

    Determines if the the Device (which can refer to several objects, such as all function's representations) is locked.

    The LockDevice is locked when it was explicitly or implicitly locked.

    (Inherited from Eplan.EplApi.DataModel.Function)
    Public MethodChecks, if the point is inside logical area of the symbol. Returns true, if the symbol has a logical area and the point is inside. The logical area may be a rectangle or a polyline without arcs. (Inherited from Eplan.EplApi.DataModel.Function)
    Public MethodTries to lock current device (which can refer to several objects, such as all function's representations) in database for exclusive access. Throws Eplan.EplApi.Base.LockingException on failure. If locked device in placed, corresponding page(s) will be locked as well. (Inherited from Eplan.EplApi.DataModel.Function)
    Public MethodTries to lock current object in database for exclusive access. Throws Eplan.EplApi.Base.LockingException on failure. (Inherited from Eplan.EplApi.DataModel.StorableObject)
    Public MethodInstantiates the function represented by this object. Primarily used for instantiating an uncovered function template. (Inherited from Eplan.EplApi.DataModel.Function)
    Public MethodTemporarily disables write protection. Note that current write protection (Inherited from Eplan.EplApi.DataModel.Function)
    Public MethodPlaces the function onto the given page, in the given location and with the symbol specified by the placementType and the pSymbolVariant parameters. (Inherited from Eplan.EplApi.DataModel.Function)
    Public MethodPlaces a macro assigned to this function together with a special symbol configured in settings. The symbol placed has 'Functional' representation type and the macro is converted to graphics after insertion. If no macro is assigned to the function in its article data (ARTICLE_GROUPSYMBOLMACRO property), the macro specified by the third parameter ('strMacroFileName') will be inserted. (Inherited from Eplan.EplApi.DataModel.Function)
    Public MethodRemoves placement. (Inherited from Eplan.EplApi.DataModel.Placement)
    Public MethodRemoves the ArticleReference from the Function (Inherited from Eplan.EplApi.DataModel.Function)
    Public MethodRemoves connection point data stored under given index. (Inherited from Eplan.EplApi.DataModel.Function)
    Public MethodRemoves placement from the page. Object becomes not-placed. (Inherited from Eplan.EplApi.DataModel.Function)
    Public MethodReorders property placements of one type, which are assigned to this SymbolReference. (Inherited from Eplan.EplApi.DataModel.SymbolReference)
    Public MethodResets connection points to graphical terminals mapping. (Inherited from Eplan.EplApi.DataModel.Function)
    Public MethodOverloaded. Scales the placement (or group of placements) by the specified factors in X and Y axis with scaling origin point specified by the ptOrigin parameter X axis factor. E.g. value of 2 makes the width two times bigger.Y axis factor. E.g. value of 0.5 makes the height two times smaller.Scaling origin point. (Inherited from Eplan.EplApi.DataModel.Placement)
    Public MethodSets rectangular logical area for objects derived from SymbolReference. (Inherited from Eplan.EplApi.DataModel.SymbolReference)
    Public MethodAssigns Eplan.EplApi.DataModel.Planning.PlanningSegment to this function. (Inherited from Eplan.EplApi.DataModel.Function)
    Public MethodTries to lock current object. If object is Eplan.EplApi.DataModel.Placement - it's page will be locked as well; Eplan.EplApi.DataModel.E3D.Placement3D locks it's installation space; Eplan.EplApi.DataModel.Function locks all it's connections and connection definition points; Eplan.EplApi.DataModel.Page locks all placements from this page. Throws Eplan.EplApi.Base.LockingException on failure. (Inherited from Eplan.EplApi.DataModel.StorableObject)
    Public MethodStores data from connection point position in function under given index. (Inherited from Eplan.EplApi.DataModel.Function)
    Public MethodCopies or removes all local ProperyPlacemnets and sets flag (Inherited from Eplan.EplApi.DataModel.SymbolReference)
    Public MethodReturns this object as string identifier. (Inherited from Eplan.EplApi.DataModel.StorableObject)
    Public MethodStores changes into object from which template has been taken. (Inherited from Eplan.EplApi.DataModel.Function)
    Top
    See Also