Author Topic: Help me to find the Error  (Read 1806 times)

0 Members and 1 Guest are viewing this topic.

jitupnair

  • Guest
Help me to find the Error
« 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

jitupnair

  • Guest
Re: Help me to find the Error
« Reply #1 on: October 05, 2011, 01:49:40 AM »
Help me please ........................ :oops:

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Help me to find the Error
« Reply #2 on: October 05, 2011, 03:08:30 AM »
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:
Code: [Select]
(vla-put-ActiveLayout doc (vla-Item (vla-get-Layouts doc) "Model"))Perhaps that would help.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

jitupnair

  • Guest
Re: Help me to find the Error
« Reply #3 on: October 05, 2011, 06:14:05 AM »
; error: ActiveX Server returned the error: unknown name: ActiveLayout

jitupnair

  • Guest
Re: Help me to find the Error
« Reply #4 on: October 05, 2011, 06:16:04 AM »
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

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Help me to find the Error
« Reply #5 on: October 05, 2011, 06:26:25 AM »
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.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.