Hello everyone,
I have had a method for copy an object in model space :
(setq newtxtobj (vla-copy txtobj))
(setq bp_txtobj (vlax-get txtobj 'InsertionPoint))
(vla-move newtxtobj(vlax-3d-point bp_owner) (vlax-3d-point pt_owner))
It's been working fine so far , with a project I have to copy a text from model to layout, but the copy of the text is created on the model after using this code while I intend to create it on "Layout1" (although I'm using CTAB to make current the layout) :
(setq obj (vlax-ename->vla-object (car (entsel))))
(setq newobj (vla-copy obj))
(setq bp (vlax-get obj 'InsertionPoint))
(setvar "ctab" "Layout1")
(setq pt (getpoint))
(vla-move newobj
(vlax-3d-point bp)
(vlax-3d-point pt)
)
Could someone tell me what the problem is with the codes ?
Thanks in advance.