IPCsDrawing


Topic:

Properties and methods of IPCsDrawing


[+] IPCsDrawing

Class hierarchy:

IPCsApplication IPCsDocument IPCsDrawing


Properties / Methods:

GetSymbolFromHandle Returns a Symbol (IPCsSymbol ). Parameters needed: A pagenumber, and the handle to the symbol (cardinal). If pagenumber is -1, then the method will find the correct page itself.
Syntax:
function GetSymbolFromHandle(PageNo: Integer; SymbolHandle: Integer): IPCsSymbol;
GetLineFromHandle Returns a Line (IPCsLine ). Parameters needed: A pagenumber, and the handle to the line (cardinal). If pagenumber is -1, then the method will find the correct page itself.
Syntax:
function GetLineFromHandle(PageNo: Integer; LineHandle: Integer): IPCsLine;
GetTextFromHandle Returns a Text (IPCsText ). Parameters needed: A pagenumber, and the handle to the text (cardinal). If pagenumber is -1, then the method will find the correct page itself.
Syntax:
function GetTextFromHandle(PageNo: Integer; TextHandle: Integer): IPCsText;
Pages Selecting a specific page in the project. Type is IPCsPages
Title The title of the project
Lists Used to retrieve list of symbol, lines etc. Type is IPCsLists
Preferences Used to get snapvalues from a page. Type is IPCsDrawingPreferences
ProjectData Used to read and write projectdata. Parameters needed: An integer, which is the number of Projectdata-item to access. Method returns a string.
To get number of Projectdata, use Drawings method ProjectDataDefs

Example:Drawing.ProjectData[x]
See the predefined list of ProjectDataDefs
ProjectDataDefs Each Drawing.ProjectData has a fieldname. Get it through ProjectDataDef. Ex. ProjectDataDef[0] (Prehaps its = 'Customername'). And ProjectData[0] contains the value assigned to that field
To get number of items use VarArrayHighBound(Drawing.ProjectDataDefs,1)

See the predefined list of ProjectDataDefs
The none-predefined list can be made by this simple code
PageDataDefs To get number of items, use VarArrayHighBound(Drawing.PageDataDefs,1)
See the predefined list of PageDataDefs
The none-predefined list can be made by this simple code
ReferenceDesignations Used to read and write referencedata. Type is IPCsReferenceDesignations
SymbolDataDefs To get number of items, use VarArrayHighBound(Drawing.SymbolDataDefs,1)
See the predefined list of ProjectDataDefs
The none-predefined list can be made by this simple code
LibTypes Selecting a specific IPCsLibType
Layers Selecting a specific IPCsLayers


Comments:

It's possible to getting access to a page in 2 different ways.
Either use the ActivePage property (PCsApplication.ActiveDocument.ActivePage.Symbols....)
Or use the drawing property to select a specific page (PCsApplication.ActiveDocument.Drawing.Pages[integer].Symbols)
If the integer used is the actual active pagenumber, the 2 different calls will give the same result.


[+] IPCsDrawing2

Class hierarchy:

IPCsApplication IPCsDocument IPCsDrawing 2


Properties / Methods:

LoadLogo Loads a logo. Parameters needed: A index that should be either 0 or 1 (0 = logo1, 1=logo2), and the filename to the logo.
Syntax:
function loadLogo(Index: Integer; const Filename : widestring): boolean;
Fileformat supported: BMP, JPG, GIF & PNG.
LogoCount Number of logos in a project
Logos Used to access a specific Logo. Parameters needed: an integer. Return type is IPCsExternalObject
Syntax:
property Logos[Index: Integer]: IPCsExternalObject
SynchronizePLCDataIf called with 'UPDATEPLCS=TRUE', transfers data from PLC reference to PLC i/o.
If called with 'UPDATEPLCS=FALSE', transfers data from PLC i/o to PLC reference.
UpdateFromDatabaseUpdates the project from the database.


Comments:

To get access to IPCsDrawing2 methods and properties, it's necessary to typecast IPCsDrawing to IPCsDrawing2.
This can be done like this: (PCsApplication.ActiveDocument.Drawing as IPCsDrawing2).