** Error: Automation Error E_FAIL; [IAcadDocument] function [LAYERS] unspecified error**

SticksAndBrics
edited May 2023 in 2D Drafting
Why am I getting this error?

I'm using the Cone11 traffic management operations software on BricsCad Lite, and whenever I try to place a sign on the modelspace I get this notification in the command console.

I have been saving and restarting Brics each time and it reopens and works perfectly (until I begin the next session that I open from my template.

Not sure how to go about remedying this; any help would be greatly appreciated!

Many thanks

Comments

  • Did you go back to Cone 11 for help that should be 1st step.
  • I just wondered if anyone knew what type of error this might be. Naturally, upon contacting Cone they were not particularly helpful. Now I feel less helped than before.
  • It may need Bricads Pro not Bricscad Lite. Ask them again.
  • SticksAndBrics
    edited May 2023
    I would be inclined to agree with you except I've been using the Lite version for the past 8 months without this error, so I want to believe it's a change I've made in the settings or an issue I can easily address.
  • Its_Alive
    edited May 2023
    It’s most likely the module, you can test to see if the LAYERS method is available to lite with a simple lisp routine.
    (defun c:doit ()
    (print(setq acadobject (vlax-get-Acad-Object)))
    (print(setq activedocument (vla-get-activedocument acadobject)))
    (print(setq LayerTable (vla-get-layers activedocument)))
    (print(setq theLayer (vla-item LayerTable "0")))
    (vla-put-activelayer activedocument (vla-item LayerTable "0"))
    (print(setq aNewLayer (vla-add LayerTable "NewLayer")))
    )
  • Hi Nigel,

    Thank you for the insight! Am I correct in thinking I simply import that into notepad, save it as a .LSP then drag + drop into BricsCad? What is this code supposed to do exactly? Sorry if I come across as dense, I'm still relatively new to this whole industry!

    Many thanks

    It’s most likely the module, you can test to see if the LAYERS method is available to lite with a simple lisp routine.

    (defun c:doit ()
    (print(setq acadobject (vlax-get-Acad-Object)))
    (print(setq activedocument (vla-get-activedocument acadobject)))
    (print(setq LayerTable (vla-get-layers activedocument)))
    (print(setq theLayer (vla-item LayerTable "0")))
    (vla-put-activelayer activedocument (vla-item LayerTable "0"))
    (print(setq aNewLayer (vla-add LayerTable "NewLayer")))
    )
  • Its_Alive
    edited May 2023

    Hi Nigel,

    Thank you for the insight! Am I correct in thinking I simply import that into notepad, save it as a .LSP then drag + drop into BricsCad? What is this code supposed to do exactly? Sorry if I come across as dense, I'm still relatively new to this whole industry!

    yep, or copy and paste it onto the command line, and type doit
    if you see something like

    VLA-OBJECT IAcadApplication 0000000042FC2190
    VLA-OBJECT IAcadDocument 000000004BFF2798
    VLA-OBJECT IAcadLayers 000000004382EE40
    VLA-OBJECT IAcadLayer 000000004382EEC0
    VLA-OBJECT IAcadLayer 000000004382EF40
    and if you have a new layer named "NewLayer" then IAcadDocument.LAYERS works and it's probably the module that's broken

  • I'll be honest in that I blindly followed your instructions, and can say that I have not found this issue to appear once in the last 3 days!! I think you've solved it, whatever the issue actually was. Thank you so much Nigel as you've saved me a great deal of stress :)