API Help
Eplan.EplApi.DataModel.Graphics Namespace / PlaceHolder Class
Members Example

In This Topic
    PlaceHolder Class
    In This Topic
    Using the PlaceHolder object you can forward records of properties to the references objects. You also can get information about place holders in macros.
    Inheritance Hierarchy

    System.Object
       Eplan.EplApi.DataModel.StorableObject
          Eplan.EplApi.DataModel.Placement
             Eplan.EplApi.DataModel.Graphics.GraphicalPlacement
                Eplan.EplApi.DataModel.Graphics.PlaceHolder

    Syntax
    Remarks
    To reduce the number of displayed properties refer to two user settings. First is 'USER.MacrosGui.XMDlgPlaceholder.ShowOnlyFilled' which controls if properties with empty value in 'Variable' column are displayed. Second setting is 'USER.MacrosGui.XMDlgPlaceholder.ShowCurrentValueFilled' which controls if properties with empty value in 'Current value' column are displayed.
    Example
    The following example shows how to use class PlaceHolder. Here is example of PlaceHolder having IsChangeable property set.
    // Create PlaceHolder
    PlaceHolder placeHolder = new PlaceHolder();
    placeHolder.Create(oPage);
    placeHolder.Location = new PointD(80.0, 200.0);
    placeHolder.Name = "PlaceHolder 1";
    
    // Add variables and set values to records
    placeHolder.Variables.Add("X VAR");
    placeHolder.ValueSets.Add("Set 1");
    placeHolder.ValueSets.Add("Set 2");                
    
    //setting values
    MultiLangString oMultiLangString = new MultiLangString();
    oMultiLangString.AddString(ISOCode.Language.L___, "test string");
    placeHolder.Values["X VAR", "Set 1"] = oMultiLangString;
    
    // Set variable for FUNC_TEXT property
    Eplan.EplApi.Base.MultiLangString funcText = new MultiLangString();
    funcText.AddString(ISOCode.Language.L_en_US, "<X VAR>");
    placeHolder.SetPropertyEntry(oFunction, Properties.Function.FUNCTION_MESSAGETEXT, funcText);
    
    //Apply record
    placeHolder.ApplyRecord("Set 1");
    
    
    
    //creating PlaceHolder
    PlaceHolder oPlaceHolder = new PlaceHolder();
    oPlaceHolder.Create(m_oTestPage);
    
    oPlaceHolder.Variables.Add(new PlaceHolder.Variable(oPlaceHolder, "test variable 1"));
    oPlaceHolder.Variables.Add("test variable 2");
    oPlaceHolder.Variables.Add("test variable 3");
    oPlaceHolder.Variables.Remove("test variable 2");
    
    //adding value sets
    oPlaceHolder.ValueSets.Add("value set 1");
    oPlaceHolder.ValueSets.Add("value set 2");
    oPlaceHolder.ValueSets.Add("value set 3");
    oPlaceHolder.ValueSets.Remove("value set 1");                
    
    //setting values
    MultiLangString oMultiLangString = new MultiLangString();
    oMultiLangString.AddString(ISOCode.Language.L___, "test string");
    oPlaceHolder.Values["test variable 1", "value set 3"] = oMultiLangString;
    
    //setting IsChangeable
    oPlaceHolder.Variables["test variable 3"].IsChangeable = !oPlaceHolder.Variables[0].IsChangeable;
    oPlaceHolder.Variables.Add("test variable 2", true);                
    
    //clearing variables and value sets                 
    oPlaceHolder.ValueSets.Clear();
    oPlaceHolder.Variables.Clear();
    
    
    Public Constructors
     NameDescription
    Public ConstructorDefault constructor  
    Top
    Public Fields
     NameDescription
    Public FieldRepresents values table of a placeholder  
    Public FieldRepresents value sets of a placeholder  
    Public FieldRepresents variables of a placeholder  
    Top
    Public Properties
     NameDescription
    Public PropertyActivates the properties of the page for the place holder object.  
    Public PropertyGets/Sets a list of StorableObject references to a PlaceHolder object. The originally assigned references are replaced.  
    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 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 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 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 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 PropertyGets/Sets the actual visibility state of the object. (Inherited from Eplan.EplApi.DataModel.Graphics.GraphicalPlacement)
    Public PropertyGets layer id of layer assigned to this object. (Inherited from Eplan.EplApi.DataModel.Graphics.GraphicalPlacement)
    Public PropertyOverridden. Get or set the placement's location.  
    Public PropertyGets/Sets the name of the placeholder.  
    Public PropertyGets/Sets the name of a record, specified by its index.  
    Public PropertyCount of records.  
    Public PropertyCount of objects referenced by the PlaceHolder.  
    Public PropertyCount of Variables.  
    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 PropertyReturns the project the StorableObject belongs to. (Inherited from Eplan.EplApi.DataModel.StorableObject)
    Public Property.NET Property enabling access to P8 properties of the PlaceHolder object.  
    Public PropertyReturns PropertyPlacements assigned to the PlaceHolder.  
    Public PropertySpecifies Eplan.EplApi.DataModel.MasterData.SymbolVariant assigned to this PlaceHolder.  
    Public PropertyReturns the type of the object as number. (Inherited from Eplan.EplApi.DataModel.StorableObject)
    Public PropertyGets/Sets the value of a variable for a record.  
    Public PropertyNames of all variables in the PlaceHolder.  
    Top
    Public Methods
     NameDescription
    Public MethodAdds a new record with the specified name to the PlaceHolder object.  
    Public MethodAdds the reference of a Placement object to the placeholder.  
    Public MethodAdds a new variable to the PlaceHolder object.  
    Public MethodOverloaded. Applies a record of values on a PlaceHolder object.  
    Public MethodOverloaded. Copy Placement and insert the Copy into destination group. Copied placement will be inserted into desired project of destination group. If this placement is temporary, the copy will be persistent, if the destination group is also persistent. Group or Page, where the placement will be inserted. Defines whether a layer should be matched by name. (Inherited from Eplan.EplApi.DataModel.Placement)
    Public MethodCreates a new PlaceHolder object on the specified Page.  
    Public MethodOverridden. Creates transient and not placed PlaceHolder object.  
    Public MethodOverloaded. Deletes a record.  
    Public MethodDeletes all unused variables.  
    Public MethodDeletes a variable.  
    Public MethodDestructor for deterministic finalization of PlaceHolder 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 MethodFinds a record by name.  
    Public MethodFinds an object in the list of object referenced by a PlaceHolder.  
    Public MethodFinds a variable, specified by its name.  
    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 MethodServes as the default hash function. (Inherited from Eplan.EplApi.DataModel.StorableObject)
    Public MethodGets a value or variable on a property of an object referenced by a PlaceHolder.  
    Public Method\Returns the names of all records in the nIndex-th PlaceHolder of a Macro.  
    Public MethodReturns object type name. (Inherited from Eplan.EplApi.DataModel.StorableObject)
    Public MethodGets the value of a variable for a record.  
    Public MethodReturns the values of all variables in the nIndex-th PlaceHolder of a Macro variant for a given record.  
    Public Method\Returns the names of all variables in the nIndex-th PlaceHolder of a Macro variant.  
    Public MethodVerifies the correctness if a variable name of a placeholder. If a variable name contains invalid characters, this method \returns false.  
    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 MethodRemoves placement. (Inherited from Eplan.EplApi.DataModel.Placement)
    Public MethodRemoves invalid (e.g. deleted) object references from a PlaceHolder.  
    Public MethodRemoves object references from a PlaceHolder.  
    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 a value or variable on a property of an object referenced by a PlaceHolder. The reference of the object will be added to the PlaceHolder if necessary.  
    Public MethodSets the value of a variable for a record.  
    Public MethodThis method sets the visibility of the graphical instance to depend on the layer setting (Inherited from Eplan.EplApi.DataModel.Graphics.GraphicalPlacement)
    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 MethodReturns this object as string identifier. (Inherited from Eplan.EplApi.DataModel.StorableObject)
    Top
    See Also