In current DWG, how to insert all Layouts from another DWG file

In current  DWG, how to insert all Layouts from another DWG file

AutoCad Lisp Command:     (command "LAYOUT" "t" "W:\\ACADGRAC\\Template\\Skice.dwg" "*")

Bricscad Lisp Command:    ??????????????????????????????

The problem is that BricsCad not recognized Joker "*"

Thanks

Comments

  • The Template option of the Layout command allows to import a selection or all layouts of another drawing.
    Right click a layout, then choose 'From Template...' in the context menu.
  • OK, I’m familiar with that.

    I am writing LISP program and this command is repeating several times in cycle and I need to use this command without Dialog.

    This program works in Autocad and I’m customizing it for Bricscad.

    What this command needs is some kind of Joker that would give a sign that I want all Layouts.

    That way it could be compatible with one in Autocad.

    Thank

  • Try using LayoutListFile to get a list of all PS layouts in the template.
    Note: does not work if the template has been opened by a different user.
    [code](defun KGA_Sys_ApplyAlt (expr varLst)
      (not (vl-catch-all-error-p (vl-catch-all-apply expr varLst)))
    )

    (defun KGA_Sys_ImportOpen (fnm / acadObj fnmFound odbxObj)
      (if
        (and
          (setq fnmFound (findfile fnm))
          (=
            (vl-string-translate "\\" "/" (strcase fnmFound))
            (vl-string-translate "\\" "/" (setq fnm (strcase fnm)))
          )
          (setq acadObj (vlax-get-acad-object))
        )
        (cond
          (
            (vl-some
              '(lambda (docObj) (if (= (strcase (vla-get-fullname docObj)) fnm) docObj))
              (vle-collection->list (vla-get-documents acadObj))
            )
          )
          (
            (and
              (setq odbxObj (vla-getinterfaceobject acadObj "objectdbx.axdbdocument"))
              (KGA_Sys_ApplyAlt 'vla-open (list odbxObj fnm))
            )
            odbxObj
          )
        )
      )
    )

    ; (LAYOUTLISTFILE "D:\\Test\\Lyt.dwg")
    (defun LayoutListFile (fnm / doc lst)
      (if (setq doc (KGA_Sys_ImportOpen fnm))
        (progn
          (setq lst
            (vl-remove
              nil
              (mapcar
                '(lambda (lyt)
                  (if (= :vlax-false (vla-get-modeltype lyt)) (vla-get-name lyt))
                )
                (vle-collection->list (vla-get-layouts doc))
              )
            )
          )
          (vlax-release-object doc)
          (gc)
          lst
        )
      )
    )[/code]
  • List Layouts from DWG works for me.

    Many thanks Mr. Roy

This discussion has been closed.