AddLibObj Method

Build 1501 on 14/Nov/2017  This topic last edited on: 23/Mar/2016, at 12:14

Description

Insert a library object, specified by name, in page.

Syntax

dim e = Page.AddLibObj (LibName, ObjName, X, Y, Flag)

LibName

name of the library. If "LibName" and "ObjName" are empty, and another object was inserted before, then the same object will be re-inserted without object reload from database. If library or object are not found, the command returns 1202.

ObjName

name of the object. If "LibName" and "ObjName" are empty, and another object was inserted before, then the same object will be re-inserted without object reload from database. If library or object are not found, the command returns 1202.

X

horizontal position on the page. Use only flag 0 or 4 (Bit 0 and Bit 1 are off :no replace, no mouse).

Y

vertical position on the page. Use only flag 0 or 4 (Bit 0 and Bit 1 are off :no replace, no mouse).

Flag

working mode.

0 = place object on specified X and Y, do not play tool.

1 (Bit 0) = Replace selected object (X and Y, if specified, are ignored)

2 (Bit 1) = Attach to mouse (X and Y, if specified, are ignored)

4 (Bit 2) = Play object tool.

8 (Bit 3) = Do not prompt to replace the selected object.

 

You can sum values to activate more flags at once, e.g. 2+4 attaches the object to the mouse and will play tool.

 

Notes:

If Bit 0 is enabled, and no object are selected in page, the AddLibObj will exit without insertion. The "replace" option can be useful in conjunction with "SelectArea" method, creating a temporary box that will be replaced by library object.

If Bit 1 is enabled, the AddLibObj will work exactly as insertion from the library panel. Remember that AddLibObj will exit immediately, before the object is really inserted in page using mouse click.

Examples

Page.AddLibObj ("syslib","y3",20000,3000,0)

Insert "y3" object from the "syslib" library at given coords without playing the tool.

 

Page.AddLibObj ("main","obj1",0,0,2+4)

Insert "main/obj1" object using mouse, playing the tool.

 

Page.AddLibObj ("main","obj2",0,0,1+4)

Insert "main/obj2" object replacing page selection, playing the tool, being prompted to confirm the replacement.

 

Page.AddLibObj ("main","obj2",0,0,1+4ì9)

Insert "main/obj2" object replacing page selection, playing the tool, without any prompt.

 

Page.AddLibObj ("mylib","bullet",0,0,0)

for i=1 to 9

 Page.AddLibObj ("","",i*50000,i*50000,4)

next

Insert "mylib/bullet" object at (0,0) and then insert it 9 times more along the page. Play tool for each repeated object only

Context

Page designer

See also

AddLibObjId

All object creation related commands

AddBoxEx, AddElliEx, AddHRuleEx, AddImageEx, AddLibObj, AddLibObjId, AddVRuleEx, ArticleNewPicture

EditPaste, EditPasteAttrib, EditPasteEx, ImgInsert, ImgInsertType, ObjDuplicate

All commands/scripts related to library objects

AddLibObj Method

AddLibObjId Method

BrowseLib Script

ExpandLogicalSelection Method

LibAddTo Method

LG_LibGroupId

LG_LibName

LG_LibObjName

ObjSetFromLib Method

ObjSetLogicalGroup Method

OnLabelTedExtra Script

SetTedExtraLibMode Method

TestIsTedExtraLib Method