TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: jitupnair on September 20, 2011, 04:11:21 AM
-
Hi All,
I am trying to attach one file to all drawing files in a selected directory (Batch xref attach). I need to attach the file in model space. But this lisp is attaching the file in the last saved space in my system.
I am using AutoCAD 2010.
Please help me to find the error in the attached file
-
Help me please ........................ :oops:
-
Sorry I'm unsure why this happens. You are using the AttachExternalReference method on the ModelSpace object, so it "should" get attached correctly. Perhaps it's a bug with DBX?
Perhaps rather use a script and set the CTab of these drawings to "Model" before you run your code.
Alternatively you could do so through the ActiveX just before attaching:(vla-put-ActiveLayout doc (vla-Item (vla-get-Layouts doc) "Model"))
Perhaps that would help.
-
; error: ActiveX Server returned the error: unknown name: ActiveLayout
-
Thanks for your replay
When I used (vla-put-ActiveLayout doc (vla-Item (vla-get-Layouts doc) "Model"))
Its giving an error as shown below.
; error: ActiveX Server returned the error: unknown name: ActiveLayout
-
I'm not sure why. It seems to work fine on my Vanilla 2011, though I haven't tested it through DBX - which may be the problem. There's many strange things which isn't perfect inside DBX.
AFAICT your best bet would be to go with SCR and just change the CTab variable to Model. But then it's probably just as good to include the XAttach through the SCR as well.