Answered
How to place symbols exactly over an item using that item position
- September 12, 2022
- 3 replies
- 1255 views
Hi All,
I'm working on a CAD document and symbol library. I need to place the symbols over the page items, so I used the page item name and symbol name to match once both the names matched then the position of the page item is used for adding the symbol to that position.
var pathItemLayer = currLayer.pageItems[a].name;
if(app.activeDocument.symbols.length > 0){
for(var s=0; s<app.activeDocument.symbols.length; s++){
symbolName = app.activeDocument.symbols[s].name;
if(String(pathItemLayer) == String(symbolName)){
var bounds = currLayer.pageItems[a].position;
var tmark = app.activeDocument.symbols.getByName(symbolName);
app.activeDocument.symbolItems.add(tmark).position = [Number(bounds[0]),Number(bounds[1])];
continue
}
}
}I can able to place the symbol in that position, but I'm finding issues with that (Please find the screenshot). Both Pageitem and Symbol have the same width and Height. I tried to place the symbol manual over the page item fits exactly without getting the below error.

Kindly help me with this issue
Thank you
