Description
Insert a library object, specified by id, in page.
Syntax
dim e = Page.AddLibObj (id, X, Y, Flag) |
Id
id of the library object. If library object is 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 AddLibObjId 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 AddLibObjId will work exactly as insertion from library panel. Remember that AddLibObjId will exit immediately, before the object is really inserted in page using mouse click.
Examples
Page.AddLibObj (12345,20000,3000,0)
Insert library object with ID=12345 at given coords without playing the tool.
Page.AddLibObj (12345,0,0,2+4)
Insert library object with ID=12345 using mouse, playing the tool.
Page.AddLibObj (12345,0,0,1+4)
Insert library object with ID=12345 replacing page selection, playing the tool.
Page.AddLibObj (12345,0,0,1)
Insert library object with ID=12345 replacing page selection, without playing the tool
Page.AddLibObj (12345,0,0,1+4+8)
Insert library object with ID=12345 replacing page selection, playing the tool, hiding the replacement warning
Context
Page designer
See also
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